[solved] How to use contents of a Content Block twice in the one template?
Posted: Fri Sep 24, 2010 6:30 pm
I can't work out how to use the contents of a Content Block twice in the one template. I could do with pointing in the right direction. I'm not sure if it is something really obvious or if I need to work out how to use User Defined Tags...
In the Head of the template I have the following editor entered fields to give the name of the folder for the images to be used and then an list of the images to accessed in a specific order. These are declared as javascript global variables.
I would also like to use gallery_images[0] in the same template in the HTML body as a non-javascript default for the page. The best I have managed so far is to use a another Content Block and get the editor to enter the filename in both the list and again in the Image_0 field.
Any suggestions for a smarter (only small pun intended) solution greatly appreciated.
...also ... is there a neater solution for passing 'Content Block' data to javascript.
Many thanks.
Chris
PS: Forgive the crudity of beginners solutions above, just trying to get a solution anyway I can and learn on the way.
PPS: Using version 1.8.2 and love it.
In the Head of the template I have the following editor entered fields to give the name of the folder for the images to be used and then an list of the images to accessed in a specific order. These are declared as javascript global variables.
Code: Select all
<__script__ type="text/javascript">
var gallery_images_folder = '{content block="gallery_folder" label="Gallery Folder (no quotes)" oneline="true" }';
var gallery_images = [{content label="Gallery Photos - file list (quotes and comma separated)"}];
</__script>
<__script__ type="text/javascript" src="scripts/kb-slideshow-controls.js"></__script>
Any suggestions for a smarter (only small pun intended) solution greatly appreciated.
...also ... is there a neater solution for passing 'Content Block' data to javascript.
Many thanks.
Chris
PS: Forgive the crudity of beginners solutions above, just trying to get a solution anyway I can and learn on the way.

PPS: Using version 1.8.2 and love it.