Ticket #81 (new enhancement)

Opened 5 years ago

Last modified 2 years ago

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

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

Change History

Changed 5 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.

Changed 5 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.

Changed 5 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.

Changed 5 years ago by grimoire

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

Changed 5 years ago by grimoire

  • owner changed from dom to grimoire
  • version changed from 0.51 to svn

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.

Changed 5 years ago by earle

See also #52.

Changed 5 years ago by grimoire

Patch against [735] for customisable locale / category prefixes

Changed 4 years ago by dom

  • milestone set to 0.53

Changed 4 years ago by dom

  • milestone changed from 0.53 to 0.54

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

Changed 4 years ago by earle

  • 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.

Changed 4 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 4 years ago by grimoire

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

Changed 4 years ago by dom

  • owner changed from grimoire to earle
  • milestone 0.58 deleted

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

Changed 2 years ago by earle

  • owner earle deleted
Note: See TracTickets for help on using tickets.