Re: A new gallery manager : Album
Posted: Sat Feb 14, 2009 8:42 pm
I believe if you look in Album Help it tell you how to limit # of albums in tag...
Content management as it is meant to be
https://forum.cmsmadesimple.org/
Sorry, but its doesnt work..mark wrote: If you look most of the templates have an {if} for pagination at the top you may move this to the bottom then when calling the album tag limit the number of albums with number="5" or however many you want...
The number= is in the help...
Code: Select all
{* Include JS files. You can move this to the head of your page template if you want *}
<!--Greybox-->
<__script__ type="text/javascript">
var GB_ROOT_DIR = "modules/Album/templates/db/greybox/";
</__script>
<__script__ type="text/javascript" src="modules/Album/templates/db/greybox/AJS.js"></__script>
<__script__ type="text/javascript" src="modules/Album/templates/db/greybox/AJS_fx.js"></__script>
<__script__ type="text/javascript" src="modules/Album/templates/db/greybox/gb_scripts.js"></__script>
{if $pictureid !=0}
{* Big Picture *}
<div style="text-align:center">
<p class="bigpicturecaption"><strong>{$picture->name}</strong><br />
{$picture->comment}<br />
<span class="bigpicturenav">
{if $link.picture.previous}<a href="{$link.picture.previous}" title="następne zdjęcie">< poprzednie</a>{/if}
<span class= "albumpicturecount">( Picture {$picturenumber}/{$picturecount} )</span>
{if $link.picture.next}<a href="{$link.picture.next}" title="poprzednie zdjęcie">następne ></a></span>{/if}
</p>
<img src="{$picture->picture}" alt="{$picture->name|escape:'html'} - {$picture->comment|escape:'html'}" title="{$picture->name|escape:'html'} - {$picture->comment|escape:'html'}" />
</div>
{/if}
{* Album List *}
{if !$album}
{foreach from=$albums item=album}
<div class="oferta_box" id="album{$album->id|escape:'html'}"><div class="oferta_title_box">
<a href="{$album->link}">{$album->name} ({$album->picturecount} foto)</a>
</div><div class="oferta_info_box">
<span>{$album->comment}</span><br />
<a href="{$album->link}">
<img src="{$album->thumbnail}" alt="{$album->name|escape:'html'}" title="{$album->name|escape:'html'} - {$album->comment|escape:'html'}"{$album->autothumbnailsize} /></a>
</div><div class="oferta_end_box"></div></div>
{/foreach}
{else}
{* Photo List *}
<p><span class="noprint">{if $returnlink}<a href="{$returnlink}#album{$album->id|escape:'html'}">«««</a>{/if}</span></p>
{if $pagecount>1}
<p class="albumnav">
<a href="{$link.page.first}" title="pierwsza strona"><< </a>
{if $link.page.previous}<a href="{$link.page.previous}" title="poprzednia strona">< </a>{/if}
page {$pagenumber}/{$pagecount}
{if $link.page.next}<a href="{$link.page.next}" title="następna strona"> ></a>{/if}
<a href="{$link.page.last}" title="ostatnia strona"> >></a>
</p>
{/if}
{foreach from=$pictures item=picturesrow}
{foreach from=$picturesrow item=onepicture}
<div class="oferta_box"><div class="oferta_title_box">
<span class="opis_a">{$onepicture->name}</span>
</div><div class="oferta_info_box"><span>
{$onepicture->comment}<br/><br/></span>
<a href="{$onepicture->picture}" rel="gb_imageset[{$album->name|escape:'html'}]" title="{$onepicture->name|escape:'html'} {if ($onepicture->comment != "")}- {$onepicture->comment|escape:'html'}{/if}"> <img src="{$onepicture->thumbnail}" alt="{$onepicture->name|escape:'html'} {if ($onepicture->comment != "")}- {$onepicture->comment|escape:'html'}{/if}" title="{$onepicture->name|escape:'html'} {if ($onepicture->comment != "")}- {$onepicture->comment|escape:'html'}{/if}"{$onepicture->autothumbnailsize} /></a>
</div><div class="oferta_end_box"></div></div>
{if ($onepicture->number==$picturenumber and !$picture)}{assign var=picture value=$onepicture}{/if}
{/foreach}
{/foreach}
<div style="clear:both"></div>
<p><span class="noprint">{if $returnlink}<a href="{$returnlink}#album{$album->id|escape:'html'}">«««</a>{/if}</span></p>
{if $pagecount>1}
<p class="albumnav">
<a href="{$link.page.first}" title="pierwsza strona"><< </a>
{if $link.page.previous}<a href="{$link.page.previous}" title="poprzednia strona">< </a>{/if}
page {$pagenumber}/{$pagecount}
{if $link.page.next}<a href="{$link.page.next}" title="następna strona"> ></a>{/if}
<a href="{$link.page.last}" title="ostatnia strona"> >></a>
</p>
{/if}
{if $picturecount==0}No image{/if}
{/if}
{if $picture->id>0}
{/if}
<div style="clear:both"></div>
Sorry, just saw the backend bit... do you mean sort the Album listing (in Admin) so the latest Album is at the top of the list, or do you mean individual pictures in an admin albumview , so the newest pictures are at the top? Either way it is going to mean changing code in the classes for the Album module I think. Let me know, I may have need for this myself and if I get time will have a look.Parameters
......
* (optional) sortdesc="true" - Sort albums in descending order rather than ascending.
* (optional) sortpicturesdesc="false" - Sort pictures in descending order rather than ascending. This will make new pictures that are added to an album to be listed first.
Example to show pictures in reverse order:
{cms_module module='album' sortpicturesdesc='true'}
......
Hi Russ, thanks for the reply,Russ wrote: sam_m, in the help for the Album module, did you see?
Sorry, just saw the backend bit... do you mean sort the Album listing (in Admin) so the latest Album is at the top of the list, or do you mean individual pictures in an admin albumview , so the newest pictures are at the top? Either way it is going to mean changing code in the classes for the Album module I think. Let me know, I may have need for this myself and if I get time will have a look.Parameters
......
* (optional) sortdesc="true" - Sort albums in descending order rather than ascending.
* (optional) sortpicturesdesc="false" - Sort pictures in descending order rather than ascending. This will make new pictures that are added to an album to be listed first.
Example to show pictures in reverse order:
{cms_module module='album' sortpicturesdesc='true'}
......
You may want to check the new Gallery module for thissam_m wrote: I guess the only real improvement would be on the sorting pictures order, drag and place would be nice like Zen Photo, but cmsms is constantly growing and improving so who knows whats around the corner in terms of new modules
Jos, How that slipped past me I have no idea, looks... perfect!!!Jos wrote:You may want to check the new Gallery module for thissam_m wrote: I guess the only real improvement would be on the sorting pictures order, drag and place would be nice like Zen Photo, but cmsms is constantly growing and improving so who knows whats around the corner in terms of new modules
http://dev.cmsmadesimple.org/projects/gallery