The footer links where I want to call this fancy box are done with this code
footer_nav_column_last_tpl
<span class="nav-group">
<ul>
<li><a href="[[~[[+id]]]]">[[+pagetitle]]</a>
[[Wayfinder? &startId=`[[+id]]` &level=`1` &sortBy=`menuindex` &sortOrder=`DESC`]]
</li>
</ul>
</span>
$tpl = 'footer_nav_column_tpl';
$tplLast = 'footer_nav_column_last_tpl';
$params = array(
'tpl' => $tpl,
'resources' => $documents,
'sortDir' => 'ASC',
'tplLast' => $tplLast,
'level' => 2,
'parents' => -1,
);
return $modx->runSnippet('getResources', $params);
Can I modify this to add that fancy box trigger.
Quote from: pronab.saha at May 02, 2013, 03:37 AMIf I can trigger any javascript from resource.Quote from: pronab.saha at May 02, 2013, 01:57 AMThanks for your reply.
Basically my main menu is also done by wayfinder and that is working fine and I donot want that menu to get effected.
But my other menu which will call the jQuery. So if there is any way out for that.
Thank you
Quote from: donshakespeare at May 01, 2013, 02:10 PMTo reproduce
<a id="fancybox-manual-234" href="javascript:;">Open single item, custom options</a>
Where 234 is the id of the weblink resource
For the weblink url, just type in this: javascript:;
In your Wayfinder rowTpl throw this in<li class="[[+wf.classnames]]">
<a id="fancybox-manual[[+wf.docid]]" href="[[+wf.link]]"> [[+wf.linktext]]</a>
[[+wf.wrapper]]</li>
Note! all the links in your menu will then have an id="fancybox-manual-[[their-id]]" set.
So you can use jQuery to do what you want. Affect multiple or all the links.
$("#fancybox-manual-234").click(function() {
$.fancybox.open({
href : '#data',
padding : 5
});
});