Loading...
 
Skip to main content

Custom Share Module 0.1dev

Features / Usability

Features / Usability


Display Module within one Category?

posts: 38 United States

Hi,

Is there a way to display a module within a specific category? For example, I've manually created a PHPLayers menu module matching the category structure. (I hadn't seen the automatic category menu creation module, but apparently it's not ready for production use yet, anyway.) For ease of navigation, I'd like to include this module in the left column, but only when the user is actually in that category. Is there a way to do that?

Thanks,

edalton

posts: 113 Ireland



I have implemented this on one of my sites but did not push back to the main source. The reason is that there are a couple different ways to do it, and I chose one that I don't think others would necessarily agree with. My technique was to allow the module list get created as normal, but right before displaying, I cull the list based on the category. If the module is associated with a category, then if the page is associated with the same category, display it. Otherwise remove it from the list. If the module is not associated with a category, keep in the list.

To do this I put a call in the ticketlib (the only place I could find that all pages go thru after the module list is created and the categories are known). This is clearly a hack, but I couldn't find another place to change without a big foot print. If you are interested in the changes, I can supply them.

If people think that this is an acceptable solution, I can update. But I didn't think people would like the ticketlib hack.

gg

posts: 38 United States


> If you are interested in the changes, I can supply them.

I'd be interested, especially if there are no other suggestions. Do you have it in the form of a diff patch? I'm new to PHP (though I've been coding in Perl and other stricter languages for a while). A diff patch would help, but if not, I can probably figure out what to do with your changes.

It would be nice to get some comments on your code or other approaches to this utility.

Thanks,

edalton


posts: 113 Ireland

> Hi,
>
> Is there a way to display a module within a specific category? For example, I've manually created a PHPLayers menu module matching the category structure. (I hadn't seen the automatic category menu creation module, but apparently it's not ready for production use yet, anyway.) For ease of navigation, I'd like to include this module in the left column, but only when the user is actually in that category. Is there a way to do that?
>
> Thanks,
>
> edalton

If you give me an email address to send the files, I will. The following files were touched

lib/categories/categlib.php
lib/tikiticketlib.php
tiki-admin_categories.php
templates/tiki-admin_categories.tpl

The first two were to provide the php code, the last two were to expose module to category assignments.

I don't have a patch file, but I do have a diff -Naurb that will probably do as well.

Your tw account does not allow messages. You can send me a message at rainbowbuilder (at) garygriffin (dot) net


Upcoming Events

1)  18 Jul 2024 14:00 GMT-0000
Tiki Roundtable Meeting
2)  15 Aug 2024 14:00 GMT-0000
Tiki Roundtable Meeting
3)  19 Sep 2024 14:00 GMT-0000
Tiki Roundtable Meeting
4) 
Tiki birthday
5)  17 Oct 2024 14:00 GMT-0000
Tiki Roundtable Meeting
6)  21 Nov 2024 14:00 GMT-0000
Tiki Roundtable Meeting
7)  19 Dec 2024 14:00 GMT-0000
Tiki Roundtable Meeting