Opened 16 years ago

Closed 9 years ago

#81 closed enhancement (wontfix)

Make "Category" and "Locale" prefixes in autogenerated nodes optional or customisable

Reported by: grimoire Owned by:
Priority: normal Milestone:
Component: openguides Version: svn
Severity: normal Keywords: templates utils indexes
Cc:

Description

I believe that having "Category" and "Locale" prefixed to the name of a node is redundant and counterintuitive for users. A node is a category if it is in category Category, and a locale if it is in category Locale. Also, my Guide is becoming full of redirects from Locale Foo to Foo, and Category Bar to Bar (and occasionally from both Locale Foo and Category Foo to Foo).

Several places in the OpenGuides code seem to require that locales and categories have node names prefixed with this information, so it's easier said than done, sadly.

Attachments (2)

ticket_81.patch (15.0 KB) - added by grimoire 16 years ago.
Patch against [735] for customisable locale / category prefixes
sniplocales.pl (2.9 KB) - added by grimoire 15 years ago.
Script to rename "Locale Foo" to "Foo" and set up redirects. Probably only works with pre-W::T versions of OpenGuides.

Download all attachments as: .zip

Change History (15)

comment:1 Changed 16 years ago by grimoire

In OpenGuides.pm, it is assumed that a node is either a category (i.e. its name begins with "Category") or a Locale (i.e. its name begins with "Locale"). It uses this to generate some template variables which, by default, change the node title link if backlinks_in_titles is enabled. If this ticket is resolved, nodes can be both categories and locales, so this behaviour needs to be altered or worked around somehow.

comment:2 Changed 16 years ago by grimoire

It's also worth noting that the @INDEX_LINK macro provided by OpenGuides::Utils breaks if a locale or category node doesn't start with "Locale " or "Category ". I suspect a *better* way to do this is not to use the macro, but instead to generate TT variables if the node is a category or locale and generate the index link there. This will of course bugger up existing guide content.

comment:3 Changed 16 years ago by grimoire

Note that you can't have a prefix without a space - Config::Tiny seems to chop trailing spaces, so I'm automatically inserting one if a prefix variable is set.

comment:4 Changed 16 years ago by grimoire

On reflection, I've replaced the @INDEX_LINK macro with a @LOCALE_LINK and @CATEGORY_LINK.

comment:5 Changed 16 years ago by grimoire

Owner: changed from Dominic Hargreaves to grimoire
Version: 0.51svn

Right, I think I'm about done with this, nearly ready to append a .patch file for my changes. It's worth noting that changing the prefixes on an existing guide will be moderately painful - you'll need to rename all the nodes in category "Category" and/or "Locale", from their fixed prefix to your custom one, and renaming nodes is currently painful. The proposed CGI::Wiki database refactoring will make this easier, I guess.

comment:6 Changed 16 years ago by Earle Martin

See also #52.

Changed 16 years ago by grimoire

Attachment: ticket_81.patch added

Patch against [735] for customisable locale / category prefixes

comment:7 Changed 16 years ago by Dominic Hargreaves

Milestone: 0.53

comment:8 Changed 15 years ago by Dominic Hargreaves

Milestone: 0.530.54

I'm leaving this until 0.54 when we will have refactored Wiki::Toolkit.

comment:9 Changed 15 years ago by Earle Martin

Keywords: templates utils indexes added

The patch supplied (thanks Dave) leaves the existing prefixes in as default. I think they should default to empty, as the prefixes are getting on for 4 years old as a UseMod legacy holdover. Deprecate, deprecate!

Before this is released, we should have a run-once script that moves all content and metadata from name-prefixed nodes into non-prefixed versions and replaces the old ones with redirects.

comment:10 Changed 15 years ago by grimoire

earle, are you suggesting that the patch should just remove name prefixes for nodes or should default to having none?

I had such a script lying around, I will try to unearth and revive it.

Changed 15 years ago by grimoire

Attachment: sniplocales.pl added

Script to rename "Locale Foo" to "Foo" and set up redirects. Probably only works with pre-W::T versions of OpenGuides.

comment:11 Changed 15 years ago by Dominic Hargreaves

Milestone: 0.58
Owner: changed from grimoire to Earle Martin

Earle, you seemed to be interested in this one during discussions in the hackfest; assigning to you for now.

comment:12 Changed 13 years ago by Earle Martin

Owner: Earle Martin deleted

comment:13 Changed 9 years ago by bob

Resolution: wontfix
Status: newclosed

after 5 years no one obviously cares. kake agrees this should be wontfix

Note: See TracTickets for help on using tickets.