[Solved] Gallery Module 1.6.1 showing image text.

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
ventano
New Member
New Member
Posts: 6
Joined: Sat Sep 08, 2012 11:46 pm

[Solved] Gallery Module 1.6.1 showing image text.

Post 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
Last edited by ventano on Mon Jan 27, 2014 9:24 pm, edited 1 time in total.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Gallery Module 1.6.1 showing image text.

Post 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.
ventano
New Member
New Member
Posts: 6
Joined: Sat Sep 08, 2012 11:46 pm

Re: Gallery Module 1.6.1 showing image text.

Post 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">&nbsp;</div>
</div>
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Gallery Module 1.6.1 showing image text.

Post 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">&nbsp;</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.
ventano
New Member
New Member
Posts: 6
Joined: Sat Sep 08, 2012 11:46 pm

Re: Gallery Module 1.6.1 showing image text.

Post by ventano »

TOTALLY AWESOME!!! ;D ;D ;D
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

Code: Select all

{$imagecount}
calls up X images on the page. Can I change this to be X items and if so where would I change it?
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Gallery Module 1.6.1 showing image text.

Post by velden »

Without looking for other options that might be available in the module/template:

{$imagecount|replace:'images':'items'}
ventano
New Member
New Member
Posts: 6
Joined: Sat Sep 08, 2012 11:46 pm

Re: Gallery Module 1.6.1 showing image text. SOLVED

Post 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.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Gallery Module 1.6.1 showing image text.

Post by Dr.CSS »

Post Reply

Return to “Modules/Add-Ons”