Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Is this possible? (change the color of one link)

Quote Reply
Is this possible? (change the color of one link)
Is it possible to change the color of the link in specified category?
Example:
There are 30 categories on the index page, all the links has the blue color, but one of them is red color.
The same thing in subcategory is 10 links and one of them has unique color.
Just to point out the most interesting category or two.

Is this possible? Does anyone know how?
Quote Reply
Re: [modifier] Is this possible? (change the color of one link) In reply to
I think you can do this by creating enum filed in category & link (if you want to display certain category also with different link colors and links/listings also with different link color). Name is SpecialColor and for options have Yes/No.

Now using if/elseif/endif tags in subcategory.html & link.html have different CSS tags for SpecialColor Yes & Special Color No.

Hope this helps.

Vishal

Vishal
-------------------------------------------------------
Quote Reply
Re: [SWDevil.Com] Is this possible? (change the color of one link) In reply to
Thanks much. At last I know it is possible. But I don’t think I will be able to do it. I’m new to this stuff. If anyone has done something like this, detailed instruction would be very helpful.

Thanks

Miro
Quote Reply
Re: [modifier] Is this possible? (change the color of one link) In reply to
Hello Miro,

This is what I would do.

Under Link Properties (you can do the same for category properties too)

1) Add Column
2) Column Name: SpecialColor
3) Column Type: ENUM
4) Column Values: Yes/No (Make sure that Yes & No are in 2 separate lines)
5) Not Null: No
6) Default: No
7) Form Display: SpecialColor
8) Form Type: Select
9) Form Names: Yes/No (Make sure that Yes & No are in 2 separate lines)
10) Form Values: Yes/No (Make sure that Yes & No are in 2 separate lines)

Now in link.html if you want to display link title for specialcolor links with specified color, you can use tag such as

Quote:
<%if SpecialColor 'eq' Yes'><a class="specialcolorclass" href="<%detailed_url%>"><%Title%></a>
<%else%>
<a class="normallinkcolorclass" href="<%detailed_url%>"><%Title%></a>
<%endif%>


& to have category with different color in the list of categories, in subcategory.html you can use something like:

Quote:
<%if SpecialColor 'eq' Yes'><a class="specialcolorclass" href="<%escape_html URL%>"><%Name%>
<%else%>
<a class="normallinkcolorclass" href="<%escape_html URL%>"><%Name%>
<%endif%>

You can use the luna template and modify it as required, and add above if/else/endif tags as required.

P.S.. When in doubt... or working with any link/table/user/review properties... ALWAYS backup your db. So you don't have to strangle yourself later on.


Hope this helps.

Vishal

Vishal
-------------------------------------------------------