Displaying text below the icons.

Display several small images against a main product. Clicking these images swaps the main product image.
Post Reply
norman
Site Admin
Posts: 1252
Joined: Sat Feb 07, 2004 9:55 pm

Displaying text below the icons.

Post by norman »

You can put text into variables "ExtraImage0..6 Alt Text" and this displays when the mouse is over the icons.

If you want to display this text underneath the icons, do the following:

Go to Design / Library / Layouts / Extra Image layouts and edit layout Extra Image Table.

If it's version 1.nn do the following:
Look for the line:

Code: Select all

				echo "</td>";
Immediately above it add:

Code: Select all

				if ( $iconalts[$i] != '' ) 
					{
					echo '<br/>' . htmlentities($iconalts[$i]);
					}
If you have version 2.nn then:

Look for the line:

Code: Select all

				$html .= "</td>";
Immediately above it add:

Code: Select all

				if ( $iconalts[$i] != '' ) 
					{
					$html .= '<br/>' . htmlentities($iconalts[$i]);
					}
If you want this on Extended Info or Fragment items, do the same to the corresponding layout.

NOTE: Updated 19-08-09 to allow for special characters in the alt text.
Norman
AndyBo
Posts: 10
Joined: Tue Feb 07, 2012 1:23 am

Re: Displaying text below the icons.

Post by AndyBo »

Would it be possible to adapt this code to allow some HTML to be used in the ALT Text field?

What I am trying to do it to create a link to a popup larger image that will be held on the same server but not in the acatalog directory.

I have multi images set up change the main image when the mouse hovers over the icon.

Example of current setup:
http://www.seriouslysilver.co.uk/acatal ... ndant.html
norman
Site Admin
Posts: 1252
Joined: Sat Feb 07, 2004 9:55 pm

Re: Displaying text below the icons.

Post by norman »

Anything is possible but you want significant bespoke functionality. Not possible without paid for work.

If you want to try it yourself, I'd suggest creating a new Variable of type Filename to hold these images. That way you can fill in their values by Browsing for them.

Using a text field and hoping that what you type in matches the name of an external file is asking for trouble.
Norman
AndyBo
Posts: 10
Joined: Tue Feb 07, 2012 1:23 am

Re: Displaying text below the icons.

Post by AndyBo »

Many thanks for that Norman.
We always add new products by way of an import file so filling out the text file with the correct filenames shouldn't be a problem, it was getting the text to become a link that I was struggling with.

Thanks again for a great product!
norman
Site Admin
Posts: 1252
Joined: Sat Feb 07, 2004 9:55 pm

Re: Displaying text below the icons.

Post by norman »

Use a custom Variable, populate it from your Import (has to be a Hierarchical one, then in the layout, use a BlockIf to check if the variable isn't empty. If not empty, create HTML as required incorporating the Variable's contents.
Norman
Post Reply