I have an EE site that has a flickrshow gallery on it. I would like to create a channel field to edit the flickr set id. The problem is that ee tags are opened and closed with curly brackets {ee_tag} so the js gets broken.
is there a way to EITHER use a different ee tag OR to have the js fetch the set id from a hidden (display none) div element. I could then put the ee tag in the hidden element allowing the cms to manage the id. Code:
<!-- flickrshow -->
<div class="example" id="cesc">
<p>Please enable Javascript to view this slideshow</p>
</div>
{exp:channel:entries channel='flickr'}
<script src="/js/flickrshow-7.2.min.js"></script>
<script>
var cesc = new flickrshow('cesc', {
autoplay:true,
'set':'{flickr_set}'
});
</script>
{/exp:channel:entries}
<!-- end flickrshow -->
above with ee tags in js code. Bellow with js referencing hidden div:
<!-- flickrshow -->
<div class="example" id="cesc">
<p>Please enable Javascript to view this slideshow</p>
</div>
<script src="/js/flickrshow-7.2.min.js"></script>
<script>
var cesc = new flickrshow('cesc', {
autoplay:true,
'set':'=(#hidden_div value)'
});
</script>
<!-- end flickrshow -->
<div id="#hidden_div">
{exp:channel:entries channel='flickr'}
{flickr_set}
{/exp:channel:entries}
</div>
I dont know enough js to further complete the second example.
Thanks for any suggestions
Your Flickr set ID is outputting properly in the template, but you have your
flickr_setfield set to XHTML formatting in ExpressionEngine, so it’s being wrapped in paragraph tags. Change the field formatting to “none”, be sure to tick the box that says “update all existing entries with this formatting”, then save your field.Always view source on your page to find out what’s going wrong!