Carbon Theme: add RSS icon to GSContent in Album View

SDedalus

Joined: 2006-07-03
Posts: 3
Posted: Mon, 2010-08-02 16:41

The examples here are a little dated based on version 17592 of the Carbon album template, but I hope this may make it to a future release of Carbon for G3

Step 1:

Change album.tpl:

From this:

		{foreach from=$links item=itemLink}
		  {if $itemLink.moduleId == "cart"}
		  <td class="gsActionIcon">
		    <div class="buttonCart">{g->itemLink link=$itemLink
		     title="`$itemLink.text`" text="" class=""}</div>
		  </td>
		  {elseif $itemLink.moduleId == "comment"}
		    {if $itemLink.params.view == "comment.AddComment" }
		    <td class="gsActionIcon">
		      <div class="buttonAddComment">{g->itemLink link=$itemLink
		     title="`$itemLink.text`" text="" class=""}</div>
		    </td>
		    {elseif $itemLink.params.view == "comment.ShowAllComments"}
		    <td class="gsActionIcon">
		      <div class="buttonViewComments">{g->itemLink link=$itemLink
		     title="`$itemLink.text`" text="" class=""}</div>
		    </td>
		    {/if}
		  {elseif $itemLink.moduleId == "slideshow"}
		  <td class="gsActionIcon">
		    <div class="buttonViewSlideshow">{g->itemLink link=$itemLink
		     title="`$itemLink.text`" text="" class=""}</div>
		  </td>
		  {/if}
		{/foreach}

To this:

		{foreach from=$links item=itemLink}
		  {if $itemLink.moduleId == "cart"}
			  <td class="gsActionIcon" width="20px">
			    <div class="buttonCart"><a href="{g->url params=$itemLink.params}"
			     title="{$itemLink.text}"></a></div>
			  </td>
		  {elseif $itemLink.moduleId == "comment"}
		    {if $itemLink.params.view == "comment.AddComment" }
			    <td class="gsActionIcon" width="20px">
			      <div class="buttonAddComment"><a href="{g->url params=$itemLink.params}"
			       title="{$itemLink.text}"></a></div>
			    </td>
			    {elseif $itemLink.params.view == "comment.ShowAllComments"}
			    <td class="gsActionIcon" width="20px">
			      <div class="buttonViewComments"><a href="{g->url params=$itemLink.params}"
			       title="{$itemLink.text}"></a></div>
			    </td>
		    {/if}
		  {elseif $itemLink.moduleId == "slideshow"}
			  <td class="gsActionIcon" width="20px">
			    <div class="buttonViewSlideshow"><a href="{g->url params=$itemLink.params}"
			     title="{$itemLink.text}"></a></div>
			  </td>
                  {elseif $itemLink.moduleId == "rss"}
	                  <td class="gsActionIcon" width="20px">
	                    <div class="buttonRssFeed"><a href="{g->url params=$itemLink.params}" title="{$itemLink.text}"></a></div>
	                    <link rel="alternate" type="application/rss+xml" title="{$theme.item.title} RSS Feed" href="{g->url params=$itemLink.params}" />
	                  </td>
		  {/if}
		{/foreach}

and place modified file in ...gallerty2/themes/carbon/templates/local/

Step 2:
Back up original theme.css and then change

From this:

.buttonViewSlideshow a {
  display: block;
  width: 15px;
  height: 15px;
  background: url('../carbon/images/slideshow.gif') no-repeat;
}
.buttonViewSlideshow a:hover { background-position: -15px 0; }

.buttonCart a {
  display: block;
  width: 16px;
  height: 15px;
  background: url('../carbon/images/cart.gif') no-repeat;
}
.buttonCart a:hover { background-position: -16px 0; }

to this:

.buttonViewSlideshow a {
  display: block;
  width: 15px;
  height: 15px;
  background: url('../carbon/images/slideshow.gif') no-repeat;
}
.buttonViewSlideshow a:hover { background-position: -15px 0; }

.buttonRssFeed a {
  display: block;
  width: 15px;
  height: 15px;
  background: url('../carbon/images/rss-feed-icon.gif') no-repeat;
}
.buttonRssFeed a:hover { background-position: -16px 0; }

.buttonCart a {
  display: block;
  width: 16px;
  height: 15px;
  background: url('../carbon/images/cart.gif') no-repeat;
}
.buttonCart a:hover { background-position: -16px 0; }

Upload the resulting file to gallerty2/themes/carbon/images/

Step 3:
Upload the attached file (rss-feed-icon.gif) to gallerty2/themes/carbon/

Enjoy

AttachmentSize
rss-feed-icon.gif1.19 KB
 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Mon, 2010-08-02 18:40

Gallery3 (G3) doesn't use Smarty or those templates at all, no theme from G2 is or will be compatible with G3. So while someone may create a theme called carbon and it may even look something like the current carbon in G2, it won't share much (if any) code and will need to be re-written mostly from scratch.

Several people have already been working on themes for G3 and you can check them out here:
Wind is the default theme for G3 and works with the current code in G3.
Clean Canvas is the latest user contributed theme and works with RC2 and possibly later.
GreyDragon I believe needs some updating to work properly with the current code in G3.

Most, if not all, of the others I believe need updating to work with the current code base in G3.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here