Closed (fixed)
Project:
Meta tags quick
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
6 Apr 2011 at 20:36 UTC
Updated:
31 May 2011 at 17:01 UTC
Jump to comment: Most recent file
For example, if I edit a 'description' meta tag for a node that is promoted to the front page, and then view the source code of my frontpage, I see the description of the individual node, which is wrong. The code should be using the formatter to output the meta tag and not use hook_entity_load() which can be called at any time on an entity whether it is being viewed or not.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | tags_on_page_load-1118722.patch | 2.01 KB | valthebald |
| #3 | metatags_quick-make_metatags_configurable_add_rules_action-1118722-3.patch | 3.47 KB | das-peter |
Comments
Comment #1
valthebaldYou're right, yet without global configuration page (#1100570: Add configuration page with global keywords) it's the only way to change meta tags on the default front page. These changes would be done in one iteration
Comment #2
valthebaldCan't be done without hook_entity_view called by taxonomy_term_page() (see issue #1067120: Missing hook_taxonomy_term_view() or hook_entity_view() when viewing a term)
Comment #3
das-peter commentedEven if this report is postponed - I'll continue here.
Since I use panels and views to create mashup sites from several entities it's not possible to define which meta tags have to be used.
Thus I've added a instance configuration setting to the field which allows to exclude a field content from being set on
entity_load.Besides that I changed the implementation of
hook_field_formatter_view()to add the meta tags but not to display the content as link. (Any need for these links? Related #1124328: Field labels printed at bottom of page when Link module enabled)With this approach it's also possible to define the output for each available display mode.
And in panels you can just add the fields as you like to the content to set the meta tags.
Another thing I added is a rules integration which allows you to set meta tags based on rules. With this integration it's possible to set meta tags even on entity unrelated pages.
Comment #4
valthebaldHi das-peter,
your patch answers #1124328: Field labels printed at bottom of page when Link module enabled, which is of course not postponed and has to be addressed.
Actually, I was going to fix it without adding new setting to instance, just output nothing on formatter_view.
Do you think there are use cases which need actual output of meta tags to HTML?
Comment #5
valthebaldActually, #1124328: Field labels printed at bottom of page when Link module enabled was not solved by the patch.
I need some more time to understand what happens.
Comment #6
valthebaldI've committed metatags_quick.rules.inc found in your patch without any change, yet replaced formatter handling to work with the link module.
Please do not comment on this patch here, because it is not related to hook_entity_load issue
Comment #7
andypostProbably better to check that entity is viewed as page by analizing
Not sure about views pages but I think this could be solved in separate issue
Comment #8
valthebaldThat won't work if site does not use path module or multiple URL aliases exist for the same path
Comment #9
Linus commentedAny news on this? At the moment the module is quite useless for sites with views and panels.
The results on my site are really weird.
On some nodes I see the meta-tags from the related taxonomy term, on other nodes I see meta-tags from content loaded via views.
On one page i even see meta-tags from a node that is just referenced in a reference field from another node, which is loaded in a view...
Comment #10
valthebaldDue to the still missing call to hook_entity_view on entity page view handlers, I can't move this to hook_entity_view.
Attached patch implements different approach:
instead of direct adding meta tags to HTML head, they are collected to internal storage, and outputted during page build (hook_page_build). Meta is output only if belongs to active object (or there is no active object at all)
#9 - there is suggested (but not yet implemented) solution for the path-based meta tags at #1146018: Meta tags based on path, please check
Comment #11
Bronislovas commentedPatch is really working! Thanks
Comment #12
valthebald