Inherit category from page from which new page is created
- Status
- Closed
- Subject
- Inherit category from page from which new page is created
- Version
- 1.9.x
2.x - Category
- Feature request
- Feature
- Wiki (page view, edit, history, rename, etc)
- Submitted by
- Nelson Ko
- Volunteered to solve
- Nelson Ko
- Lastmod by
- Nelson Ko
- Rating
- Description
When a user creates a new page from an existing page (either through the Create Page module or by clicking on a "?"), categories could be inherited.
The problem is that this is not necessarily behaviour required for all TIki installs, and might have to be coded as admin configurable.
- Solution
One quick way that will not affect other Tiki code is just to add the following lines to tiki-editpage.php. The effect of this may or may not be what is required. Need comments if this is should be added to core.
Copy to clipboardif ($feature_categories == 'y' && isset($_SERVER['HTTP_REFERER']) && (strstr($_SERVER['HTTP_REFERER'], 'tiki-index.php') ) { // default the categs the page you come from for a new page if (preg_match('/page=([^\&]+)/', $_SERVER['HTTP_REFERER'], $ms)) $p = urldecode($ms[1]); elseif (preg_match('/page_ref_id=([0-9]+)/', $_SERVER['HTTP_REFERER'], $ms)) { $pinfo = $structlib->s_get_page_info($ms[1]); $p = $pinfo["pageName"]; } else $p = $wikilib->get_default_wiki_page(); $cs = $categlib->get_object_categories('wiki page', $p); for ($i = count($categories) - 1; $i >= 0; --$i) { if (in_array($categories[$i]['categId'], $cs)) { $categories[$i]['incat'] = 'y'; $catpresetname = $categories[$i]['name']; $catpreset = true; $presettype = 'wiki page'; } } }- Importance
- 3
- Priority
- 15
- Demonstrate Bug on Tiki 19+
-
This bug has been demonstrated on show2.tiki.org
Please demonstrate your bug on show2.tiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show2.tiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Demonstrate Bug (older Tiki versions)
-
This bug has been demonstrated on show.tikiwiki.org
Please demonstrate your bug on show.tikiwiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show.tikiwiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Ticket ID
- 1086
- Created
- Wednesday 02 May, 2007 11:40:24 UTC
by Unknown - LastModif
- Sunday 20 October, 2013 22:29:02 UTC