This TypoScript menu sample is a little different than most. Instead of a showing a menu that list pages, this menu shows your end user Next page, Previous page and Up a level links.
Like most TypoScript menu objects, put this code into your TypoScript template setup section and apply it to your template by calling lib.internalnav
.
lib.internalnav = HMENU lib.internalnav { special = browse special { items = up|prev|next items.prevnextToSection = 1 up.fields.title = Up a level prev.fields.title = Previous page next.fields.title = Next page } 1 = TMENU 1.NO { linkWrap = | | |*||*|| stdWrap.htmlSpecialChars = 1 } } # Change link labels between "section" and "pages" for the top level pages [treeLevel = 1] lib.internalnav.special { prev.fields.title = Previous section next.fields.title = Next section } [end]
Reference
- HMENU
- TMENU
- TMENUITEM
–
Originally posted on Cannonbose.com.
thank you for the example. Could you make that with buttons instead of the texts. For example: a button for the previous and a button for the next pages etc. ???
Fredy, You’re welcome for the previous/next navigation TypoScript example. Have you thought to style the text as a button via CSS instead? The problem with using buttons is that you’ll need to introduce a form. While not a major issue, it does seem overkill. Ciao!
Hey I am trying to implement this so that it creates a browse menu for parent and subpages instead of pages in the same tree. And would like to use arrow images for the prev and next page(s). So I want to end up with a menu like:
where are previous and next pages respectively and 2 is the current page. How do I set this up because I can’t think of a way to set up auto numbering.
Thank you for writing. I’m not quite getting what kind of navigation structure you’re wanting. Can you please provide a sample sitemap and nav menu demonstrating what you’re trying to accomplish?