Loading...
 
Skip to main content

Custom Share Module 0.1dev

Features / Usability

Features / Usability


View Category Contents

posts: 53 Australia

Hi,

Just wondering if there is a simple way for anonymous users to see the contents of a category?

Basically, I'm trying to create some HTML/CSS buttons on the home page which, when clicked, display all wiki pages and blog posts in a particular category.

I've tried using URLs like /tiki-admin_categories.php?parentId=10, but this doesn't work without a login. Even if permissions were changed, it wouldn't look too good.

I've tried putting the listpages plugin on an empty wiki page, but it won't show blog entries. I've tried the categories plugin, but it's a bit ugly (could it be formatted like listpages?).


Any suggestions?

posts: 53 Australia

I found the solution to this.

1. Add tiki_p_view_category permission to anonymous
2. Copy tiki-browse_categories.php to tiki-browse_custom.php
2a. Edit the copied file and change lines containing tiki-browse_categories.tpl to tiki-browse_custom.tpl
3. Copy /templates/tiki-browse_categories.tpl to /templates/tiki-browse_custom.tpl
4. Edit the custom template as required to remove the unwanted features on the screen

I would be nice to do this without having to add the tiki_p_view_category permission to anonymous (as I'm not sure what else that will change), but I haven't not found a way to bypass it yet. I presume there's a check in the php file for this, but so far I haven't been able to make it work.

Hope this helps someone else in future.


posts: 3665 United States

There's no need to edit TPL or PHP files (you're making a maintenance nightmare for yourself). Simply use the CATEGORY plugin. Please see the docs for details.

Obviously, the user must have permissions to view category objects and to view the specific category.

HTH,

- Rick | My Tiki Blog | My 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.
posts: 53 Australia

Thanks for your feedback, I really do appreciate it.

I did have a look at the category plugin, but it wasn't quite what I wanted.

I realise that there is additional maintenance when I upgrade to a later version, but in this case I don't mind too much, as it's only small changes I've made, and I've documented them well.

Tiki is not known for friendly upgrades anyway, regardless of customisation 😊