Member
Member
slaattnes   2009-10-12, 03:48
#1

Hi

I know that the developers have enough to do and help with theming isn't your top priority. Understandingly, but if anyone can nudge me in the right direction I would appreciate.

I'm trying to get the two next_album and next_news loops fit together on my index page. I managed it in a way: http://trondheimkunsthall.com/

I want albums and news to descend together after published date though. Now the 10 last texts come first (as set at the zenpage plugin in admin-options.php?page=options&tab=plugin) and then the 10 last albums (as set in admin-options.php&tab=theme).

I am wondering: Where are the next_album and next_news functions declared?

My code is like this:

`

         |   | 








    "> 

     ">

`
There is also another problem:

If I push the next page link, the first loop disappares. I must confess I don't understand how printPageListWithNav works either, because I recond it is there this other problem lies. Where is printPageListWithNav declared? (Maybe "declared" isn't the right word, I mean where is the code for the three functions.)

Member
Member
kagutsuchi   2009-10-12, 04:20
#2

If I understand what you're describing correctly, the Combinews feature should be what you want. It will list albums as news (if the correct Zenpage option is set) and then you can simply use the next_news() function to iterate through both albums and news, effectively merging them together.

The second problem is that you only have four news items published. Once all four of the news items have been printed to the first page, there are no more for any other pages. So say that you have 12 news items instead of four. If you had 12, you would see ten on the first page and two on the second page. On the third page, you would not have any news items left.

FYI, next_album() is defined in zp-core/template-functions.php and next_news() is defined in zp-core/plugins/zenpage/zenpage-template-functions.php. printPageListWithNav() is also defined in zp-core/template-functions.php. All the Zenphoto functions can be found in the User Guide on the Zenphoto website, though it's suggested not to modify any of the core functions.

Member
Member
slaattnes   2009-10-12, 04:27
#3

Thanks! I have to look on this tomorrow:-) I think I remember that I tried Combinews but that it didn't work for some reason. Well, I'll have to try.

Administrator
Administrator
acrylian   2009-10-12, 09:13
#4

kagutsuchi is right. You can't have the next_album and next_news loop on one page as they both use the same variable to determine pagination. So this leads to funny results. An alternative to CombiNews is to use the printLatestNews() function if you want the main albums loop.

Member
Member
slaattnes   2009-10-12, 16:10
#5

The problem with Combinews is that I want one gallery.php with only the albums and one gallery1.php with both albums and news. As far as I remember I couldn't get Combinews dissabled in one of them. I'll just have to try to fool around till I find a solution.

Administrator
Administrator
acrylian   2009-10-12, 16:28
#6

Sorry, it is not possible to have the album and news loop on one page for the reasons explained above.

Member
Member
kagutsuchi   2009-10-12, 17:04
#7

I haven't tried this so I'm not certain if it will work, but you may be able to use setOption() to override the Combinews option for your gallery.php with only albums. Then you can theme it how you like. You can read up on setOption() in the Theming Tutorial or look it up in the documentation found in the User Guide.

Member
Member
slaattnes   2010-01-15, 02:55
#8

Even though I am kind of thickheaded now, would it not be possible to do something like this?

`

some html formatting code

   same here

`

Administrator
Administrator
acrylian   2010-01-15, 11:15
#9

We don't have functions like next_newsDate()and next_albumDate(). Also you can't put parts of a loop within an if clause, that nesting is not valid.

Maybe you should explain what you are actually trying to do?

Member
Member
slaattnes   2010-01-20, 01:07
#10

Yes, that would be a good starting point;-) I was trying to make a loop where albums and news were processed alike regarding both time (only the last published albums and news) and the amount (for example that the loop prints the ten last posts; an album, two texts and the rest albums because that was what were the ten last posted items).

Anyway, I have just made a new front page instead. It's more easy to plot in the html manually until I'm better in php.

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.