Loading...
 
Features / Usability

Features / Usability


Modules displayed in only some sections

posts: 113 Ireland

I am using 1.9 and am trying to make some modules visible only in certain sections.

For instance, I define a group that has access to a module MyModule. But I only want this module visible when the user is in the blog and article sections. When they are in the wiki or file galleries, I do not want it visible.

Any ideas how I can do this? Basically, I would like the module visible if I am in an object of a specific category, but not visible if I am not.

gg

posts: 1092

You will need some devs to do that.
Actually tiki-modules.php decodes which modules is displayed and it is called in tiki-setup.php that is usually called befcore any specific setting.
For a section, if you move the $section to the top of the php file ex: tiki-index.php before tiki-setup.php, you will be able to filter the value in tiki-modules.php (look at he language filter)
For category, it will be worst because as category nedd tiki-setup... Perhaps tiki-modules must be called at the end ...

posts: 113 Ireland

> You will need some devs to do that.
> Actually tiki-modules.php decodes which modules is displayed and it is called in tiki-setup.php that is usually called befcore any specific setting.
> For a section, if you move the $section to the top of the php file ex: tiki-index.php before tiki-setup.php, you will be able to filter the value in tiki-modules.php (look at he language filter)
> For category, it will be worst because as category nedd tiki-setup... Perhaps tiki-modules must be called at the end ...
>

Thanks, this is exactly what I was trying to get a grasp of. From an interface view, assigning a section to a module and having it control visibility follows the Group model of a module and is understandable. It is not intuitive to me to assign a category to a module to control visibility. But I just didn't think about sections as the filter.

gg


posts: 4656 Japan

> I am using 1.9 and am trying to make some modules visible only in certain sections.

One way to get this effect is to turn off the left or right column in certain sections, and have the turned-off column holding the modules you don't want to be shown in those sections. This is kind of all-or-nothing, but could work depending on how you allocate your modules to columns. (To do this, go to tiki-admin.php?page=features and, down at the bottom, put a check in the "Layout per section" box and click "Admin layout per section" to configure where your columns get turned off.)

-- Gary


posts: 113 Ireland

For the record, I implemented using categories (customer requirement). To avoid touching every tpl file, I added a function call in add_ticket() (which seems to be the only routine called at the bottom of every page before tiki.tpl).

I realize this is not the best approach, but I wanted a small footprint. I then wrote a couple functions in categlib.php to cull out the modules based on group.

So I let tiki-modules do the heavy lifting like normal, and just remove the modules assigned to a category that is not in the current category right before display.

gg