use only one/two items of Action items

rob2

Joined: 2005-08-07
Posts: 40
Posted: Tue, 2005-08-23 15:56

In the theme.tpl I want insert only one (or two items) of Action items;
one is item slideshow;

The code that insert all itemes is in the file ItemLinks.tpl
and it is:

{if !isset($links)}{assign var="links" value=$theme.itemLinks}{/if}

{foreach from=$links item=link}
<a href="{g->url params=$link.params}" class="..">{$link.text}</a>
{/foreach}

but if I want only one or two, how I can to do?

I not want deactive all the other modules;
I want only see one/two items, but in different position of theme.tpl's layout)

I not know smarty but I understood that
$link.params is an array;

If the cicle foreach insert one for one all the values, how I can insert only
one my value; write a parameter that is my value (I think)?

thanks

 
lvthunder

Joined: 2003-09-12
Posts: 808
Posted: Tue, 2005-08-23 16:50

This is the code I used to add the Fullscreen Slideshow next to the system links.

          {if $theme.item.parentId > 0}
          <span class="block-core-SystemLink">
          <a href="{g->url arg1="view=slideshowapplet.SlideshowApplet"
		   arg2="itemId=`$theme.item.id`"}"> {g->text text="Slideshow"} </a>
          </span>
          {/if}

This code will display the fullscreen slideshow on every page except the base page. I don't have any images in that album just sub albums so I didn't want to show it there because it wouldn't do anything (since the module doesn't grab the images in the sub albums). To get this for other items look at the link that it creates and modify the slideshowapplet.slideshowApplet to whatever it needs to be.

 
rob2

Joined: 2005-08-07
Posts: 40
Posted: Tue, 2005-08-23 20:50

ok I think is a good example;
in this site is there a tutorial with similar example?

you how have learning to do that; (if isn't a secret ;-) )?

 
lvthunder

Joined: 2003-09-12
Posts: 808
Posted: Tue, 2005-08-23 20:56

Well all the documentation isn't done yet, but I guess I learned it by asking specific questions here in this forum and comparing the output to the template. I've been messing with G2 since Alpha 1. One of these days I'd expect all this stuff to be written out, but the devs have mostly been working on getting as many features in G2 as they possibly could. G2 has come a long long way since then.