Forum for discussing general topics related to Couch.
19 posts Page 2 of 2
I thought the original question was -
I've added a content area, but it's not showing up in admin?

Anyways, that is because you are using the <cms:show main_content /> in the list-view.
Regions are associated with individual pages and become available either is page-view or within the cms:pages loop.

Please try using it from within the cms:pages block as follows -
Code: Select all
<cms:pages folder=k_folder_name include_subfolders='0' limit='18' paginate='1'>
    <a class="fancybox" href="<cms:show gg_image />" data-fancybox-group="gallery"><img alt="<cms:show k_page_title />" src="<cms:show my_thumb_2 />"/></a>

    <cms:show main_content />

    <cms:if k_paginated_bottom >
       <div style="clear:both">
          <cms:paginator />
       </div>
    </cms:if>
</cms:pages>

Hope it helps :)
No, that didn't work either:

Code: Select all

<?php require_once( 'admin/cms.php' ); ?>

<cms:template title='Gallery' clonable='1' dynamic_folders='1' gallery='1'>
   <cms:editable name='main_content' label='Main Content' type='textarea' />
   <cms:editable name='gg_image' label='Image' desc='Upload your main image here' width='640' height='640' show_preview='1' preview_height='200' type='image' />
   <cms:editable name='gg_thumb' label='Image Thumbnail' desc='Thumbnail of the main image above' width='300' height='300' enforce_max='1' assoc_field='gg_image' show_preview='1' type='thumbnail' />
   <cms:editable name='my_thumb_2' label='Image Thumbnail 2' desc='Second thumbnail of the main image above' width='300' height='300' assoc_field='gg_image' show_preview='1' type='thumbnail' />
</cms:template>

<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Photo Gallery | <cms:get_custom_field 'site_name' masterpage='globals.php' /></title>
<meta name="description" content="<cms:get_custom_field 'site_desc' masterpage='globals.php' />">

<!-- header HTML -->
<cms:get_custom_field 'head_html' masterpage='globals.php' />
<!-- -->

<style type="text/css">
/*
Paginator -
Source: http://www.strangerstudios.com/sandbox/pagination/diggstyle.php (strangerstudios.com)
*/
div.pagination {
   padding: 3px;
   margin: 3px;
}
div.pagination a {
   padding: 2px 5px 2px 5px;
   margin: 2px;
   border: 1px solid #666;
   zoom: 100%;
   text-decoration: none; /* no underline */
   color: #666;
}
div.pagination a:hover, div.pagination a:active {
   border: 1px solid #000;
   color: #000;
}
div.pagination span.page_current {
   padding: 2px 5px 2px 5px;
   margin: 2px;
   border: 1px solid #666;
* zoom: 100%;
   font-weight: bold;
   background-color: #666;
   color: #FFF;
}
div.pagination span.page_disabled {
   display: none;
}
* span.elipsis {
   zoom: 100%
}
</style>

</head>
<body>

<!-- body html 1 -->
<cms:get_custom_field 'body_html1' masterpage='globals.php' />
<!-- -->

<!-- menu code -->
<cms:nested_pages masterpage='index.php' extended_info='1' ><cms:if k_level_start ><cms:if k_level='0'><ul><cms:else /><ul class="dropdown-menu" role="menu"></cms:if></cms:if><cms:if k_element_start ><cms:if k_level='0'><li class="dropdown"><cms:else /><li class="sm"></cms:if><a href="<cms:show k_menu_link />" title="<cms:show k_menu_title />"><cms:show k_menu_title /></a></cms:if><cms:if k_element_end ></li></cms:if><cms:if k_level_end ></ul></cms:if></cms:nested_pages>
<!-- -->

<!-- body html 2-->
<cms:get_custom_field 'body_html2' masterpage='globals.php' />
<!-- -->

<!-- gallery code -->
<div id="gallery-wrapper">
      <cms:if k_is_page>
         <h3><cms:show k_page_title /></h3>
      </cms:if>
      <cms:if k_is_list >   
      <cms:set my_page="<cms:gpc 'pg' method='get' />" />
      <cms:if my_page lt '2' >

      <!-- debugging -->
      <cms:if k_user_access_level ge '10' >
        <p><a target="_blank" href="<cms:admin_link />">EDIT</a></p>
      <cms:else /> 
        <h3>You cannot edit!</h3>
      </cms:if>
      <!-- -->

         <div class="gallery">
            <cms:folders childof=k_folder_name hierarchical='1' depth='1'>
             <cms:if k_folder_totalpagecount >
               <cms:folders childof=k_folder_name hierarchical='1' depth='1'>
                  <cms:set my_folder_image="" />
                  <cms:if k_folder_image>
                     <cms:set my_folder_image=k_folder_image />
                     <cms:else />
                     <cms:pages folder=k_folder_name include_subfolders='0' limit='1'>
                        <cms:set my_folder_image=my_thumb_2 scope='parent' />
                     </cms:pages>
                  </cms:if>
                  <cms:if my_folder_image=''>
                     <cms:set my_folder_image="<cms:show k_admin_link />theme/images/empty-folder.gif" />
                  </cms:if>
                  <a class="fancybox" href="<cms:show k_folder_link />" data-fancybox-group="gallery"><img alt="<cms:show k_folder_title />" src="<cms:show my_folder_image />"/> <span class="title">
                     <cms:show k_folder_title />
                     </span> <span class="count_images">
                     <cms:show k_folder_totalpagecount />
                     images</span> <span class="count_folders">
                     <cms:show k_folder_totalchildren />
                     folders</span></a>
               </cms:folders>
                </cms:if>
            </cms:folders>
         </div>
      </cms:if>
      <div class="gallery">
         <cms:pages folder=k_folder_name include_subfolders='0' limit='18' paginate='1'>         
            <a class="fancybox" href="<cms:show gg_image />" data-fancybox-group="gallery"><img alt="<cms:show k_page_title />" src="<cms:show my_thumb_2 />"/></a>

            <!-- main content -->
            <cms:show main_content />
            <!-- -->

            <cms:if k_paginated_bottom >
               <div style="clear:both">
                  <cms:paginator />
               </div>
            </cms:if>
         </cms:pages>
      </div>
      <cms:else />
      <div id="image_container"><img alt="<cms:show k_page_title />" src="<cms:show gg_image />"/></div>
   </cms:if>
</div>
<!-- -->

<!-- footer content -->
<cms:get_custom_field 'footer_html' masterpage='globals.php' />
<!-- -->

</body>
</html>

<?php COUCH::invoke(); ?>

My friend, I am beginning to suspect you are pulling my leg :)
You need to *input* something in the editable region to have it show on the frontend!

I added some dummy text from the admin-panel and it is appearing on the frontend just fine.
Right, I obviously have not explained myself correctly.

What I would like is a few paragraphs of text, like an introduction, followed by the gallery.

See the screenshot ;-)

Attachments

That text would go with the folder the set of images belong to.
Edit folder and there is already a richtext region you can put the text into.

You might also want to have some text on the gallery homepage - for that use the global regions.

I've made all the necessary changes to your templates. Take a look at your site to see how it works.

Following are the relevant changes (the cms:if k_is_folder block)-
Code: Select all
<div class="gallery">

    <cms:if k_is_folder >
        <h3>Folder description:</h3>
        <cms:show k_folder_desc />
    <cms:else />
        <h3>HomePage description:</h3>
        <cms:get_custom_field 'gallery_desc' masterpage='globals.php' />
    </cms:if>   
   
    <cms:pages folder=k_folder_name include_subfolders='0' limit='18' paginate='1'>         
        <a class="fancybox" href="<cms:show gg_image />" data-fancybox-group="gallery"><img alt="<cms:show k_page_title />" src="<cms:show my_thumb_2 />"/></a>

        <cms:if k_paginated_bottom >
            <div style="clear:both">
                <cms:paginator />
            </div>
        </cms:if>
    </cms:pages>
</div>
So I can't have text on the gallery homepage without using the global regions?

I was hoping that it would be possible to use the nested pages feature to have a gallery on each page with some introduction text.

I'm guessing that's not possible?
I was hoping that it would be possible to use the nested pages feature to have a gallery on each page with some introduction text.

I'm guessing that's not possible?
Actually, it is.
Please use the method described in the following thread -
viewtopic.php?f=8&t=8559

Hope it helps.
That is absolutely amazing, thank you!

One more question if I may...

Is it possible to crop the images so they display as they would in the gallery?

Gallery: http://www.djnickburrett.com/gallery/
Non Gallery: http://www.djnickburrett.com/home/
Ignore that last question - I was having a senior moment ;-)
19 posts Page 2 of 2
cron