I would like a token site:base-path which contains the value returned by base_path().
If approved, I will write a patch.
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | token-base_path_token-3094018-14-D8.patch | 837 bytes | liam morland |
| #13 | token-base_path_token-3094018-13.patch | 852 bytes | liam morland |
| #11 | token-base_path_token-3094018-11.patch | 472 bytes | bharath-kondeti |
| #9 | token-base_path_token-3094018-9.patch | 787 bytes | bharath-kondeti |
| #5 | drupal_7x-base-path-token-3094018-5.patch | 863 bytes | bharath-kondeti |
Comments
Comment #2
bharath-kondeti commentedI have created this patch for Drupal 7.67 version. Can you please test the patch
Comment #3
liam morlandThanks for the patch. I don't think check_plain() is needed. The return value of base_path() is always plain text.
The patch did not apply. It needs to be created using Git.
It is best to get it to pass on one test before queuing up any more.
Comment #4
bharath-kondeti commentedHi Liam, Thank you for response. I will work on the suggestions provided and resubmit a new patch.
Comment #5
bharath-kondeti commentedLiam, i have created the patch on comment#2 from git itself. But, i have created that patch on tokens module instead of Drupal core as mentioned in the Issue meta data. Even the log shows error: token.tokens.inc: No such file or directory.
Now, I have created a new patch file with changes made to drupal's core system module file.
Comment #6
longwaveWhat is this token useful for, as opposed to
site:url? Drupal 8 does not have this token and so it is very unlikely this will be added to Drupal 7 first.Comment #7
liam morlandThis is useful for making relative URLs in the site. This is often preferable to fully-qualified URLs.
Perhaps this should be moved to the token module queue, then the patch in #2 would work.
Comment #8
liam morlandComment #9
bharath-kondeti commentedLiam, I have made changes to patch on comment#2. I have removed check_plain(). I have added the changes in token module and uploading the new patch here. Can you please review the same.
Comment #10
liam morlandThanks for the patch. Replace
base_path funtionwithbase_path() function.We probably need a D8 version of this patch as well.
Comment #11
bharath-kondeti commentedI have made correction and uploading the patch.
I will work on the D8 patch as well. Can you please create a new issue for the same.
Comment #12
liam morlandThis needs to be the full patch. Drupal tests the patches individually against the current development version.
Thinking about it again, I think the description should be different. It should be meaningful to someone who doesn't know anything about the functions. It could be "The file path to the homepage of your site." Perhaps the description should call base_path() so that the user can see what they will be getting.
Comment #13
liam morlandComment #14
liam morlandD8 version.
Comment #15
lisotton commentedI tested #14 and is working fine.
Moving to RTBC.
Comment #16
berdirThere is an existing core issue for this for Drupal 8, use that: #1088112: Introduce a token to get site's base URL
Comment #17
liam morlandPatch for D7 in #13.