Glossary - term in the same page

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
mel
Forum Members
Forum Members
Posts: 147
Joined: Mon Dec 11, 2006 11:53 pm

Glossary - term in the same page

Post by mel »

Hi,
Using Glossary 1.0, I used the new template "jQuery-open-close". I want to display definition directly in the text, using the accordion jquery magic. But I couldn't find how.
Inline option throws a link to some other page.
Just set {Glossary term="term"} do it, but the problem is output a <h3> in the middle of the text. Even if I changed in glossary template to whatever <p> or <span> with a "display:inline", it doesn't work, as a <div> is inside a <p> and don't display fine. Does someone how I can do it?

Example:

Code: Select all

text before {Glossary term="ABC"} text after

HTML output:
<p>text before
<__script__ type="text/javascript">
//<![CDATA[
$(function() {

$('.accordion').accordion({
            collapsible: true,
            active: false, 
            autoHeight: false 

      });
});
//]]>
</__script>

<div class="accordion">
      <span class="def" title="ABC">ABC</span>
    <div>definition</div>
text after</p>
Template:

Code: Select all

<__script__ type="text/javascript">
//<![CDATA[
$(function() {

$('.accordion').accordion({
            collapsible: true,
            active: false, 
            autoHeight: false 

      });
});
//]]>
</__script>

<div class="accordion">
  {foreach from=$items item='item'}
    <h3 {if isset($item.tip) && $item.tip != ''}title="{$item.tip}"{/if}>{$item.name}</h3>
    <div><p>{$item.definition}</p></div>
  {/foreach}
</div>
Post Reply

Return to “Modules/Add-Ons”