I am new to MODx so I am trying to figure out how to convert my static HTML so it is generated dynamically by the Wayfinder.
This is the static code:
<ul class="Menu">
<li><a href="link1.html"><img src="assets/images/thumbnail1.jpg" class="thumbnail" />Link 1</a></li>
<li><a href="link2.html"><img src="assets/images/thumbnail2.jpg" class="thumbnail" />Link 2</a></li></ul>
etc. etc.
</ul>
I am able to generate a menu with the list of the pages without thumbnails. This is the Wayfinder call I am using:
[[!Wayfinder?startId=`17` &level=`0` &firstClass=`` &lastClass =`` &outerClass=`Menu`]]
The only thing missing is the thumbnail. I created a TV called ’thumbnail’, which is part of all the documents that appear on the list. What I would like to do is to insert this thumbnail (’thumbnail’ TV) in front of the link.
Any idea how to do this? I would really appreciate your help!
-
☆ A M B ☆
- 3,141 Posts
Wayfinder doesn’t support TVs as far as I know.
If you’re using a one level deep menu only you can easily use getResources which, when passed the &includeTVs property, does support TVs in the output.
(Also, please make sure to mention what MODX you are running - evo or revo and when it could be version specific also the version)
Thanks Mark!
With a little help from my friend we got it to work like this-
<li><a href="[[+wf.link]]" title="[[+wf.title]]" [[+wf.attributes]]><img class="thumbnail" src="assets/[[+thumbnail]]"><span>[[+wf.linktext]]</span></a>[[+wf.wrapper]]</li>
this chunk was used as rowTpl.
-
☆ A M B ☆
- 3,141 Posts
Oh so it does support TVs now? Fancy, will need to check that.
Yes. And for the record this was MODX Revolution 2.1.1-pl (traditional).
Hi Izzy;
just took a quick look at the docs:
Template Variables
With the current version of WayFinder in Revolution, you can access your own custom TVs by using a placeholder without the 'wf.' prefix, e.g.
[[+my_TV]]
As of this writing, only the raw TV value will be returned: it will not be formatted. E.g. if your TV is an image, normal use of the TV inside your template would return the full image tag, but inside of a WayFinder tpl, only the path to the image will be returned.
what I would do is setup your TV as a css rule and define your images in your stylesheet.... so it looks like what you are trying to do will work. just hit the docs a little harder.
-sean
*** Not just websites, we also create signage, banners, print, trade show displays and more! ***
Sean Kimball CLP, CLS.
Technical Director / Sr. Developer | BigBlock Studios
._______________________________________________.
Bigblock Studios
http://www.bigblockstudios.ca Web site design & development.
27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
phone/fax: 905-426-5525
-
☆ A M B ☆
- 894 Posts
I did something similar but I used css and the name of the wayfinder item, that was before I knew how to use TV, but it did work I managed to do
this with it.