[Solved] Prevent Glossary from filtering menu items

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
kochiro
Forum Members
Forum Members
Posts: 15
Joined: Wed Sep 09, 2009 9:09 pm
Location: Sweden

[Solved] Prevent Glossary from filtering menu items

Post by kochiro »

I have added the glossary module to my site and turned on the "Automatically Filter Content Pages for Terms?" option, however it is also filtering my menu items.  How do I prevent this from happening?

I searched and the only similar post I found was this one: http://forum.cmsmadesimple.org/index.ph ... 351.0.html which had no resolution.

Thanks,
Jay
Last edited by kochiro on Fri Sep 18, 2009 4:14 pm, edited 1 time in total.
kochiro
Forum Members
Forum Members
Posts: 15
Joined: Wed Sep 09, 2009 9:09 pm
Location: Sweden

Re: Prevent Glossary from filtering menu items

Post by kochiro »

Well I found a resolution for this but it involved "hacking" the source files which I was hoping to avoid.  If you need to replicate my "fix" for yourself you need to edit modules->Glossary->Glossary.module.php.  Around line 181 you will find something like

Code: Select all

$c_body_start = stripos($content,'</__body');
You will need to alter the code in that area to fit your templates.  What the Glossary is currently doing is taking everything between the body tags and applying the glossary code to any term that it finds between them.  In my case this included the navigation which I did not want to have happening.

In my template I created comment blocks around my central page content and then altered the logic in Glossary.module.php to use the content between those comments as the basis for the replacement.

What you will be doing is creating "sections". 

ex:
Section 1: from the top of page to your first comment
Section 2: the contents between your comment (usually containing your {content} tag)
Section 3: from the end of your closing comment to the end of the page

It is Section 2 that the glossary replacement will take place on.

Jay
Post Reply

Return to “The Lounge”