Needs work
Project:
Metatag
Version:
7.x-1.x-dev
Component:
Views integration
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
31 Jul 2014 at 00:35 UTC
Updated:
3 Jun 2016 at 02:00 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
damienmckennaCan you please confirm which exact token you were using?
Comment #2
herd45 commentedThe behavior described above is true for all of these tokens.
[current-page:url:args:first]
[current-page:url:args:last]
[view:url:args]
[current-page:url:args]
I should also mention that the token browser for this module does not list all of the argument tokens. The attached pic has a full list.
Comment #3
drunken monkeyThis would be rather hard to fix in this form, especially in this module, I think. If anything, this should be fixed in the Views module: when resolving a token for
[view:url:*], and arguments are set, the arguments could automatically be substituted for their corresponding path parts.However, this would significantly complicate the code, and probably also not be in the itnerest of everyone using these tokens, so I don't think such a patch would have a chance to be committed.
What would be possible, however, is just letting the admin use the special Views-style pseudo-tokens for arguments (i.e.,
%1/!1,%2/!2, etc.) to achieve exactly the effect you want – including the argument values (with their original spaces) in the Metatags.A patch is attached, I opted to use
hook_metatag_pattern_alter()to implement this – it could of course also just be added tometatag_views_page_alter()with a loop, but I guessed this would be too inflexible? Or would the performance improvement be worth it?Also, this could of course be made optional per view, if you want that. And maybe we should add this to the description somewhere.
But in principle the code works, at least for me.
Comment #5
damienmckennaRerolled.
Comment #6
damienmckennaSo yeah, we need a per-View option for this.