In my blog (http://www.fazaza.com) at the bottom of the page I can see only information about how many pages I have. The only navigation option is to go to next/previous page.
I'm looking for a way to navigate directly to each page. Is there a way to solve this issue?
Looking for a way to hyper link to all blog pages
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Looking for a way to hyper link to all blog pages
Hi!
Yes, this is possible by editing your entries.tpl template file. The variables for the number of pages is there in smarty, as well as the current page. With this information you can build any smarty loop you want.
Some examples are here:
http://board.s9y.org/viewtopic.php?t=17 ... pagination
http://board.s9y.org/viewtopic.php?t=13 ... pagination
HTH,
Garvin
Yes, this is possible by editing your entries.tpl template file. The variables for the number of pages is there in smarty, as well as the current page. With this information you can build any smarty loop you want.
Some examples are here:
http://board.s9y.org/viewtopic.php?t=17 ... pagination
http://board.s9y.org/viewtopic.php?t=13 ... pagination
HTH,
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/
# 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/
Not exactly what I wanted...
One of your links was in German so I used the english one.
I've tried to follow the instructions but it was more of a dialog where I lost track at some point.
However, I've tried to improvise with the information and got page numbers at my blog.
The only problem now is that the numbers are at the bottom of the page and not related to the Next/Prev.
I've added this code at the bottom of the entries.tpl:
<div class="pagelinks">
{eval var=$footer_currentPage-3 assign="paginationStartPage"}
{if $footer_currentPage+3 > $footer_totalPages}
{eval var=$footer_totalPages-6 assign="paginationStartPage"}
{/if}
{if $paginationStartPage <= 0}{assign var="paginationStartPage" value="1"}{/if}
{section name=i start=$paginationStartPage loop=$footer_totalPages+1 max=7}
{if $smarty.section.i.index != $footer_currentPage}
<a href="{$smarty.section.i.index|string_format:$footer_pageLink}">{$smarty.section.i.index}</a>
{else}
{$smarty.section.i.index}
{/if}
{/section}
{if $smarty.section.i.index < $footer_totalPages}
... <a href="{$footer_totalPages|string_format:$footer_pageLink}">{$footer_totalPages}</a>
{/if}
</div>
<!-- ENTRIES END -->
I've tried to follow the instructions but it was more of a dialog where I lost track at some point.
However, I've tried to improvise with the information and got page numbers at my blog.
The only problem now is that the numbers are at the bottom of the page and not related to the Next/Prev.
I've added this code at the bottom of the entries.tpl:
<div class="pagelinks">
{eval var=$footer_currentPage-3 assign="paginationStartPage"}
{if $footer_currentPage+3 > $footer_totalPages}
{eval var=$footer_totalPages-6 assign="paginationStartPage"}
{/if}
{if $paginationStartPage <= 0}{assign var="paginationStartPage" value="1"}{/if}
{section name=i start=$paginationStartPage loop=$footer_totalPages+1 max=7}
{if $smarty.section.i.index != $footer_currentPage}
<a href="{$smarty.section.i.index|string_format:$footer_pageLink}">{$smarty.section.i.index}</a>
{else}
{$smarty.section.i.index}
{/if}
{/section}
{if $smarty.section.i.index < $footer_totalPages}
... <a href="{$footer_totalPages|string_format:$footer_pageLink}">{$footer_totalPages}</a>
{/if}
</div>
<!-- ENTRIES END -->
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Not exactly what I wanted...
Hi!
Hm, that code actually does not look so bad. On which URL can I see the output?
Maybe you can still use the Smarty code of the german entry, that should be usable as well![Smile :)](./images/smilies/icon_smile.gif)
Regards,
Garvin
Hm, that code actually does not look so bad. On which URL can I see the output?
Maybe you can still use the Smarty code of the german entry, that should be usable as well
![Smile :)](./images/smilies/icon_smile.gif)
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/
# 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/
The URL
It's on my blog http://www.fazaza.com (named after my cat, that is quite a funny animal...)
Look at the bottom of the page.
I'll try to practice my german in the meantime.![Wink :wink:](./images/smilies/icon_wink.gif)
Look at the bottom of the page.
I'll try to practice my german in the meantime.
![Wink :wink:](./images/smilies/icon_wink.gif)
I did a bit of browsing on this subject the other day and altered my code to look like this:The result is pretty neat (and like suggested, <span id="thispage">{$smarty.section.i.index}</span> makes the current page marker easy to costumize.
). Hope that helps a bit. ![Smile :)](./images/smilies/icon_smile.gif)
Code: Select all
<div class='serendipity_pageFooter' style="text-align: center">
{if $footer_info}
{if $footer_prev_page}
<a href="{$footer_prev_page}">« Previous</a>
{else}
<span class="grey">« Previous</span>
{/if}
{else}
{/if}
{eval var=$footer_currentPage-3 assign="paginationStartPage"}
{if $footer_currentPage+3 > $footer_totalPages}
{eval var=$footer_totalPages-6 assign="paginationStartPage"}
{/if}
{if $paginationStartPage <= 0}{assign var="paginationStartPage" value="1"}{/if}
{section name=i start=$paginationStartPage loop=$footer_totalPages+1 max=7}
{if $smarty.section.i.index != $footer_currentPage}
<a href="{$smarty.section.i.index|string_format:$footer_pageLink}">{$smarty.section.i.index}</a>
{else}
<span id="thispage">{$smarty.section.i.index}</span>
{/if}
{/section}
{if $smarty.section.i.index < $footer_totalPages}
... <a href="{$footer_totalPages|string_format:$footer_pageLink}">{$footer_totalPages}</a>
{/if}
{if $footer_info}
{if $footer_next_page}
<a href="{$footer_next_page}">Next »</a>
{else}
<span class="grey">Next »</span>
{/if}
{else}
{/if}
</div>
![Smile :)](./images/smilies/icon_smile.gif)
![Smile :)](./images/smilies/icon_smile.gif)
Re: Not exactly what I wanted...
So what's the problem with that? As far as I can see, you're using exactly the same code I am using, and it also seems to work fine.shovals wrote:The only problem now is that the numbers are at the bottom of the page and not related to the Next/Prev.
It's just that it's not looking very well, which is probably what you mean by "not related to the Next/Prev", right? So you're going to have to add some CSS to your style.css to make it look the way you want it to look.
The code you got from the other thread only generates the pagination, it does not apply any styling.
YL
CSS code?!
Yes, you are right.It's just that it's not looking very well, which is probably what you mean by "not related to the Next/Prev", right?
I'd be happy to make it look better, but i don't even have a clue what CSS is.
![Embarassed :oops:](./images/smilies/icon_redface.gif)
Can you give me some leads on how to write CSS that will help me with the design?
Re: CSS code?!
Well, can you tell me how you want it to look like?shovals wrote:Can you give me some leads on how to write CSS that will help me with the design?
![Smile :)](./images/smilies/icon_smile.gif)
YL
Style
Well, I've been looking in http://www.smashingmagazine.com/2007/11 ... practices/
and the first example of the Simple Enumeration is fine for me.
and the first example of the Simple Enumeration is fine for me.