Page 1 of 1
[Solved] Gallery Module 1.6.1 showing image text.
Posted: Fri Jan 24, 2014 2:40 am
by ventano
HI All
I am using the Gallery Module version 1.6.1 with the prettyphoto template in CMS Made Simple version 1.11.9 and it is giving me exactly what I want to achieve with one exception.
I want the image title and comment to appear on the page under each image before any of them are clicked on, is this possible

I would presume that this might be achieved by editing the template
Here is a link to the page were I am testing things out,
http://dcsireland.com/dcs456/index.php? ... rettyPhoto
Any Help would be gratefully received, thanks,
Ian
Re: Gallery Module 1.6.1 showing image text.
Posted: Fri Jan 24, 2014 10:42 am
by velden
Indeed change the template.
Now it prints the text in the 'title' attribuut of the <a> tag. Create a extra span or div after that link, print the text again (use the same code that prints in the 'title' attribute) and add some styling to make it appear below the image.
Re: Gallery Module 1.6.1 showing image text.
Posted: Fri Jan 24, 2014 7:05 pm
by ventano
Thanks for that Velden.
Unfortunately, I have little knowledge of coding
Maybe you could expand this a bit for me so I can get it
I have posted the part of the code that I think needs changing, maybe you could explain exactly what I needed to put in and where.
With regard to the styling, would this be done via the CSS? Maybe you could give me an example please?
Thank you once again, Regards Ian.
Code: Select all
{foreach from=$images item=image}
<div class="img">
{if $image->isdir}
<a href="{$image->file}" title="{$image->titlename}"><img src="{$image->thumb|escape:'url'|replace:'%2F':'/'}" alt="{$image->titlename}" /></a><br />
{$image->titlename}
{else}
<a class="group" href="{$image->file|escape:'url'|replace:'%2F':'/'}" title="{$image->comment}" rel="prettyPhoto[{$galleryid}]"><img src="{$image->thumb|escape:'url'|replace:'%2F':'/'}" alt="{$image->titlename}" /></a>
{/if}
</div>
{/foreach}
<div class="galleryclear"> </div>
</div>
Re: Gallery Module 1.6.1 showing image text.
Posted: Sat Jan 25, 2014 10:44 am
by velden
try:
Code: Select all
{foreach from=$images item=image}
<div class="img">
{if $image->isdir}
<a href="{$image->file}" title="{$image->titlename}"><img src="{$image->thumb|escape:'url'|replace:'%2F':'/'}" alt="{$image->titlename}" /></a><br />
{$image->titlename}
{else}
<a class="group" href="{$image->file|escape:'url'|replace:'%2F':'/'}" title="{$image->comment}" rel="prettyPhoto[{$galleryid}]"><img src="{$image->thumb|escape:'url'|replace:'%2F':'/'}" alt="{$image->titlename}" /></a>
<span style="display:block;">{$image->comment}</span>
{/if}
</div>
{/foreach}
<div class="galleryclear"> </div>
</div>
This is just an example that might actually work (depending on the other styles applied).
CSS can be set on element (as per this example), in stylesheet of Gallery template you use, general page template stylesheet. It's all up to you.
Note there are other possible properties for your text block. {$image->titlename} might be a good one and there is another one if iirc: {$image->title} maybe. One takes only the custom typed title of an image, and the other takes the custom title if set else the filename.
Re: Gallery Module 1.6.1 showing image text.
Posted: Sun Jan 26, 2014 10:45 pm
by ventano
TOTALLY AWESOME!!!
I am now ready to get the website all sorted as you have now completed the final missing part for me!! I just needed that bit of help from you to get there, so thank you very much Velden, your a star.
There is one small thing I would like to change but if I cannot its not a big thing, as it can be changed later after website is complete. The code
calls up X images on the page. Can I change this to be X items and if so where would I change it?
Re: Gallery Module 1.6.1 showing image text.
Posted: Mon Jan 27, 2014 12:37 pm
by velden
Without looking for other options that might be available in the module/template:
{$imagecount|replace:'images':'items'}
Re: Gallery Module 1.6.1 showing image text. SOLVED
Posted: Mon Jan 27, 2014 2:03 pm
by ventano
Solved.
Well that just works perfectly.
I really appreciate the help you have given to me over this, you have solved all my queries, perfectly, which means I have no more excuses but to now get on with the work!!!
Thanks again,
Ian.
Re: Gallery Module 1.6.1 showing image text.
Posted: Mon Jan 27, 2014 5:48 pm
by Dr.CSS