Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Expand and collapsible button

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
obi
Smarty n00b


Joined: 30 Jun 2015
Posts: 1

PostPosted: Tue Jun 30, 2015 9:58 am    Post subject: Expand and collapsible button Reply with quote

Hi,
I am new, forgive me if this is the wrong forum for this question.
I have a tpl code that generates the following on the browser:

[url]Publication 1[/url]
[url]View Journal[/url] | [url]Current Issue [/url]

[url]Publication 2[/url]
[url]View Journal[/url] | [url]Current Issue [/url]
….

“Publication 1”, 2, 3 …n er links. “View Journal”, and “Current Issues” are also links.
I want to make the “View Journal”, and “Current Issues” collapsible . They only appear when one hover over “ Pulblication 1” or click on Expand/Collapse button like this:

[url]Publication 1 [/url] [url]+[/url]

I have tried embedding javascript in the tpl but it does not work. Can any one help?

The tpl code is as follows:
Code:
……
{iterate from=journals item=journal}
   {if $site->getSetting('showThumbnail')}
      {assign var="displayJournalThumbnail" value=$journal->getLocalizedSetting('journalThumbnail')}
      <div style="clear:left;">
      {if $displayJournalThumbnail && is_array($displayJournalThumbnail)}
         {assign var="altText" value=$journal->getLocalizedSetting('journalThumbnailAltText')}
         <div class="homepageImage"><a href="{url journal=$journal->getPath()}" class="action"><img src="{$journalFilesPath}{$journal->getId()}/{$displayJournalThumbnail.uploadName|escape:"url"}" {if $altText != ''}alt="{$altText|escape}"{else}alt="{translate key="common.pageHeaderLogo.altText"}"{/if} /></a></div>
      {/if}
      </div>
   {/if}
   {if $site->getSetting('showTitle')}
      <h3>{$journal->getLocalizedTitle()|escape}</h3>


   {/if}
   {if $site->getSetting('showDescription')}
      {if $journal->getLocalizedDescription()}
         <p>{$journal->getLocalizedDescription()|nl2br}</p>
      {/if}
   {/if}
   <p><a href="{url journal=$journal->getPath()}" class="action">{translate key="site.journalView"}</a> | <a href="{url journal=$journal->getPath() page="issue" op="current"}" class="action">{translate key="site.journalCurrent"}</a> | <a href="{url journal=$journal->getPath() page="user" op="register"}" class="action">{translate key="site.journalRegister"}</a></p>
{/iterate}
....


….

Thanks in advance
Obi
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP