captions with slider theme? how?

kylec

Joined: 2003-02-08
Posts: 16
Posted: Fri, 2005-09-09 02:04

Is their a way to add captions or description to the slider theme?

Is their a central place to find themes, get theme updates, and contact theme authors?

-kyle

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Fri, 2005-09-09 06:30

you can customize the tpl files however you like.. probably you'll want to look at how hybrid stores the titles/descriptions in hidden divs and then uses javascript to display them when images are clicked. where do you want to show text in the slider display?

the G2 download page + User contrib on codex.gallery2.org has all the themes we know about. theme authors are usually listed in theme.inc

 
Dennis M

Joined: 2006-01-27
Posts: 1
Posted: Fri, 2006-01-27 11:38

Did anyone manage to display the 'Description' field and perhaps EXIF data with this theme?

/Dennis

 
hgoldman

Joined: 2006-06-08
Posts: 1
Posted: Thu, 2006-06-08 00:38

i am trying to do this as well as display a title album page. cant seem to find out how.

harvey

 
DirtHerder

Joined: 2006-06-27
Posts: 4
Posted: Wed, 2006-06-28 02:45

Likewise.

I really like this theme and have been able to modify it to some extent in order to suit my needs, but I can't figure out how to get any additional functionality (comments, ratings, descriptions, captions) working with it.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Wed, 2006-06-28 19:36

compare the loadCommonTemplateData calls in theme.inc with other themes like matrix. for example, the 'itemSummaries' key will load the data like "3 comments" and the rating interface. then you need to modify the tpl to display that data somewhere..

 
chillspace

Joined: 2006-12-08
Posts: 2
Posted: Sat, 2006-12-09 01:18

Anybody find a solution for this? I, too, would like to get proper captions for the slider theme. I was able to get the album title to display properly (see below). If I find a solution, I'll post it up.

<div id-"slider-albumtitle">{g->text text=" %s" arg1=$theme.item.title|markup}</div>

I simply placed this div above the imagearea div. You can place anywhere you like, though. Hope this helps.

 
chillspace

Joined: 2006-12-08
Posts: 2
Posted: Sat, 2006-12-09 03:08

Okay, for anyone that wasn't able to modify the slider theme to show captions a quick solution:

<div style="display: none">
{foreach from=$theme.children key=i item=it}
  {if isset($it.image)}
    {if isset($it.renderItem)}
      <a id="img_{$it.imageIndex}" href="{g->url arg1="view=core.ShowItem"
          arg2="itemId=`$it.id`" arg3="renderId=`$it.image.id`"}"></a>
    {else}
      <a id="img_{$it.imageIndex}" href="{g->url arg1="view=core.DownloadItem"
       arg2="itemId=`$it.image.id`" arg3="serialNumber=`$it.image.serialNumber`"}"></a>
    {/if}
    <span id="title_{$it.imageIndex}">{$it.title|markup}</span>
 -->   <span id="caption_{$it.imageIndex}">{$it.description|markup}</span>
    <select id="links_{$it.imageIndex}">
     {foreach from=$it.itemLinks item=link}
      <option label="{$link.text}" value="{g->url params=$link.params}">{$link.text}</option>
     {/foreach}
    </select>
  {/if}
{/foreach}
</div>

I added the above line into the slider.tpl template. What this does is grabs the description field and places it into a hidden span exactly the same way the title is saved (line above it).

Then in slider.js add the following line to the image_show function (around line 176):

ui_sethtml('caption', document.getElementById('caption_'+image_index).innerHTML);

This will now dynamically replace text in the defined <div id="caption">&nbsp</div> that can placed anywhere in your theme template.