Need to add CSS to Album and Photo links

zetarhos

Joined: 2006-02-12
Posts: 9
Posted: Thu, 2009-08-27 02:21

Because of the CSS styling that my website's template gives to links, it has been adding an underline to linked images as well as text links. I solved it on the rest of my site by defining it in the stylesheet as follows:

Quote:
#content a.imgLink {
text-decoration: none;
border-bottom: 0px;
}

#content a:hover.imgLink {
text-decoration: none;
border-bottom: 0px;
background-color: #777777;
}

Then here is an example linked image using this rule:

Quote:
<A HREF="javascript:popUp2('/gallery/',800,610)" class="imgLink" title="Launch Video Archive (popup window)"><img src="gallery/videoarchive_thm.jpg" alt="Launch Video Archive (popup window)" width="260" height="162" border="0" /></A>

After I implemented G2, I realized that every single new album I create and photo I upload is going to have this problem since they are all links. Where can I add my class="imgLink" code in a template that will apply this globally, but JUST to Album thumbnails and Photos? I modified based off of the Matrix theme by the way..

Help is appreciated!
Mike

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2009-08-27 17:50

You would need to edit album.tpl and photo.tpl of the theme you are using.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
zetarhos

Joined: 2006-02-12
Posts: 9
Posted: Thu, 2009-08-27 19:12

Got it working for the most part. Had to change this in photo.tpl on lines 58-63

Quote:
{if $image.viewInline}
{if isset($theme.navigator.next)}
<a href="{g->url params=$theme.navigator.next.urlParams}" class="imgLink">
{else}
<a href="{g->url params=$theme.navigator.first.urlParams}" class="imgLink">
{/if}

and this in album.tpl on lines 102-118

Quote:
{if isset($theme.params.$frameType) && isset($child.thumbnail)}
{g->container type="imageframe.ImageFrame" frame=$theme.params.$frameType
width=$child.thumbnail.width height=$child.thumbnail.height}
<a href="{$linkUrl}" class="imgLink">
{g->image id="%ID%" item=$child image=$child.thumbnail
class="%CLASS% giThumbnail"}
</a>
{/g->container}
{elseif isset($child.thumbnail)}
<a href="{$linkUrl}" class="imgLink">
{g->image item=$child image=$child.thumbnail class="giThumbnail"}
</a>
{else}
<a href="{$linkUrl}" class="giMissingThumbnail">
{g->text text="no thumbnail"}
</a>
{/if}