Hello
Is it possible to add an editable text area to this page, and to only display the gallery if it has images?
Kind Regards
Nick
Is it possible to add an editable text area to this page, and to only display the gallery if it has images?
- Code: Select all
<?php require_once( 'admin/cms.php' ); ?>
<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='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">
<div id="breadcrumbs">
<h1><cms:breadcrumbs separator='' include_template='1'/></h1>
<cms:if k_is_page>
<h3><cms:show k_page_title /></h3>
</cms:if>
</div>
<cms:if k_is_list >
<cms:ignore> NOTE: A few points to note about the way folders are displayed -
1. We display only the immediate child folders of the current folder (root is also considered a folder). If the images in the current folder are numerous enough to need pagination, we take care to display the folders only on the first page.
2. If the folder has an image associated with it (via the 'Manage folders' admin section), that image is used. If no image is associated, we pick up the first page contained within this folder and use its thumbnail. Finally if there are no child pages within, we use a default folder icon. </cms:ignore>
<cms:set my_page="<cms:gpc 'pg' method='get' />" />
<cms:if my_page lt '2' >
<div class="gallery">
<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>
</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>
<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(); ?>
Kind Regards
Nick