Multiple wiki pages

Wiki Articles

We will see here how to create a second wiki page for a certain category (or several categories if needed) : 

1) You have to create a new .php file for each category (group) that you need a page for, by cloning the woffice/page-templates/wiki.php file.

As “wiki-group-1” for instance and replace the template name writing something like “Wiki group 1”, “Wiki group 2”

2) Search for the string:

$wiki_display = new Woffice_Wiki_Display_Manager(0);

And replace the 0 with the id of the wiki that you want to display in this new template.

If you want to add more categories on a certain page, you can pass the IDs as an array, like this:

$wiki_display = new Woffice_Wiki_Display_Manager( array(1,2,3) );

3) Create the page in WordPress:

Once saved, you’ll see a new page template in your page’s template box: 

Categories in editing and creation

NOTE: This is possible from Woffice version 1.8.1

If you stop now the customization, when an user try to ceate a new category or edit a current one, he will always be able to select EVERY wiki category of your site, also categories of another wiki group (another parent).

It would make sense if you wanted to avoid this – if so, you have to open again the .php files you have created for every wiki group (the different templates).

In these, search for:

<?php Woffice_Frontend::frontend_render('wiki',$process_result); ?>

And add the id of the category in this way:

<?php Woffice_Frontend::frontend_render('wiki',$process_result, 10); ?>

You can get the id of the wiki categories here:

Repeat this for each new wiki template you have created.

After, open the file taxonomy-wiki-category.php, and search for:

$wiki_display = new Woffice_Wiki_Display_Manager(0);

And replace with:

$wiki_display = new Woffice_Wiki_Display_Manager(YOUR_CATEGORY_ID);

All done (thumbs up).

If you have any question or if you need help, just open a new ticket.

Leave a Reply

Your email address will not be published. Required fields are marked *