List Info

Thread: Re: Smarty engine help




Re: Smarty engine help
user name
2007-08-14 07:44:00
So I guess you'll need to find the template that is used for
the individual
photo display page, and either modify your thumbnail listing
template or the
lightbox script.

I think i have found that file. Here it is:
{if !empty($theme.imageViews)}
{assign var="image"
value=$theme.imageViews[$theme.imageViewsIndex]}
{/if}

<h2>{$theme.item.title|markup}</h2>

{if !empty($theme.imageViews)}
  {capture name="fallback"}
    <a href="{g->url
arg1="view=core.DownloadItem"
arg2="itemId=`$theme.item.id`"
		     forceFullUrl=true forceSessionId=true}">
      {g->text text="Download %s"
arg1=$theme.sourceImage.itemTypeName.1}
    </a>
  {/capture}

  {if ($image.viewInline)}
    <div class="gallery-photo">
      {if $theme.params.enableImageMap}
	{if isset($theme.navigator.back)}
	  <a href="{g->url
params=$theme.navigator.back.urlParams}"
	     id="prevArrow" style="position:
absolute; margin: 30px 0 0 30px; visibility: hidden"
	    
onmouseover="document.getElementById('prevArrow').style
.visibility='visible'"
	    
onmouseout="document.getElementById('prevArrow').style.
visibility='hidden'"
	  ><img src="{g->theme
url="images/arrow-left.gif"}"
alt="" width="20" height="17"
	  /></a>{/if}
	{g->image item=$theme.item image=$image
class="gallery-photo"
	    fallback=$smarty.capture.fallback usemap=#prevnext}
	{if isset($theme.navigator.next)}
	  <a href="{g->url
params=$theme.navigator.next.urlParams}"
	     id="nextArrow"
style="position:absolute; margin: 30px 0 0 -50px;
visibility: hidden"
	    
onmouseover="document.getElementById('nextArrow').style
.visibility='visible'"
	    
onmouseout="document.getElementById('nextArrow').style.
visibility='hidden'"
	   ><img src="{g->theme
url="images/arrow-right.gif"}"
alt="" width="20" height="17"
	   /></a>{/if}
      {/strip}
        {g->image item=$theme.item image=$image
class="gallery-photo"
	 fallback=$smarty.capture.fallback}
      {/if}
    </div>
  
    {$smarty.capture.fallback}
  {/if}

  {g->text text="There is nothing to view for this
item."}
{/if}

{* Navigation image map *}
{if $theme.params.enableImageMap &&
!empty($image.width) && !empty($image.height)}
<map id="prevnext"
name="prevnext">
{if isset($theme.navigator.back)}
  <area shape="rect" coords="0,0,{math
equation="round(x/2-1)"
x=$image.width},{$image.height}"
   href="{g->url
params=$theme.navigator.back.urlParams}"
  
alt="{$theme.item.title|markup:strip|default:$theme.ite
m.pathComponent}"
  
onmouseover="document.getElementById('prevArrow').style
.visibility='visible'"
  
onmouseout="document.getElementById('prevArrow').style.
visibility='hidden'"/>
{/if}
{if isset($theme.navigator.next)}
  <area shape="rect" coords="{math
equation="round(x/2)"
				  
x=$image.width},0,{$image.width},{$image.height}"
   href="{g->url
params=$theme.navigator.next.urlParams}"
  
alt="{$theme.item.title|markup:strip|default:$theme.ite
m.pathComponent}"
  
onmouseover="document.getElementById('nextArrow').style
.visibility='visible'"
  
onmouseout="document.getElementById('nextArrow').style.
visibility='hidden'"/>
{/if}
</map>
{/if}


<br style="clear: both;" />


{* Navigator *}
{if !empty($theme.navigator)}
  {g->callback type="core.LoadPeers"
item=$theme.item windowSize=1}
  {g->block type="core.Navigator"
navigator=$theme.navigator prefix="&laquo; "
suffix=" &raquo;"
      currentItem=$block.core.LoadPeers.thisPeerIndex
totalItems=$block.core.LoadPeers.peerCount}
{/if}

<hr/>

{* Description *}
{if !empty($theme.item.description) &&
($theme.item.description != $theme.item.title)}
  <p>{$theme.item.description|markup}</p>
{/if}

{* Download *}
{if !empty($theme.sourceImage) &&

Not sure if i should be looking for <img src> or href
tags?

-- 
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php


RE: Smarty engine help
user name
2007-08-14 14:04:21
From: Chris Arnold [mailto:carnoldelectrichendrix.com] 
> I think i have found that file. Here it is:

Just to be clear, that template code you pasted in is
apparently getting included into the main theme template. 
The <h2> is the start of the output in the template
code you sent, and that doesn't show up until line 218 in
the final rendered page.  Anyway, looks like the image is
coming from this:

{g->image item=$theme.item image=$image
class="gallery-photo"
	fallback=$smarty.capture.fallback usemap=#prevnext}

This {g->image} tag (which is being passed the
"item","class" and other parameters, is
apparently a custom plugin specific to Gallery2...  Oh, hm,
did you read and follow this?  I think this describes how to
do what you want.
http://codex.gallery2.org/Gallery2:Lightbox_JS_Tutorial 

HTH

--
Max Schwanekamp
NeptuneWebworks.com
541-517-9064

--
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )