Closed (fixed)
Project:
EVA: Entity Views Attachment
Version:
7.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
29 Jul 2011 at 01:55 UTC
Updated:
26 Oct 2015 at 11:38 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
a.ross commentedI have found this list of tokens. I hope my find will help others.
Anyway, my request still stands. A simple instruction would do for now, I can do the patch for that.
Eventually it would be great though, if some rules-type token selection was written for this module.
Comment #2
simon georges commentedCross-referencing #1149410: How to use tokens in argument list.
Comment #3
a.ross commentedThe admin/help/token page is more user friendly and shows every token that is available on your site.
Comment #4
bleen commented+1
Comment #5
robeano commentedWhen you enable the token module and the devel module, you can see the available tokens for a node by clicking the Devel tab, then the Tokens local task (below the tabs).
When you implement these tokens, you need to copy the whole token for example [node:title]. Now, edit your View:
* go to Admin -> Structure -> Views
* click Edit for your view
* click the Entity Content display you have created
* click the Arguments value (this link is labeled 'ID', 'none' or 'Token') in the Entity content settings section (it's in the middle column in the view's configuration)
* If you want tokens, then select either:
* Use the ID of the entity the view is attached to (select this option if you want the ID to be a filter on the view)
OR
* Use tokens from the entity the view is attached to (use this when you want tokens but no filtering by the ID)
* Now you can paste that token into the text field below those radio buttons
* click Apply
* If you haven't done so already, you need to add Context to your view so it can take the token and apply it to the view to filter the results.
* Save your view
Things to watch out for: Don't add Filters -> add Context to your view in order to use tokens via eva.
Comment #6
joachim commentedMissing documentation is a bug.
At the very least a link to online docs at http://drupal.org/node/390482#drupal7tokenslist would help show people what to do here.
Comment #7
zambrey commentedHere's the patch that displays list of available tokens for selected entity.
Token module must be enabled in order to make it happen.
Please test & mark as RTBC when everything is working as advertised.
Comment #8
joachim commentedI've cleaned the patch up a bit -- code style and there were a couple of unrelated changes.
Comment #9
7wonders commentedpatch applied nicely and functioning properly
Comment #10
joachim commentedThat sounds like an RTBC to me. Thanks for testing! :D
Comment #11
dave reidWhy is this necessary? The theme_token_tree() should automatically include this?
These two variables are the default values. They are redundant and uncessary.
Comment #12
zambrey commentedThanks for review Joachim and Dave!
@joachim yeah, I forgot to mention that I did few minor unrelated tweaks to code.
Thanks for fixing comments, I'm not good at that.
@Dave I also thought that it will be included automatically but seems that these libraries must be loaded before you enter plugin configuration page which is loaded by ajax callback. You can try to visit that page without this fragment and see what happens. I'm not expert in JS so maybe there is another way to force libraries to load without this condition.
In any case, here's another patch without default values pointed in #11.
Comment #13
pasqualledrupal_add_css() and drupal_add_js() does not work with ajax load..
Comment #14
rwilson0429 commented@robeano, #5: Support is 'good to know' and very good step-by-step documentation. It was especially helpful tip that we shouldn't add filters but, use context instead. That makes sense. Thank you, robeano.
Comment #15
valderama commentedfor people who are currently struggling with how to pass tokens as arguments this page might be helpful also:
http://drupal.org/node/1299662
If you need to pass the term_id of a taxonomy reference field, you can specify a token like this [node:field_mytermref], and on the manage display page you need to modify the token view_mode and tell the reference field to output the term_id - you need a custom formatter for that, either you code own or you use this module http://drupal.org/project/custom_formatters
hth!
Comment #16
akamaus commentedI've been struggling with passing two token arguments to eva display. After applying patch #12 problem solved instantly. It's a real time saver! Hope to see it merged soon.
Comment #17
mkadin commentedLooks good, super helpful. Committed to the dev branch, look out for a new release soon.
Comment #18
aaronbaumanOn sites with a substantial number of available tokens, this new feature freezes the browser completely.
Can we implement the new token modal support?
#1684984: Support opening token browser in a jQuery UI dialog on demand
Comment #19
mkadin commentedI'm glad to see that the token people have worked on a solution to this. I HATE visiting the node type edit page because it takes 30 seconds to load.
That being said, this dialog rests on top of the views modal which rests on top of the overlay...the UI is tough.
Can we think of any way to make this less ugly? I'd rather have a functional token option and an ugly UI than a non functioning token option.
If you have so many tokens that the browser crashes, does not do it with the new dialog? Or does the dialog allow you to avoid rendering the token tree (by not clicking on the link)? If its the latter, maybe we can pull the tree in via ajax within the existing modal instead of using the dialog.
Comment #20
joachim commented> On sites with a substantial number of available tokens, this new feature freezes the browser completely.
For me it freezes JS, and Firefox then asks me whether to stop the script. If I do, then make changes and try to save the options, I'm taken to a page of AJAX source.
Tried the patch. Opening the token modal still gets me a Firefox 'stop script' popup.
Clicking a token (once the list appears) gets me an alert 'First click a text field to insert your tokens into.' which I can't do because I'm in a modal with just the tokens.
It's at least an improvement in that if you don't use tokens, your view doesn't crash :)
Comment #21
mkadin commentedWhat do we think of this? This replaces the tree with a link that pulls the tree in via ajax.
Need at least one person to test this bad boy out, I want to make sure:
1) on a site with a crazy number of tokens, you can still access this setting (as long as you don't click the ajax link).
2) On a site with a normal amount of tokens, the tree is successfully pulled in.
Comment #22
simon georges commentedWhy not use the new (since Token 7.1) theme function of the Token module, allowing something similar (see #1684984: Support opening token browser in a jQuery UI dialog on demand)?
Comment #23
mkadin commentedThat was proposed and discussed in 18 and 19 above...the query UI dialog doesn't work well over the existing views UI dialog.
Comment #24
simon georges commentedHum... sorry about that. Sure. Maybe in D8 ;-)
Comment #25
dave reidI don't understand how #21 is any better or maintainable than supporting the dialog option in Token.
Comment #26
mkadin commentedIt was purely a UI thing. Its funky to deal with a jQuery UI dialog over a ctools modal popup on top of the overlay module. Also, clicking on the tokens in the UI dialog makes the ctools modal window do some strange things (like resize?) I've attached screenshots of the two.
Also attached is a reroll of the patch that actually applies cleanly to the latest dev.
Comment #27
rcodinaThis is done on 7.x-1.2 which I'm using. So issue closed.