Loading...
 
Features / Usability

Features / Usability


Custom module parameters

posts: 29


Using Tiki 14.0

I've created a simple custom module (MessageBox) to display messages to groups depending on permissions. This works well. What I also want to do is only show that module on certain pages based on the module's parameters. I can do this partially.

I want to show this module on my Welcome page, Wiki Home page, and only the "front" page of the section "forums".

This works (without forum)

nobox=y&page[]=Welcome&page[]=Wiki Home


But, if I add "&page[]=forums" (being it's the front "page" for the forum)

nobox=y&page[]=Welcome&page[]=Wiki Home&page[]=forums

no module is displayed on the forum. (I was hoping both section and page used the same name.)

That leads me to displaying a separate module using "section=forums" and add "&nopage[]=" for each forum

nobox=y&section=forums&nopage[]=forum5&nopage[]=forum7&nopage[]=forum8

which still shows that module on all forum pages.

In my testing, it seems mixing "section" and "page"/"nopage" parameters together doesn't work. Maybe I'm missing something here?

Is there way to show a custom module on just the "front" page of the forum section?

posts: 3579 United States

The nopage parameter works only for wiki pages, that's why things like nopage[]=forum8 won't work.

If you only want the module to appear on the "home" page of the forum, I think you're going to have to use a smarty expression to evaluate the specific Tiki template being used. For example:

{if $mid eq 'tiki-view_forum.tpl'}
{module module="NameOfModuleToDisplay"}
{/if}

 

This would display the module NameOfModuleToDislay only when Tiki displays the "home" page of a forum (such as https://tiki.org/tiki-view_forum.php?forumId=4) but not when display a post or thread (such as https://tiki.org/tiki-view_forum_thread.php?comments_parentId=57062).

Alternatively, you could customize the template TPL (tiki_view_forum.tpl) directly, and build a set of if statements.

HTH,

- Rick  |  My Tiki BlogMy Tiki UserPage

Why be a dummy? Get smarty! TikiForSmarties.com
Tiki for Smarties, your source for the best (and only) Tiki books, guides, and tutorials.

Why Register?

Register at tiki.org and you'll be able to use the account at any *.tiki.org site, thanks to the InterTiki feature. A valid email address is required to receive site notifications and occasional newsletters. You can opt out of these items at any time.