Page 1 of 1

If first entry / target latest post

PostPosted: Tue Sep 23, 2014 6:06 am
by dokistation
Hello hello, it's been a while!

I'm poking at PivotX again and I'm wondering if I can somehow do the following:

I'm interested in displaying the latest post in the blog as a full post, but I want the posts after it to only display the titles. For example:

Latest Post
This is the latest post, blah blah blah

Title of 2nd latest post
Title of 3rd latest post
Title of 4th latest post
Title of 5th latest post
And so on...

Is there a way to dynamically achieve this somehow? Thanks in advance.

Re: If first entry / target latest post

PostPosted: Tue Sep 23, 2014 6:28 am
by dokistation
I think I've managed to sort it out.

I used the guide on listing archives with titles, http://book.pivotx.net/page/app-c
Modified it to not show in a list and not show the month or year, and offset the subweblog by 1.

Re: If first entry / target latest post

PostPosted: Fri Sep 26, 2014 11:44 pm
by hansfn
Hi, it's always a good idea to post your code. That way other people can learn from you and/or you can get tips to improve your code. (If you actually used the code from the PivotX book unchanged, my comment is a little bit off.)

Anyway, it's probably better to use $first / $last:

Code: Select all
[[ subweblog name="standard"]][[ literal ]]
    [[ if $first ]]
         Display of first (latest) entry.
    [[ else ]]
         Display of all other entries.
    [[ /if ]]
[[ /literal ]][[ /subweblog ]]