Page 1 of 1
list ALL posts in one page!
Posted: Thu Dec 04, 2008 12:21 am
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
Posted: Thu Dec 04, 2008 1:40 am
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....
Posted: Thu Dec 04, 2008 1:54 am
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!
Posted: Thu Dec 04, 2008 11:44 am
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:
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
Posted: Thu Dec 04, 2008 9:14 pm
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
Posted: Fri Dec 05, 2008 11:00 am
by garvinhicking
Hi!
Only index.php?fullview=1 will be affected.
Regards,
Garvin
Posted: Sun Dec 14, 2008 10:44 pm
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
Posted: Mon Dec 15, 2008 3:11 pm
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.
Posted: Mon Dec 15, 2008 5:54 pm
by ameo
Super, Thanks Don,
works like magic now
Posted: Mon Dec 22, 2008 4:34 am
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?
Posted: Mon Dec 22, 2008 10:46 am
by garvinhicking
Hi!
I think then you could use "{if $view == 'start'}" instead of "{if $smarty.get.fullview}".
Regards,
Garvin
Posted: Mon Dec 22, 2008 5:28 pm
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 == ''}
Posted: Wed Dec 24, 2008 1:08 am
by codetwists
You guys are good! That's doing EXACTLY what I'd hoped for.
Thanks,
Myron
Posted: Wed Dec 24, 2008 4:15 am
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!