Now that the Token module provides an awesome popup dialog to show the available tokens, it'd be useful if there was a way to replace all use of the core token browser with this new one.

CommentFileSizeAuthor
#2 menu-collapsed.png105 bytesSk8erPeter

Comments

dave reid’s picture

Project: Token » Token tweaks

I would prefer this goes in Token tweaks since Token itself is an API.

Sk8erPeter’s picture

StatusFileSize
new105 bytes

@Dave Reid: this is true, but I personally think Token itself should rather provide an option to display tokens provided by all the other modules on-demand, loaded via AJAX: the main categories of the replacement patterns could be displayed when editing field settings, but when clicking on the "expand" arrow (like this: collapsed or this one: collapsed), the subcategories could be loaded. (OK, this could also be done in a jQuery UI Dialog, the final solution matters less.)

I understand that Token module itself is an API, that's OK, but one of its main tasks is also to display the available tokens - so this should be done the right way: without loading enormous amount of data per every request (like I mentioned here, with multiple modules enabled this can also be more than 15 MBs per request!).

Thanks anyway!

dave reid’s picture

Well I just fundamentally disagree.

puddyglum’s picture

For our sites it makes me feel much more comfortable having this global option within Token tweaks rather than Token due to the wide range of modules that use the Token list.

Sk8erPeter’s picture

@Dave Reid: OK, but could you please elaborate on this a little bit more?
Let's take an example: someone, who enjoys using modules, clicking and setting up things on his/her Drupal site, but doesn't really know what's behind the scenes, installs Token, because a module's dependency is this one. He/she enabled multiple modules, and suddenly he/she doesn't know why, but the server ran out of memory (when trying to reach the settings page). What could have happened? The user starts to disable and uninstall modules, until he/she gets lucky, and finds out that disabling Token module solved the problem... or NOT. Then he/she starts writing to forums, OR finally finds your module, and maybe gets happy. Other users can continue to having to inspect what the source of the problem is.
It took me some time to realize that Token module is to blame when having out-of-memory errors, because it generates ridiculously huge amount of data at once per request without external modules... I realized that when the problem was burning.
I had to inspect the source of the problem, and I had to spend annoyingly too much time with it, while I could have also used this time to develop. I already have some developer experience in Drupal too, so I knew what possible solutions there are, thought about hacking the Token module itself, until I found your module - what if there's a user who doesn't even know which module to blame for this problem?

Why couldn't we spare some time with building it into the core of Token module?
What's your aspect?

damienmckenna’s picture

Seeing as Dave wants to keep this as a separate module, how about enabling the new UI by default?

teknic’s picture

I agree with DamienMcKenna. This shouldn't even be a choice, its default desired behaviour.. besides, who wants server crashes? And it should fully support all #token_types.

mattsmith3’s picture

Including this in the conversation here: https://drupal.org/node/1334456.
It's the same issue, I believe: usability (as articulated in issue #5.
Something should be done about this. This module is far too important to not work on sites with larger numbers of fields or tokens. While token_tweaks is a great module, why not implement at least some kind of alternative within token itself?

deanflory’s picture

Issue summary: View changes

Agree with replacement of all token browsers with popup link. I'm still amazed such a major hinderance to site development and admin use/editing could be overlooked as something of less priority than other things. When opening an admin page results in the browser (and possibly server) freezing for 6 minutes for many admin page loads, it pretty much kills the ability to develop a Drupal site in a reasonable amount of time. I'm guessing this isn't going to happen in D7 and will just be one of the many carrots hung out for D8 adoption.

beardedgeek’s picture

Will this ever be fixed? The solution is already working when you edit a content type term reference field. There's a link that says browse available tokens, which opens a ui popup, but not when I edit a content type. It takes around a minute to open the page to add a new node or edit an existing one, all because the token list is loading.