Hello,
With the Gallery module it is possible to show the number of items (images, folders) in the current folder.
Does anybody know if it is possible to show the number of items in the subfolder?
There is no variable such like $image->itemcount or something.
The variable only exists for the current directory.
I'd like to display in my gallery overview how many images each subfolder contains.
Gallery: Number of items (images/folders) in subfolder
Re: Gallery: Number of items (images/folders) in subfolder
It is possible to call {Gallery} from within a gallery template so that could be a (maybe inefficient) way to call Gallery for the subfolder and only display/assign the image count.
I have a short, incomplete example on how to do that (other use). I couldn't get it to work when using a template parameter so I made the template default TO BE CALLED FOR COUNT the default template.
Save this template (e.g. 'foo') and DO NOT make it default.
Then create a gallery template that only outputs the the html you want to display for a subfolder item and make that the DEFAULT template.
From within your page (template) you call {Gallery template="foo"}
<offtopic>
I use a similar approach when I have a Gallery that only has subgalleries. From each subgallery I only display the first thumb and all subsequent image-LINKS are hidden, though available.
Like a portfolio for different projects that are available on one page.
Example: http://tinyurl.com/pjo77cq#projecten (go to projecten).
Every project is a subgallery. Only the first thumb of every subgallery is displayed, together with gallery title/comment. 'Behind' each thumb are the links to the other subgallery-images so the fancybox thing can do its job.
It has an extra feature to go to next/previous project from within fancybox popup. That, combined with the filter and shuffle feature, was a nice puzzle to create.
I have a short, incomplete example on how to do that (other use). I couldn't get it to work when using a template parameter so I made the template default TO BE CALLED FOR COUNT the default template.
Save this template (e.g. 'foo') and DO NOT make it default.
Code: Select all
{assign var="org_gallerydir" value=$gallerydir}
{foreach from=$images item=image name=img}
{if $image->isdir} or something like that
{Gallery dir="$org_gallerydir/`$image->filename`"}
{else}
... do your normal layout for images...
{/if}
{/foreach}From within your page (template) you call {Gallery template="foo"}
<offtopic>
I use a similar approach when I have a Gallery that only has subgalleries. From each subgallery I only display the first thumb and all subsequent image-LINKS are hidden, though available.
Like a portfolio for different projects that are available on one page.
Example: http://tinyurl.com/pjo77cq#projecten (go to projecten).
Every project is a subgallery. Only the first thumb of every subgallery is displayed, together with gallery title/comment. 'Behind' each thumb are the links to the other subgallery-images so the fancybox thing can do its job.
It has an extra feature to go to next/previous project from within fancybox popup. That, combined with the filter and shuffle feature, was a nice puzzle to create.
Re: Gallery: Number of items (images/folders) in subfolder
Thank you very much for this workaround.
It was quite easy to do it this way.
In my default template I inserted this two lines
The template code of the template named 'aantalfotos' is
The idea you told me you used on your own website, is very nice!
I am working on an other website, where I will try to do the same trick.
It was quite easy to do it this way.
In my default template I inserted this two lines
Code: Select all
{assign var="org_gallerydir" value=$gallerydir}
...
{foreach from=$images item=image}
{if $image->isdir}
...
{Gallery dir="$org_gallerydir/`$image->filename`" template="aantalfotos"} foto's
{else}
...
{/foreach}
...
Code: Select all
{$numimages}I am working on an other website, where I will try to do the same trick.
Re: Gallery: Number of items (images/folders) in subfolder
Good it works!
It is not my own website. However I implemented cmsms and did some customization so the fancybox things works like it does now.walter81 wrote: The idea you told me you used on your own website, is very nice!
I am working on an other website, where I will try to do the same trick.
Re: Gallery: Number of items (images/folders) in subfolder
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
Migrating Company Directory module to LISE
- + - + - + - + - + - + -



