Closed (fixed)
Project:
Page Title
Version:
5.x-2.0-alpha4
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
28 Jan 2008 at 08:52 UTC
Updated:
5 Mar 2008 at 23:11 UTC
Jump to comment: Most recent file
i wanna throw in some tokens on those ol' content types, but nothing seems to be working.
for example, i've tried editing a content type's title as throwing "[title], [termpath-raw]"; however when the page loads, it's title is literally that, "[title], [termpath-raw]", without a token-replacement.
has tokens been integrated yet, or it a pending feature? if so, am I using the right tokens? (i'm grabbing them from the pathauto settings page).
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | globalredirect_node_patch.patch | 2.41 KB | nicholasthompson |
Comments
Comment #1
nicholasthompsonThat's exactly right. I wonder if this is a bug introduced by the "node as page and not teaser" check.
Comment #2
BarisW commentedSame here. Any updates yet?
Comment #3
nicholasthompsonI haven't had a chance to investigate this as yet - but I'm wondering if its related to this issue 211640...
Comment #4
icelink commentedI get the same thing when I try to use [term] or any other token in the default pattern. I'm not using cck.
Comment #5
niklp commentedNick, isn't this related to that issue we fixed with the hack before xmas in alpha 2?
I refer to the token substitution failing; we added a line of code to refresh all the tokens I think, somewhere around line 326.
This would be why you were thinking it's similar to http://drupal.org/node/211640 - it's the same place, but different code. Maybe the solution in 211640 is ok after all?
Either way, P_T doesn't work right now (with CCK/Token).
Nik
Edit: this was the working code; it still appears to function, albeit that you referred to it as a hack, previously. I'll test it against views and whatever, see if anything goes pop...
Comment #6
nicholasthompsonCan this patch please be reviewed (against the Page Title 2.x-dev branch) please?
If this is 'okayed' Then we will have a Page Title 2.0-alpha5.
Changes made in this patch:
1) Changed the 'page_title_page_get_title' function so that, instead of just getting the type for the node, it grabs the entire node. Then the token replace line is replaced with a check if the node is set. If not, it uses the global scope for tokens otherwise it uses the node scope and passes the node over. This SHOULD solve the lack of node-level tokens. I have tested this and can confirm tokens such as [author-name] and [term-name] are now working. My dev install doesn't have CCK or Views though, however I am about to test against those.
2) Non critical change, I added a 'preview' op to the nodeapi implementation. This causes the page title to appear on node-edit forms not just node-view.
3) Removed the page_title_get_type function as this was no longer needed due to the changes outlined in change (1).
Please let me know how this goes...
Comment #7
niklp commentedMy code fix in #5 hasn't blown anything up yet. Edit: your code fix, that I rescued from an old backup.
1) What the hell are you talking about?
2) "node just", LOLLERS.
3) see 1)
Cheers,
Nik
Comment #8
nicholasthompsonThis issue is all about Page Title not being aware of the node being viewed in terms of available tokens. This is because we only ever call token_replace in global mode, we never pass it the node. This patch solves this by passing the node if it is available and reverting to 'global' if the node is not available.
The solution of flushing the token cache and rebuilding it for our own needs is hackish and inefficient. Its far better to use whatever data has been statically cached in the module whenever we can than just flushing it because we're not using the token_replace function properly. In any case, your fix (as far as I can see) wont/shouldn't solve this problem as its still not passing the node over to token_replace.
Thanks for elegantly pointing out my typo. Its fixed now - sorry if it offended you ;-)
I dont think I can make that sentence any more idiot proof... There was a function that, due to changes described previously, was not being used anymore. I therefore removed it.
Comment #9
icelink commentedHi Nick,
I tested this patch on 2 sites, one with CCK and one without. It worked fine for me on both.
Thanks
Comment #10
nicholasthompsonThanks for testing icelink.
I shall commit this patch and release an Alpha5.
Comment #11
niklp commentedglobalredirect_node_patch.patch...? :) Well, I applied it to page_title and it seemed ok... ;)
However... on my install, I get the "better" page title only on node/*/edit, which doesn't seem like the desired outcome...
Pretty odd really. No change at all on /node/x
Comment #12
nicholasthompsonNo change on node/x?!
What you running (server versions, core version, modules (+version), etc)?
What did you patch against? alpha4 or dev?
Comment #13
nicholasthompsonAhh I get what you mean now NikLP... That was my mistake! I think I was doing some patch work for PT and GR and must have got muddled up in my head.
Comment #14
nicholasthompsonI'm marking this as fixed as I've just tested all that I can think of to reproduce the issue NikLP has had and I cant make it. I'm guessing that something went wrong with the patch (maybe a different version was patched?)...
I've just branched Page Title 2.0 - Alpha 5. Please test this and let me know what you think.
Comment #15
niklp commentedI've installed a fresh version of this, but I still have the same issue :( - I can only see the optimised title in the node/*/edit screen.
I haven't a clue what this is about, or how to debug it. Thoughts/ideas?
Comment #16
summit commentedSubscribing, very interested in this. Greetings, Martijn
Comment #17
doublejosh commentedI've had success using
[title] - [term-raw]But it only returns the first term.Issue created here...
http://drupal.org/node/224597
Comment #18
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.