Probably it crossed your mind, being also the author of the Token Field module.
I use Add To Head for the Open Graph tags to control the output that goes to Facebook when people hit the FB Like button. Having tokens available would allow things like:
<meta property="og:image" content="[field_image]"/>
No idea if this is feasible. I am aware there are specialized modules trying to cover about the same functionality in this moment (Open Graph meta tags and Nodewords), but your module has a much smaller footprint AND offers also other features.
Thanks for a great module. One with many flexible possibilities for any creative mind, reducing the number of needed "specialized" modules on any Drupal website.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | Screenshot from 2016-10-27 17:33:23.png | 175.55 KB | lolandese |
| #8 | Edit Profile Drupal standard.jpeg | 42.37 KB | lolandese |
| #7 | token_support-1148898.patch | 1.11 KB | gopisathya |
Comments
Comment #1
mherchel+1 on this
Comment #2
nicholasthompsonThis is a very good idea and wouldn't add a LOT of weight to the page.
The difficulty, as with Page Title, is knowing the context of the page (is it a Node, User, Term, etc).
Marking as a Major feature request.
Comment #3
darvanen+1, this would be very useful even if we only knew generic site information and/or path data. In my case I just want to use the page title.
Comment #4
lolandese commentedComment #5
lolandese commentedMaybe the solution used in Code per Node contains some useful code to re-use here. See #1658932: How to use tokens in code.
Comment #6
gopisathya commentedThe support may be added with following in add_to_head.module
Comment #7
gopisathya commentedAttaching a patch for general support to add token in code textarea field. Ofcourse it needs token module to work. Not tested with "Page Title" module.
Comment #8
lolandese commentedTested using the current page title with:
http://simplytest.me/project/add_to_head/7.x-1.x?patch[]=https://www.dru...
Looks good to me. See attached screenshots.
Comment #9
lolandese commentedUnfortunately a node token is not working, like on the Article content type:
<meta property="og:image" content="[node:field_image]"/>Only those mentioned in the token tree are available. Next step would be to add those independently from the context we are in. It would mean of course that with the paths setting in the Add To Head configuration the tag should be avoided for pages the node would not apply on.
Comment #10
webservant316 commentedI was looking into this module as a means to add the JSON-LD construct for schema support on my web pages. The schemaorg and schema_meta modules could be used to provide this support, BUT they attempt to provide form based assignment of all the schema properties which is cumbersome and only partially supported due to the extensive schema definitions. Also those modules provide only limited conditions for the assignment of particular schema, namely the content type.
However, this module could do the job in a most excellent way with a few additions. First if we can get this patch working to provide token support that would be great. Since this is kinda a no guard rails approach for system administrators the token feature could simply show a warning message to administrators when the requested token is not available.
The second feature that would be very useful to this module is to allow the administrator to choose conditions for the injection of the code into head. I propose the following conditions in addition to path... 1) nid, 2) flag, 3) taxonomy, and 4) node type. I will create a new feature request for this.