It is extremely useful to be able to add placeholders to the Title.
For example: the user could set "my special title | %site_name" as the Title.
This patch adds: %page_title (although I prefer %node_title), %site_name, and %site_slogan.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | page_title.info_.patch | 424 bytes | jaydub |
| #8 | page_title.module_5.patch | 4.17 KB | jaydub |
| #1 | placeholders_50.patch | 1.74 KB | johnalbin |
| placeholders.patch | 1.77 KB | johnalbin |
Comments
Comment #1
johnalbinHere's the patch for 5.x-1.x-dev.
Comment #2
johnalbinSince creating this patch, I’ve since become aware of the Token module which, if page_title supported it, would allow users to use tokens (placeholders) from many different sources. And not just 3 tokens I have in my patch.
When I have time, I will look at Token integration. If anyone is going to try tackling it, please contact me and we can collaborate.
Comment #3
johnalbinThe above patch might be useful to some people as an interim solution, but it shouldn’t be incorporated in page_title.
Token integration is the way to go.
Comment #4
nicholasthompsonThat CERTAINLY looks a like an interesting option!
My only concern is that by integrating it with the Token Module means that this module is no longer a standalone. It has a dependancy of Token module. Now is you just want to control page title's but using node title then this turns Page_Title into quite a bloated install.
Made there should be a page_title_lite and a page_title_token as seperate projects?
Comment #5
johnalbinI was thinking that Token module support should be optional via the
module_exists()check. So that only people who need the functionality (many people, but not everyone) can optionally get it.Comment #6
nicholasthompsonAhhh cunning!
Comment #7
alliax commentedHi, at which stage are you with this feature? It's the most missing one regarding drupal and SEO, especially working with pathauto for the URL, we can have book path or vocabulary path, but then we don't have it in the page title, it's a pity.
Same could be said about the METATAGS module, it would greatly benefit from an integration with TOKEN module.
Comment #8
jaydub commentedI took a stab at integration Token in the attached patch.
Note that the patch includes a few other changes, mostly cosmetic, to the page_title module. Also I added a function in the API section to be able to set the page_title directly from another module (as is my need at the moment).
This is quick and dirty but seems to work for now. Please test out and let me know of issues.
Right now this just allows for setting of page titles for nodes based on Token patterns. Possible future updates could includes setting of taxonomy, etc.
Comment #9
jaydub commentedpage_title.info patch to add Token module dependency.
I would like to add that I looked at the autonodetitle module for help on how to use Token.
Comment #10
johnalbinComment #11
summit commentedHi,
Will this patch be submitted to 2.x-dev, or is it allready submitted?
Sorry, it is not clear to me.
Thanks in advance!
greetings,
Martijn
Comment #12
johnalbinJeff’s patch does the token replacement before inserting into the database (as the autonodetitle module does.)
I’m working on adding token integration that does the token replacement before the title is displayed, so that if a token’s value changes over time, the title will change. Also, I want the token integration to be optional, and not a required dependency.
My work isn’t complete, but will be incorporated into 5.x-2.x.
Comment #13
nicholasthompsonToken integration as of DRUPAL-5--2-0-ALPHA1 addresses this issue.
Comment #14
(not verified) commented