[getResources? &parents=`[[*id]]` &tpl=`Practice_Areas_tpl` &includeContent=`1` &limit=`100` &showHidden=`1`]]
<script type="text/javascript">
$(document).ready(function() {
/*
* Open manually
*/
$("a#fancybox-manual-d").click(function() {
$.fancybox.open({
href : '#data',
padding : 5
});
});
});
</script><a id="fancybox-manual-d" href="javascript:;">[[+pagetitle]]</a>
<div style="display:none">
<div id="data">
[[getResourceField:ifempty=`[[+introtext]]` ? &id=`[[*parent]]` &field=`introtext`]]
</div>
</div>[[+introtext:isempty=`[[getResourceField? &id=`[[*parent]]` &field=`introtext`]]`]]
<div style="display:none">
<div id="data">
[[+introtext:isempty=`[[getResourceField? &id=`[[*parent]]` &field=`introtext`]]`]]
</div>
</div>You should change a thing in your chunk. You're now loading the parents introtext, which probably is the reason you see the same content over and over again.
Try this;
[[+introtext:isempty=`[[getResourceField? &id=`[[*parent]]` &field=`introtext`]]`]]
That should work.
<a href="#some-id-for-your-content">Your title</a> <div id="some-id-for-your-content">The content here</div>
<a href="#[[+alias]]-[[+id]]">[[+pagetitle]]</a>
<div id="[[+alias]]-[[+id]]">
[[+introtext:isempty=`[[getResourceField? &id=`[[*parent]]` &field=`introtext`]]`]]
</div>[getResources? &parents=`[[*id]]` &tpl=`Practice_Areas_tpl` &includeContent=`1` &limit=`100` &showHidden=`1`]]
<script type="text/javascript">
$(document).ready(function() {
/*
* Open manually
*/
$("a#[[+alias]]-[[+id]]").click(function() {
$.fancybox.open({
href : '#data',
padding : 5
});
});
});
</script>
<div style="display:none">
<div id="[[+alias]]-[[+id]]">
[[+introtext:isempty=`[[getResourceField? &id=`[[*parent]]` &field=`introtext`]]`]]
</div>
</div>
I have searched a bit and discovered you should create HTML like;
<a href="#some-id-for-your-content">Your title</a> <div id="some-id-for-your-content">The content here</div>
As you can see the href should link to the content ID. You can make this dynamic like:
<a href="#[[+alias]]-[[+id]]">[[+pagetitle]]</a> <div id="[[+alias]]-[[+id]]"> [[+introtext:isempty=`[[getResourceField? &id=`[[*parent]]` &field=`introtext`]]`]] </div>
Like to hear if it works (or not)
$("a.grouped_elements").fancybox({ options here });Your fancybox call is not right. You should not use [[+alias]] etc. in your javascript call. Just assign fancybox to all links, and fancybox will do the rest. Please read the Fancybox docs. Give all your <a> tags a class like "grouped_elements" and apply fancybox like;
</a>$("a.grouped_elements").fancybox({ options here });