Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Currently using path: etc. is limiting. If I want to add a flash video I can't use path: as it doesn't include a src or href tag. I would suggest using &path& as it won't be used as often and it is how the token module handles tokens. If someone wants to add &path& and not have it replaced they can use &path&
Hopefully patch to follow soon.
Comment | File | Size | Author |
---|---|---|---|
#9 | token_replacement_3.patch | 4.34 KB | redndahead |
#7 | token_replacement_2.patch | 4.68 KB | redndahead |
#7 | double_amp.patch | 4.78 KB | redndahead |
#5 | token_replacement.patch | 4.74 KB | redndahead |
Comments
Comment #1
redndahead CreditAttribution: redndahead commentedIt should say "If someone wants to add &path& and not have it replaced they can use
&path&
"Comment #2
redndahead CreditAttribution: redndahead commentedI would prefer the paths to change in advanced help, but in case someone wants a little hack to get that path in their help files using js here is what I use:
Comment #3
redndahead CreditAttribution: redndahead commentedWill be submitting the patch shortly. Just wondering if you would like the using-advanced-help.html file to only use the &path:&, have instructions for both ways or use &path:& but say something about the path: being the old way of doing things?
Also would you like me to update the current advanced_help help files to reflect this new syntax?
Comment #4
merlinofchaos CreditAttribution: merlinofchaos commentedIt should document both and mention path: as being the 'old' way of doing things.
Comment #5
redndahead CreditAttribution: redndahead commentedHere is the patch. Pretty straightforward mainly needs a review on the language of the help topic on using tokens.
Comment #6
merlinofchaos CreditAttribution: merlinofchaos commentedHn,mmm. The way this is implemented worries me. & is a legal character in a URI and you did &path:foo& rather than &path& foo like I was expecting. Does that break if & is part of the URL?
Comment #7
redndahead CreditAttribution: redndahead commentedHmm thought I replied to this already. It definitely does. Made the change, it should now be:
&path&myfile.jpg
&base_url&myfile.jpg
&topic:module/topic&
The module name and topic would not be allowed to have an & in them. Is this even allowed? If this is going to cause a problem maybe we can do:
&&path:foo&&
&&base_url:foo&&
&&topic:module/topic&&
Preference? Both patches are attached.
Comment #8
merlinofchaos CreditAttribution: merlinofchaos commented& is not valid in a module name and we can arbitrarily say it's not valid in a topic name. This looks better, I'll go with this later this week. Thanks!
Comment #9
redndahead CreditAttribution: redndahead commentedThe previous patch had a missing .'/' in the path url. This one corrects that and adds some cleanup.
Comment #10
merlinofchaos CreditAttribution: merlinofchaos commentedFinally committed. Thanks!
Comment #11
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.