Forum for discussing general topics related to Couch.
7 posts Page 1 of 1
Hi, i was wondering if cms:editable tag can be used on script tags.
I have one project where different portfolio pages are presented using supersized jQuery plugin.
To put images, you just have to put them in the script tag as one of the parameters.

Basically all project pages are the same, and all i need is a way to provide the client with a way to edit those image paths.
I was thinking declaring the template as clonable, and let the client change the image paths with cms:editable, but i haven't managed to get it working.

Any ideas?
Please note I have never actually used this jQuery script. I am going off of what the website documentation states. The easiest way of doing this would be to make the template clonable. I took this basic code from the supersized demo and replaced the values with couch tags.

Code: Select all
<script type="text/javascript">jQuery(function($){$.supersized({
slides : [

<cms:pages>{image : '<cms:show image />', title : '<cms:show k_page_title />', thumb : '<cms:show image_thumb />', url : '<cms:show k_page_link />'}<cms:if k_current_record = k_total_records ><cms:else/>,</cms:if>
</cms:pages> ]


You would be able to use the default title field for the image title. The image and image_thumb variables would point to your editable regions. Do note that the last slide should not have the trailing comma after it, that is the reason for the "if" tag. It simply tests whether or not it is the last.
I absolutely second the method detailed by cheesypoof.
Simply use two editable regions - one of type 'image' and another of type 'thumbnail' - with the cloned template and then use the cms:pages tag to populate the script tag entries.
Thanks guys, i will try the provided solution and report back if it worked.
Ok i managed to do it, but i still have one problem.
Since the user doesn't know how many images will be in each portfolio section, is there a way for me to create something like repeatable image editable tag? So he can add a new image if he wants to?
Or i should make let's say 10 editable regions, considering that there wil never be more than 10 images?

Many thanks
Repeatable editable region feature, though very useful, is not yet available.

So for now, the only way is to create the (reasonable) maximum number of regions that can be used and the client can then use as many as he wishes.
Thanks KK, you are very helpful, as always!
7 posts Page 1 of 1

Who is online

In total there are 4 users online :: 0 registered, 0 hidden and 4 guests
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 4 guests