Moving things around in photo.tpl in Greypop - problem

dzan242

Joined: 2010-04-21
Posts: 2
Posted: Wed, 2010-04-21 17:07

I'm trying to edit the Greypop theme so that instead of having the thumbnail from the previous image before the image, and the next thumbnail after, it will have simple previous and next links above the image. When I move them up, everything works except for one thing: the first image in each set fails to display the "Next" link.

Example of a working page: http://www.aradani.com/artmbgallery/v/colorillustration/ultimgamerweb.jpg.html
Example of the first image in that set, which doesn't display the Next link: http://www.aradani.com/artmbgallery/v/colorillustration/scorpia.html

Here's the edited code for photo.tpl:

{*
 * $Revision: 1.1.2 $
 * 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 !empty($theme.imageViews)}
{assign var="image" value=$theme.imageViews[$theme.imageViewsIndex]}
{/if}
<table width="100%" cellspacing="0" cellpadding="0">
  <tr valign="top">
    {if !empty($theme.params.sidebarBlocks)}
    <td id="gsSidebarCol">
      {g->theme include="sidebar.tpl"}
    </td>
    {/if}
    <td>
    
      <div id="gsContent">
        <div class="gbBlock gcBackground1">
                {if !empty($theme.item.title)}
                <h2> {$theme.item.title|markup} </h2>
                {/if}
                
                {g->block type="core.ItemInfo"
                          item=$theme.item
                          showDate=true
                          showOwner=false
                          class="giInfo"}
                          
        </div>
        <div id="gsImageView" class="gbBlock">
                  {if !empty($theme.imageViews)}
	    {capture name="fallback"}
	    <a href="{g->url arg1="view=core.DownloadItem" arg2="itemId=`$theme.item.id`"}">
	      {g->text text="Download %s" arg1=$theme.sourceImage.itemTypeName.1}
	    </a>
	    {/capture}

	    {if ($image.viewInline)}
        <table cellspacing="0" cellpadding="0" style="width:700px;margin:auto">
<tr>
<td width="50%">
{if $theme.params.showMicroThumbs == 1}
		{if isset($theme.navigator.back)}
			{if isset($theme.navigator.back.item)}
				{if isset($theme.photoFrame)&& isset($theme.navigator.back.thumbnail.width)}
					{if $theme.photoFrame != "none"}
					{g->container type="imageframe.ImageFrame" frame=$theme.photoFrame
					width=$theme.navigator.back.thumbnail.width height=$theme.navigator.back.thumbnail.height}
					<div id="entire_image_prev">
					<div id="prev" class="floatlinksprev">
						{if isset($theme.navigator.back)}
						<p>
						{g->image id="%ID%" item=$theme.navigator.back.item image=$theme.navigator.back.thumbnail
						class="previous" class="%CLASS%"}
						<a href="{g->url params=$theme.navigator.back.urlParams}"><em>previous</em></a></p>
						{/if}
					</div>
					</div>
					{/g->container} 
					{else}
					
					<div id="entire_image_prev">
					<div id="prev" class="floatlinksprev" style="width:70px;margin:10px;border:1px solid #555;background:#222;text-align:center">
					<p><a href="{g->url params=$theme.navigator.back.urlParams}">Previous</a></p>
					</div>
					</div>
					
					{/if}	
				{/if}
                </td>
<td width="50%" align="right">
{if $theme.params.showMicroThumbs == 1}
	{if isset($theme.navigator.next)}
		{if isset($theme.navigator.next.item)}
			{if isset($theme.photoFrame) && isset($theme.navigator.next.thumbnail.width)}
				{if $theme.photoFrame != "none"}
				{g->container type="imageframe.ImageFrame" frame=$theme.photoFrame
				width=$theme.navigator.next.thumbnail.width height=$theme.navigator.next.thumbnail.height}
				<div id="entire_image_next">
				<div id="next" class="floatlinksnext" style="width:70px;margin:10px;border:1px solid #555;background:#222;text-align:center">
				<p><a href="{g->url params=$theme.navigator.next.urlParams}">Next</a></p>
				</div>
				</div>
				{/g->container} 
				{else}
				<div id="entire_image_next">
				<div id="next" class="floatlinksnext" style="width:70px;margin:10px;border:1px solid #555;background:#222;text-align:center">
				<p><a href="{g->url params=$theme.navigator.next.urlParams}">Next</a></p>
				</div>
				</div>
				{/if}
			{/if}
		{/if}
	{/if}
{/if}
</td>
</tr>
</table>

	    <table>
	    <tr><td>
	
				{if isset($theme.item.height)}     
				{if ($theme.item.height) > ($theme.item.width)}
				</td><td> 
				{else}
				</td></tr><tr><td>
				{/if}
				{else}
				</td></tr><tr><td>
				{/if}
			{/if}
		{/if}
	{/if}
	      {if isset($theme.photoFrame) && isset($theme.item.height)}
		{g->container type="imageframe.ImageFrame" frame=$theme.photoFrame
		width=$image.width height=$image.height}
		{if $theme.item.entityType == "GalleryPhotoItem"}
        {if $theme.imageViewsIndex != 1}
        <a href="{g->url arg1="view=core:ShowItem" arg2="itemId=`$theme.item.id`" arg3="imageViewsIndex=1"}">
	    {g->image id="%ID%" item=$theme.item image=$image fallback=$smarty.capture.fallback class="%CLASS%"}</a>
	    {else}
        <a href="{g->url arg1="view=core:ShowItem" arg2="itemId=`$theme.item.id`" arg3="imageViewsIndex=0"}">
	    {g->image id="%ID%" item=$theme.item image=$image fallback=$smarty.capture.fallback class="%CLASS%"}</a>
	    {/if}
	    {else}
	    {g->image id="%ID%" item=$theme.item image=$image fallback=$smarty.capture.fallback class="%CLASS%"}
	    {/if}
		{/g->container}
	      {else}
	    {if $theme.item.entityType == "GalleryPhotoItem"}  
			{if $theme.imageViewsIndex != 1}
        	<a href="{g->url arg1="view=core:ShowItem" arg2="itemId=`$theme.item.id`" arg3="imageViewsIndex=1"}">
	    	{g->image item=$theme.item image=$image fallback=$smarty.capture.fallback}</a>
	    	{else}
        	<a href="{g->url arg1="view=core:ShowItem" arg2="itemId=`$theme.item.id`" arg3="imageViewsIndex=0"}">
	    	{g->image item=$theme.item image=$image fallback=$smarty.capture.fallback}</a>
	    	{/if}
	    {else}
		{g->image item=$theme.item image=$image fallback=$smarty.capture.fallback}
		{/if}
	      {/if}
	    {else}
	      {$smarty.capture.fallback}
	    {/if}
          {else}
            {g->text text="There is nothing to view for this item."}
          {/if}
      {if isset($theme.item.height)}
      {if ($theme.item.height) > ($theme.item.width)}
      </td><td> 
      {else}
      </td></tr><tr><td>
      {/if}
      {else}
      </td></tr><tr><td>
      {/if}



      </td></tr>
      </table>
        </div>
{if !empty($theme.item.description)}
                <p class="giDescription" style="width:700px;padding:10px;margin:10px auto;border:1px solid #555;background:#222;text-align:center"">
                  {$theme.item.description|markup}
                </p>
                {/if}
        {* Download link for item in original format *}
        {if !empty($theme.sourceImage) && $theme.sourceImage.mimeType != $theme.item.mimeType}
        <div class="gbBlock">
          <a href="{g->url arg1="view=core.DownloadItem" arg2="itemId=`$theme.item.id`"}">
            {g->text text="Download %s in original format" arg1=$theme.sourceImage.itemTypeName.1}
          </a>
        </div>
        {/if}

        {* Show any other photo blocks (comments, exif etc) *}
        {foreach from=$theme.params.photoBlocks item=block}
        {if $block.0 == "core.ItemLinks" and $user.isAdmin != 1}
        {else}
          {g->block type=$block.0 params=$block.1}
          {/if}
        {/foreach}

        {g->block type="core.GuestPreview" class="gbBlock"}

        {* Our emergency edit link, if the user all blocks containing edit links *}
	{g->block type="core.EmergencyEditItemLink" class="gbBlock"
                  checkSidebarBlocks=true
                  checkPhotoBlocks=true}
      </div>
    </td>
  </tr>
</table>

Any ideas would be greatly appreciated!

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2010-04-22 04:17

Without digging to much I would look to see if all your {if......} statments have a closing {/if} to go with them

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
dzan242

Joined: 2010-04-21
Posts: 2
Posted: Thu, 2010-04-22 15:36

This gave me the clue I needed to figure it out. Thanks!