I have a set of pages that I want to index via simple menu that I put into the chunk like this:
<ul>
<li><a href="[~39~]">Link 1</a></li>
<li><a href="[~44~]">Link 2</a></li>
<li><a href="[~45~]">Link 3</a></li>
<li><a href="[~46~]">Link 4</a></li>
<li><a href="[~47~]">Link 5</a></li>
<li><a href="[~48~]">Link 6</a></li>
<li><a href="[~49~]">Link 6</a></li>
</ul>
Is it possible to display a page title for each page via variables, instead of hardcoding text (Link1, Link2, etc...) ?
I’ve searched forums for possible answers but couldn’t seem to find it.
Gleb
Hi,
you could easily achieve this using the wayfinder snippet which is a menu builder.
:-)
if you still want to use a chunk instead of wayfinder you could you a snippet called getfield
Well,
Is there a way to do something like this with ModX: [get_page_title_of(45)] ?
Gleb
Thank you for your replies.
I dont mind doing with WayFinder - but i couldn’t seems to figure out how can include in wayfinder only pages that I want and exclude all others.
Gleb
It depends on your website architecture.
You can gather the docs in a folder which will be your StartID param
You can uncheck the show in menu box to prevent document to be listed.
:-)
Like Dimmy said, there is a snippet by the name "GetField" that can retrieve any MODx document object field from specified document.
"He can have a lollipop any time he wants to. That's what it means to be a programmer."
Actually, Wayfinder works incredibly well right out of the box. You can obviously get very complex with it if you want, but so far, for simple CSS styled ul type navigation, horizontal as well as vertical, it hasn’t required anything special, and the "you are here" kind of locator is much easier than in a hard-coded design.
|
Identity Developments delivers SEO focused web design and web presence services
- it's not about websites, it's about your identity. |
I found a few samples from original WayFinder site - are there more samples available around including CSS and chunks samples as well?
Gleb