Posted by Jean-Philippe Fleury on February 27, 2009 at 5:51pm
Jump to:
| Project: | Page Title |
| Version: | 7.x-2.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
Say we set the page title pattern as this:
[page-title] | [term] | [vocab] | [site-name]
If there's no vocab/term for a given page, the page title will be generated as this:
My title | | | My site
There are 3 separators in a row. Page title module should have an option to clear no needed separators. For example, for the previous url, we would have:
My title | My site
Comments
#1
This is not a bug, but a feature request. I'd love to see something like this also, but I have no idea how the UI could look.
Clearly the 'Page Title' module must not remove separator characters like "|", "-", ":" (or whatever the user has chosen as separator, it might be even a text string) at it's own discretion; so probably it'd be necessary to segment the title into tokens and it's belonging-to separator characters, maybe with a syntax like
{[page-title] | }{[term] | }{[vocab] | }{[site-name]}(if{...}is empty, do not display), or a extended UI.Greetings, -asb
#2
+1
#3
Now THAT is a nice idea! Not sure what the overhead would be of breaking up a string and parsing each segment individually would be...
It could also be hard to detect...
{[page-title] and then} some other {[term:name]} text... if page-title was empty, the optional segment would not be empty (it'd be { and then}).I wonder if this would be a better suited feature request for Token. Then Token could do the replaces using a regex callback... Something like "if you find a token inside curly braces, pass the result into a function. This function returns blank if the replacement string for the token is empty, otherwise it does a normal string replacement on the token"...