[solved] How to remove slideshow option in main gallery

EvilGrin

Joined: 2003-07-11
Posts: 8
Posted: Thu, 2005-10-20 19:05

Hello,

I've been viewing around and trying my very beste the whole day, but I really don't know how to remove or hide the slideshow lin on my main gallery site. As there are only nested albums there is no use of this link. Does anybody have an idea?

Thanks in advance!

 
paularms
paularms's picture

Joined: 2005-05-16
Posts: 13
Posted: Thu, 2005-10-20 19:56

I agree... the slideshow option should just not show if there are no items that can be put in the slideshow.

 
tomcat76
tomcat76's picture

Joined: 2003-04-22
Posts: 133
Posted: Thu, 2005-10-20 20:15

You know, I always thought this was a bit odd, showing the slideshow option on album pages and then being told you cannot view albums...

Regards Steve

 
EvilGrin

Joined: 2003-07-11
Posts: 8
Posted: Fri, 2005-10-21 11:44

so is there no option to remove the link?

 
robert070612

Joined: 2003-08-05
Posts: 565
Posted: Fri, 2005-10-21 12:22

In the Site Admin area edit your chosen Gallery Theme setup area so that Item actions only appears in the PHOTO block... That way, without any programming, your slideshow link only shows when there is a picture.
----best wishes, Robert

 
RwD
RwD's picture

Joined: 2005-01-09
Posts: 383
Posted: Fri, 2005-10-21 12:40

There is a related feature request for this: http://gallery.menalto.com/sfvote/vote/1144960
You can vote for it if you want to have this implemented into gallery2. The feature is slightly different from what is suggested here, because it creates the need for the slideshow button by making the slideshow also look into subalbums.
______________________
I made a theme for G2, try it :)

 
peter_k

Joined: 2005-09-15
Posts: 134
Posted: Fri, 2005-10-21 13:26

In G2 Documentation > User contributions > Mods/Patches you could have found a link to this post:

http://gallery.menalto.com/node/36939#comment-138995

The link in this post points to a modified ItemLinks.tpl file that does exactly what is requested here.

icpix, if I understand your workaround, the slideshow link is only shown on a photo page? But it can be useful to have it also on an album page, if there are photos in the album to show (so not an empty album or an album with only sub-albums).

 
robert070612

Joined: 2003-08-05
Posts: 565
Posted: Fri, 2005-10-21 13:39

I don't mix and match. Here it's either albums OR images as there are no labels onscreen (minimalist).

 
EvilGrin

Joined: 2003-07-11
Posts: 8
Posted: Sat, 2005-10-22 11:23
icpix wrote:
In the Site Admin area edit your chosen Gallery Theme setup area so that Item actions only appears in the PHOTO block... That way, without any programming, your slideshow link only shows when there is a picture.
----best wishes, Robert

thanks, this worked fine.
I'll try the other suggestions later on!

Well, but what I really wanted is, to have the Element options in the side menu only if there is a photo in the gallery. Ist there any option? Because in my albums there are only subalbums or photos but never both mixed together.

 
peter_k

Joined: 2005-09-15
Posts: 134
Posted: Mon, 2005-10-24 09:39

you'll have to modify part of the itemlinks.tpl file (see link in above post) into this:

{assign var="hasDataItems" value=0}
{foreach from=$theme.children item=child}
	{if !$child.canContainChildren}
		{assign var="hasDataItems" value=1}
	{/if}
{/foreach}
{if ($hasDataItems == 1)}
{foreach from=$links item=link}
	{if $link.moduleId == "slideshow"}
	
      <a href="{g->url params=$link.params}" class="gbAdminLink {g->linkid
	 urlParams=$link.params}">{if $lowercase}{$link.text|lower}{else}{$link.text}{/if}</a>
{/foreach}
{/if}
 
ckawalek

Joined: 2005-01-25
Posts: 104
Posted: Thu, 2005-12-08 23:37

I love the idea of removing the "View Slideshow" link on albums that do not have any photos in them, but this also removes the "View Slideshow" link from the actual photo pages too. Is there a way to not have it remove the view slideshow from only the album pages?
Thanks!

 
bluenova

Joined: 2006-03-21
Posts: 11
Posted: Thu, 2006-03-23 17:40

Thanks for the code peter_k, it worked like a charm.

Any chance of a simlar code for 'Add Album To Cart'?

Regards
Bluenova

 
peter_k

Joined: 2005-09-15
Posts: 134
Posted: Sun, 2006-03-26 15:06

Bluenova, glad you liked it.
I don't have the cart module on my site, so I can't help you with that one. Try searching the forums, or start a new topic, coz in this thread your request probably will not be found (too different from original topic, although the solution migh be very similar; you could put a link in the new topic to this solution)

Peter

 
ckawalek

Joined: 2005-01-25
Posts: 104
Posted: Wed, 2007-04-04 06:33

I've updated this for Gallery 2.2 - Revision: 15342 of the ItemLinks.tpl

after the lines:

    {else}
      {foreach from=$links item="link"}

Replace the rest with this:

	{if $link.moduleId == "slideshow"}
		{assign var="hasDataItems" value=0}
		{foreach from=$theme.children item=child}
			{if !$child.canContainChildren}
				{assign var="hasDataItems" value=1}
			{/if}
		{/foreach}
		{if ($hasDataItems == 1)}	
      <a class="gbAdminLink {g->linkid urlParams=$link.params|default:null}" href="{g->url params=$link.params|default:null options=$link.options|default:null}"{if isset($link.script)} onclick="{$link.script}"{/if}{if isset($link.attrs)} {$link.attrs}{/if}>{if $lowercase}{$link.text|lower}{else}{$link.text}{/if}</a>
		{/if}
	{else}
      <a class="gbAdminLink {g->linkid urlParams=$link.params|default:null}" href="{g->url params=$link.params|default:null options=$link.options|default:null}"{if isset($link.script)} onclick="{$link.script}"{/if}{if isset($link.attrs)} {$link.attrs}{/if}>{if $lowercase}{$link.text|lower}{else}{$link.text}{/if}</a>
	{/if}
    {/foreach}
    {/if}
  </div>
{/if}

Problems:
-Unfortunately it still removes the "view slideshow" link on the actual photo pages.
-It also will not hide the "view slideshow" link if there is an album link

If anyone has found a way around these please let me know.

--
http://ChristianJamesPhoto.com

 
schrecklich

Joined: 2008-01-03
Posts: 57
Posted: Mon, 2008-01-14 09:53

How is this solved if:

Quote:
Problems:
-Unfortunately it still removes the "view slideshow" link on the actual photo pages.
-It also will not hide the "view slideshow" link if there is an album link

Isnt that the point? To have no slideshow icon because there are no photos, only albums, and not having it on the photo pages is not the solution, too.

 
Torvon

Joined: 2007-12-26
Posts: 70
Posted: Thu, 2008-01-17 21:08

There is no fix for this problem, yet? Some of the solutions here are really old (2005), I don't think I shall try them all out.

The most important thing to change (at least for me) seems to be to remove the "view slideshow" on the root gallery page. Is there any way to do this?

ta-ta
T.
---------------
In case you need the link to my gallery in order to answer my help requests:
revelation-of-silence DOT com SLASH gallery

 
Torvon

Joined: 2007-12-26
Posts: 70
Posted: Tue, 2008-01-22 10:19

*bump*

After all I've read here, everyone using slideshow in Gallery2 (and that should be quite a few people) have the same problem: the "view slideshow" shows on the root level of the gallery, but doesn't work (at least in the sidebar).

Is there a way to remove that?

Thank you for your help.

---------------
In case you need the link to my gallery in order to answer my help requests:
revelation-of-silence DOT com SLASH gallery

 
grasshopper
grasshopper's picture

Joined: 2008-02-01
Posts: 5
Posted: Tue, 2008-02-05 06:10

I have a code that I found here a long time ago, and it works perfectly on a Gallery 2.2.2 that I have.

But on my other Gallery (2.2.4), it does not work anymore. Not too much of a difference in versions. Strange huh?

If anyone wants to work on this code, here it is, as I also need it to work on 2.2.4.!!!

Here is the code that works on 2.2.2.

Edit /modules/core/templates/blocks/local/ItemLinks.tpl

Add the section between ------------
(without the ------ of course!)

  <div class="{$class}">
    {foreach from=$links item=link}
--------------------------------------------------------------------------
	{if $link.moduleId == "slideshow"}
		{assign var="hasDataItems" value=0}
		{foreach from=$theme.children item=child}
			{if !$child.canContainChildren}
				{assign var="hasDataItems" value=1}
			{/if}
		{/foreach}
		{if ($hasDataItems == 1)}	
      <a href="{g->url params=$link.params}" class="gbAdminLink {g->linkid
	 urlParams=$link.params}">{if $lowercase}{$link.text|lower}{else}{$link.text}{/if}</a>
		{/if}
	{else}
--------------------------------------------------------------------------
      <a href="{g->url params=$link.params}" class="gbAdminLink {g->linkid
	 urlParams=$link.params}">{if $lowercase}{$link.text|lower}{else}{$link.text}{/if}</a>
	{/if}
    {/foreach}
  </div>
  {/if}
{/if}
 
Alexandra70

Joined: 2004-12-08
Posts: 143
Posted: Thu, 2008-02-07 13:28

I would like a fix for this too.

Doesn't make sense for Gallery to display the "View Slideshow" on the Album level if there are no pictures there to do a Slideshow.

 
kimberlysyukio

Joined: 2008-02-20
Posts: 4
Posted: Thu, 2008-02-21 19:57

I would also like a version for the 2.2.4

 
ADeveria

Joined: 2008-03-24
Posts: 2
Posted: Mon, 2008-03-24 14:13

Using the code shown by @grasshopper, I managed to solve this problem in 2.2.4 (works for me anyway).

Basically, this is the content of my file located here:
/modules/core/templates/blocks/local/ItemLinks.tpl

Note that the new slideshow-related code is located under the second {foreach from=$links item="link"} bit.

Hope this works for everyone else too.

{*
 * $Revision: 15342 $
 * If you want to customize this file, do not edit it directly since future upgrades
 * may overwrite it.  Instead, copy it into a new directory called "local" and edit that
 * version.  Gallery will look for that file first and use it if it exists.
 *}
{if !isset($links) && isset($theme.itemLinks)}
  {assign var="links" value=$theme.itemLinks}
{/if}
{if !empty($links)}
  {if empty($item)}
    {assign var="item" value=$theme.item}
  {/if}
  {if !isset($lowercase)}
    {assign var="lowercase" value=false}
  {/if}
  {if !isset($useDropdown)}
    {assign var="useDropdown" value=true}
  {/if}

  <div class="{$class}">
    {* If more than one link and $useDropdown is true, use a dropdown.  Otherwise render as links. *}
    {if count($links) > 1 && $useDropdown}
      <select onchange="var value = this.value; this.options[0].selected = true; eval(value)">
	<option value="">
	  {if $item.canContainChildren}
	    {g->text text="&laquo; album actions &raquo;"}
	  {else}
	    {g->text text="&laquo; item actions &raquo;"}
	  {/if}
	</option>
	{foreach from=$links item="link"}
	  <option value="{if isset($link.script)}{$link.script}{else}window.location = '{g->url params=$link.params|default:null options=$link.options|default:null}'{/if}"{if !empty($link.selected)} selected="selected"{/if}>
	    {if $lowercase}
	      {$link.text|lower}
	    {else}
	      {$link.text}
	    {/if}
	  </option>
	{/foreach}
      </select>
    {else}
      {foreach from=$links item="link"}
      {if $link.moduleId == "slideshow"}

		{assign var="hasDataItems" value=0}
		{foreach from=$theme.children item=child}
			{if !$child.canContainChildren}
				{assign var="hasDataItems" value=1}
			{/if}
		{/foreach}
		{if ($hasDataItems == 1)}	
			<a href="{g->url params=$link.params}" class="gbAdminLink {g->linkid
			urlParams=$link.params}">{if $lowercase}{$link.text|lower}{else}{$link.text}{/if}</a>
		{/if}
	{else}
	  	<a class="gbAdminLink {g->linkid urlParams=$link.params|default:null}" href="{g->url params=$link.params|default:null options=$link.options|default:null}"{if isset($link.script)} onclick="{$link.script}"{/if}{if isset($link.attrs)} {$link.attrs}{/if}>{if $lowercase}{$link.text|lower}{else}{$link.text}{/if}</a>
      {/if}

      {/foreach}
    {/if}
  </div>
{/if}

 
Alexandra70

Joined: 2004-12-08
Posts: 143
Posted: Wed, 2008-04-02 04:41

ADeveria, you are AWESOME!!!!

It finally works on 2.2.4!!!! I also had the other code that used to work on 2.2.2 and was upset that it was not working anymore!!!

Actually, seems like your code is identical to the one posted above... what changed???

THANK YOU SO MUCH anyway!!!