Problems, need help? Have a tip or advice? Post it here.
4 posts Page 1 of 1
I just installed couch on a website I m doing for photography....Im using a gallery and am lost on how to make my code repeatable to work with this. The gallery has captions and titles to each image as well I need to upload a thumb and full size image...Can you help me to learn how this is done? Thank you.

Code: Select all
 <title>Destined-X Online Creative Services Photo Gallery</title>
    <link rel="stylesheet" href="css/jquery.galereya.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>

<script src="js/jquery.galereya.min.js"></script>
<style>
h1, h2, h3,footer {
    text-align: center;
}
header, footer {
    display: block;
    padding: .2em 0;
    background-image: url('img/bedge_grunge.png');
    box-shadow: 0 0 8px #222;
}

footer {
    margin-top: 80.5em;
}
.footer_logo{}
.footer_logo img{}
</style>
</head>
<body>
<header>
    <a class="navbar-brand" href="index.html"><img src="images/logo1.png" alt=""></a>
<h1><strong>Rebecca Allison</strong></h1>
    <h3>Photographer</h3>

</header>   

<div id="galleryherepls">
        <img src="img/thumbnails/sunsetthumb.jpg"
            alt=""
            title="Lily's Sunset"
            data-desc="ocean at seaside,fl"
            data-category="photograghy"
            data-fullsrc="img/sunset.jpg"
        />       
        ...       
        <img src="img/thumbnails/frogthumb.jpg"
            alt="Bamboo Frog"
            data-desc="Taken by our watergarden"
            data-category="photograghy"
            data-fullsrc="img/frog.jpg"
       />
    <img src="img/thumbnails/frog.png"
            alt=""
            title=""
            data-desc="Logo Creations"
            data-category="Graphics"
            data-fullsrc="img/zero.png"
        />       
        ...       
        <img src="img/thumbnails/frogthumb.jpg"
            alt="Image"
            data-desc="Example"
            data-fullsrc="img/frog.jpg"
       />



</div>
<script>
$(function() {
      $('#galleryherepls').galereya();
});

</script>

</body>
Hi Rebecca :)

I think you can use the standard way of creating a gallery in Couch.
The steps being -
1. define your template as clonable (so each cloned page can represent each main image in the gallery)
2. define the required editable regions - type 'image' for main photo and an associated type 'thumbnail' should suffice. The caption you mentioned can be inputted in the 'Title' field that every cloned page has by default.
3. For each image, create a cloned-page, upload the photo (the thumbnail will get created automatically) and save.
4. Finally, use cms:pages tag on the template to loop through all cloned-pages (i.e. images in the gallery) and display the photos.

For a complete working example that you can use as a reference, please see http://docs.couchcms.com/concepts/photo-gallery.html

The step 3 mentioned above (manually creating a cloned-page for each image) is tedious so the aforementioned tutorial shows you a way to automate the whole process by using a bulk-uploaded.

Hope it helps. Feel free to let is know if you need any help.
The thumbnails uploaded into the gallery are very blurry...Is there anyway to fix this?

Also on the data-category-if I type a word for a category in the regular template it puts that image in a virtual folder automatically under the word I used...Is there a tag I can put in its place to achieve this thru couch?
Hi,

I'll assume you are using the code given at http://docs.couchcms.com/concepts/photo-gallery.html.

The thumbnails uploaded into the gallery are very blurry...
I think you are using the 'gg_thumb' thumbnail on your site's frontend. That thumbnail is used by Couch in the admin-panel and is always 115px x 115px so probably is being scaled on the frontend and hence the blurriness.

The correct way here (and this is mentioned in the docs), is to define a second thumbnail with whatever dimensions you require.

Try the following modification of the code mentioned above -
Code: Select all
<cms:template title='Gallery' clonable='1' dynamic_folders='1' gallery='1'>

    <cms:editable
        name="gg_image"
        label="Image"
        desc="Upload your main image here"
        width="500"
        show_preview='1'
        preview_height='200'
        type="image"
    />

    <cms:editable
        name="gg_thumb"
        assoc_field="gg_image"
        label="Thumbnail of image above"
        desc="shown in the admin-panel"
        width='115'
        height='115'
        enforce_max='1'
        type="thumbnail"
    />
   
    <cms:editable
        name="my_thumb"
        assoc_field="gg_image"
        label="Second Thumbnail"
        desc="shown on the frontend"
        width='300'
        height='300'
        show_preview='1'
        type="thumbnail"
    />
   
    <cms:editable
        name='my_desc'
        label='Image Description'
        type='text'
    />   

</cms:template>

In this code I've added a second thumbnail of 300px X 300px dimensions. You can set it to whatever suits you. I've also defined a type 'text' editable region to hold the image descriptions.

On the frontend, you can now use the following code to loop through the images displaying the second thumbnail we created above -
Code: Select all
<div id="galleryherepls">
    <cms:pages>
        <img src="<cms:show my_thumb />"
            alt="<cms:show k_page_title />"
            title="<cms:show k_page_title />"
            data-desc="<cms:show my_desc />"
            data-category="<cms:show k_page_foldertitle />"
            data-fullsrc="<cms:show gg_image />"
        /> 
    </cms:pages>
</div>

Also on the data-category-if I type a word for a category in the regular template it puts that image in a virtual folder automatically under the word I used...Is there a tag I can put in its place to achieve this thru couch?
Not sure if I understood this correctly. While uploading, you can always choose the right folder and mass upload all images into that folder. The code given above will display the right folder's name.

Hope it helps.
4 posts Page 1 of 1