Edgewall Software

Opened 14 years ago

Closed 7 years ago

Last modified 4 years ago

#9487 closed enhancement (fixed)

Control the default wiki page through trac.ini — at Version 6

Reported by: a-h Owned by: Ryan J Ollos
Priority: normal Milestone: 1.3.2
Component: wiki system Version: 0.12
Severity: normal Keywords:
Cc: Branch:
Release Notes:

Extracted variables in WikiModule for the start page and title index page, so they can be overridden by a plugin.

API Changes:
Internal Changes:

Description (last modified by Remy Blank)

Hello,

Here's a way to change the default wiki page:

  • web_ui.

    old new  
    107107
    108108    def process_request(self, req):
    109109        action = req.args.get('action', 'view')
    110         pagename = req.args.get('page', 'WikiStart')
     110        pagename = req.args.get('page',
     111                                self.env.config['wiki'].get('default_page')
     112                                    or 'WikiStart')
    111113        version = req.args.get('version')
    112114        old_version = req.args.get('old_version')

Change History (6)

comment:1 by Remy Blank, 14 years ago

Description: modified (diff)
Milestone: unscheduled

Unfortunately, it's not quite that simple. The name "WikiStart" is hard-coded at various locations, e.g. for re-directing after deleting a page. I think there was even a more complete patch for this, but my search-fu seems to be severely lacking lately. I thought it was part of #1106, but no luck.

comment:2 by Peter Suter, 7 years ago

Possible duplicate of #5319.

comment:3 by Peter Suter, 7 years ago

And #10595 which has an attached patch.

comment:4 by Ryan J Ollos, 7 years ago

Closed #10595 as a duplicate. This ticket, if implemented, can also make customizable the location pointed to be TitleIndex.

comment:5 by Ryan J Ollos, 7 years ago

Milestone: unscheduled1.3.2
Owner: set to Ryan J Ollos
Status: newassigned

Since this is probably rarely customized, we could just extract variables like we did for default_tracker (comment:1:ticket:10898): [98dd2d30/rjollos.git].

# -*- coding: utf-8 -*-

from trac.wiki import web_ui


web_ui.WikiModule.START_PAGE = 'Trac/WikiStart'
web_ui.WikiModule.TITLE_INDEX = 'Trac/TitleIndex'

comment:6 by Ryan J Ollos, 7 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Committed to trunk in r15818.

Note: See TracTickets for help on using tickets.