list ALL posts in one page!

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
ameo
Regular
Posts: 143
Joined: Fri Sep 26, 2008 4:13 am

list ALL posts in one page!

Post by ameo »

just one page that fetches all posts and display a list of all the posts links?
just links not content!

can this be done on s9y?

thanks
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

Can you put that into a bit of context? Is this supposed to replace a page view that currently behaves differently?

My first instinct is to use serendipity_fetchPrintEntries and a custom tpl that only shows the entry title....
=Don=
ameo
Regular
Posts: 143
Joined: Fri Sep 26, 2008 4:13 am

Post by ameo »

Well, you've almost got what i meant..
i thought about this when i was trying to get to an old post from 4 or 5 months ago and i had to search for it and click through some links to get finally to it.

and if it's possible to have just one page that lists all the entries titles/url on the blog that will make calling old posts urls easy task.

i also checked the plugin that enables the post url when you type [[title]] but that only worked when i know the exact title!
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Like Don suggested, using a custom template file would be sufficient for that. But it involves some custom coding.

1: Edit your template's content.tpl (copy it over from templates/default/content.tpl if you don't have it already in your template directory).

Modify this:

Code: Select all

{$ENTRIES}
{$ARCHIVES}
to this:

Code: Select all

{if $smarty.get.fullview}
{serendipity_fetchPrintEntries limit=9999 template="full.tpl"}
{else}
{$ENTRIES}
{$ARCHIVES}
{/if}
This IF-Check will check on a special variable (see later) if you want the full output. If yes, it uses serendipity_fetchPrintEntries (documented on http://www.s9y.org/78.html) to fetch 9999 entries and use the template "full.tpl" to display them.

2: Create a full.tpl template file. In its most basic form it would look like this:

Code: Select all

{foreach from=$entries item="dategroup"}
  {foreach from=$dategroup.entries item="entry"}
    <p><a href="{$entry.link}">{$entry.title}</a></p>
  {/foreach}
{/foreach}
3: Call your blog via index.php?fullview=1 (fullview is this special variable that was mentioned) and now your special template will be parsed.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
ameo
Regular
Posts: 143
Joined: Fri Sep 26, 2008 4:13 am

Post by ameo »

Thanks i'll definitely try this tonight.. just one question,
if i edited BP content.tpl and created the full.tpl files.

will that affect ONLY index.php?fullview=1 ??
and i'm using premalinks domain/archives/post-name will these changes have any effect on other links? or just index.php?fullview=1
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Only index.php?fullview=1 will be affected.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
ameo
Regular
Posts: 143
Joined: Fri Sep 26, 2008 4:13 am

Post by ameo »

Hi there,
First.. sorry for not replying all that time, i was in a business trip and couldn't perform my daily stuff online.

IT WORKS,
for some reason the random post sidebar plugin doesn't work on index.php?fullview=1
but basically it shows all the blog posts.

thanks guys

btw, something just came to my mind.. is it possible to get these links numbered? or making it looks a little prettier?
when i first thought about that page was only for my own usage but i'm thinking about letting others see it too

http://xrl.in/18k6

i'm happy with it now as i does exactly what i need, so if customizing it needs lot of work then i'll keep it for myself.

thanks again gravin, Don
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

ameo wrote:btw, something just came to my mind.. is it possible to get these links numbered? or making it looks a little prettier?
when i first thought about that page was only for my own usage but i'm thinking about letting others see it too

http://xrl.in/18k6
Perfect timing for your question as someone else needed something like this too (but not for visible numbering)...

In your custom entries.tpl file, try this....

Code: Select all

{counter start=1 assign='count'}
{foreach from=$entries item="dategroup"}
  {foreach from=$dategroup.entries item="entry"}
    <p><a href="{$entry.link}">{$count}.  {$entry.title}</a></p>
    {counter assign='count'}
  {/foreach}
{/foreach} 
You can move the "{$count}. " outside of the <a> if you do not want it to be part of the hyperlink.

That will give you a running counter that does not reset with each change in the outer dategroup loop.
=Don=
ameo
Regular
Posts: 143
Joined: Fri Sep 26, 2008 4:13 am

Post by ameo »

Super, Thanks Don,

works like magic now
codetwists
Regular
Posts: 44
Joined: Sat Dec 20, 2008 5:46 pm

Post by codetwists »

garvinhicking wrote:3: Call your blog via index.php?fullview=1 (fullview is this special variable that was mentioned) and now your special template will be parsed.
That worked. Now how do I get that to load when the site loads without having to call it via index.php?fullview=1?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

I think then you could use "{if $view == 'start'}" instead of "{if $smarty.get.fullview}".

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

garvinhicking wrote:Hi!

I think then you could use "{if $view == 'start'}" instead of "{if $smarty.get.fullview}".

Regards,
Garvin
A better suggestion you once made:

Code: Select all

{if $view == 'start' AND $staticpage_pagetitle == ''}
=Don=
codetwists
Regular
Posts: 44
Joined: Sat Dec 20, 2008 5:46 pm

Post by codetwists »

You guys are good! That's doing EXACTLY what I'd hoped for.

Thanks,

Myron
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

codetwists wrote:You guys are good! That's doing EXACTLY what I'd hoped for.

Thanks,

Myron
Happy to hear it is working out for you! Keep up the great work & Happy Holidays!
=Don=
Post Reply