Images in Collapso?

Expanding / Collapsing, search engine friendly, Section menu.
Post Reply
Artisan
Posts: 50
Joined: Fri Apr 25, 2008 3:28 pm

Images in Collapso?

Post by Artisan » Fri Mar 26, 2010 11:59 am

I know this is a long shot but is it possible to use an image for a couple of the top level sections shown in the Collapso menu? The top item in the menu is Shop by Brand and, lower down, there's another called Shop by Product. I would like these two to be image buttons if possible. The website is on a temporary server at http://000.artinet.co.uk/

Malcolm

norman
Site Admin
Posts: 1226
Joined: Sat Feb 07, 2004 9:55 pm

Re: Images in Collapso?

Post by norman » Fri Mar 26, 2010 12:18 pm

In the Library / Variables / Section, create a new variable: CollapsoImage, Place Of Setting: Section, Type: Filename, Allow Empty Value: Checked.

Edit layout Callapso-5 Menu and look for the line:

Code: Select all

	$linkname = htmlspecialchars('<Actinic:Variable Name="SectionName" php="true" encoding="perl" selectable="false" />');
Immediately under that add:

Code: Select all

	$linkimage = '<Actinic:Variable Name="CollapsoImage" php="true" encoding="perl" selectable="false" />';
	if ( $linkimage ) $linkname = "<img border=\"0\" src=\"$linkimage\" alt=\"$linkname\" />";
Norman

Artisan
Posts: 50
Joined: Fri Apr 25, 2008 3:28 pm

Re: Images in Collapso?

Post by Artisan » Fri Mar 26, 2010 3:13 pm

Thanks, Norman, that did the job.

Is there any way for me to get rid of the grey square that appears alongside just those two images so they're centered in the column?

Malcolm

norman
Site Admin
Posts: 1226
Joined: Sat Feb 07, 2004 9:55 pm

Re: Images in Collapso?

Post by norman » Fri Mar 26, 2010 3:41 pm

Try this. Look for the 2 instances of:

Code: Select all

		$bits[0] = "<img class=\"nsi\" src=\"c-n.gif\" />";
Immediately after them add:

Code: Select all

		if ( $linkimage ) $bits[0] = '';
You may need to add some &nbsp; between the quotes or add a style to the image tag to get margins right.

And before you ask - I don't think you can centre these lines only. Collapso is very hard to tweak, it only costs £25, I've done as much as I can and I'm not a CSS expert.
Norman

Artisan
Posts: 50
Joined: Fri Apr 25, 2008 3:28 pm

Re: Images in Collapso?

Post by Artisan » Fri Mar 26, 2010 5:44 pm

Thanks again, Norman, brilliant as always.
norman wrote:And before you ask - I don't think you can centre these lines only.
Saw that one coming, didn't you :)

I offset the image to appear central by adding white space in the image.

Malcolm

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest