Forum for discussing general topics related to Couch.
4 posts Page 1 of 1
Hi, im creating a portfolio for my client @ http://industrukt.pl/dev/ap/ .

I need to create in admin section trick to add photo to http://industrukt.pl/dev/ap/barbara.html not by wysiwyg editor but by couch snippet "browse server". When photos will be added I need to have ability to delate pics and add new. So I think I need a list of photos with simple edit options like above.

How I can do that?

KK, please help me with that :)
Hi Adrian and welcome :)

I am not sure how you have structured the site but the most straightforward way seems to use a single template and then create cloned pages of it for each user e.g. barbara.html, rosa.html etc.

If we take the above mentioned route, then the best way to have a photo gallery for each user (i.e. for each cloned page) would be an image editable region wrapped within a repeatable region (http://www.couchcms.com/docs/concepts/r ... gions.html).
This way the editor can upload/remove/reorder photos for each user, just as you wished.
@KK, I think this is it what I want, but I don't get how to add one photo by uploading it to this code. Take a look:
Code: Select all
<a href="img/gallery/1.jpg"><img class="thumbnail"  src="img/gallery/1.jpg"/></a>

in href attribute and src should be the same image.

How to do this?
Suppose following is your definition of a repeatable region (named 'my_multiple_images') containing only one image field (named 'my_image' )
Code: Select all
<cms:template clonable='1'>

    <cms:repeatable name='my_multiple_images' >
       <cms:editable type='image' name='my_image' label='Photo' />
    </cms:repeatable>
   
</cms:template>

This is how you can use the values inputted -
Code: Select all
<cms:show_repeatable 'my_multiple_images' >
    <a href="<cms:show my_image />"><img class="thumbnail"  src="<cms:show my_image />"/></a>
</cms:show_repeatable>

Please note how the <cms:show my_image /> is used twice - both for the href as well as the src attribute. This should answer your query.

As an aside, instead of using the main photo as also its thumbnail you could use the following where we use the 'thumbnail' tag (http://www.couchcms.com/docs/tags-refer ... ail-1.html) to dynamically create the thumbnails -
Code: Select all
<cms:show_repeatable 'my_multiple_images' >
    <a href="<cms:show my_image />"><img class="thumbnail"  src="<cms:thumbnail my_image width='267' height='400' />"/></a>
</cms:show_repeatable>

Hope this helps.
4 posts Page 1 of 1
cron