We would like to support Drupal tokens in BUEditor and have written a patch for this. The patch copies a lot of the code from the Tag system in BUEditor.

There are a few things left in around custom submit buttons and checkboxes. These were part of the tag system and I don't really understand when they would be set, but leaving them seems to be OK since they are basically ignored.

I will attach a patch with the token support and a patch that shows an example plugin (which we may develop as a custom module or contribute to https://www.drupal.org/project/insert_view_adv) to support adding a token for views.

Comments

damontgomery created an issue. See original summary.

damontgomery’s picture

Here is a patch with the token support and a patch with the example that works for views.

damontgomery’s picture

damontgomery’s picture

Status: Active » Needs review
kbentham’s picture

Thanks for creating this patch Dan!

damontgomery’s picture

Status: Needs review » Active

I've had more time working with BUEditor and the advanced insert view module and I think it might make more sense to move all of this functionality into advanced insert view.

I'd appreciate feedback.

I think this makes more sense because the tokens we are creating use a non-standard format of [view:my_view=my_display=my_arguments].

I would expect a token system to use `:` based on how I've used tokens in Drupal in other places.

So, I'll move all these new methods into the javascript. This is possible because the BUE and Editor are passed in to that javascript, so I can define my own methods / extend the objects as needed. I've created a proof of concept for media embed tokens which I'm working on as well.

I think I'll be able to tackle this towards the end of this week.

a.dmitriiev’s picture

Nice, btw the token syntax is legacy from insert view module, so it is also compatible with it and for migration purposes (from d6, d7 to d8), so there is no need to change the markup. Maybe it is better to use the new syntax, with standard formats of tokens? If it is easier to implement and will make it more generic. I am ok with changing the filter itself, to support other formats.

damontgomery’s picture

Status: Active » Closed (won't fix)

I've put all of this into https://www.drupal.org/project/insert_view_adv/issues/3065733#comment-13....

I'll close this now.

Thanks.