If first entry / target latest post

Get help with installation and running PivotX 2.0.x here. Please do not post Extension or Theme related questions here.

If first entry / target latest post

Postby dokistation » Tue Sep 23, 2014 6:06 am

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.
dokistation
 
Posts: 19
Joined: Fri Aug 27, 2010 1:50 pm

Re: If first entry / target latest post

Postby dokistation » Tue Sep 23, 2014 6:28 am

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.
dokistation
 
Posts: 19
Joined: Fri Aug 27, 2010 1:50 pm

Re: If first entry / target latest post

Postby hansfn » Fri Sep 26, 2014 11:44 pm

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 ]]
hansfn
Developer
 
Posts: 3281
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway


Return to 2.x Support Forum

Who is online

Users browsing this forum: No registered users and 7 guests

cron