Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Thanks for the module, it really helps on my sites!
If I use a 5 or more templates it would be useful to move some of them to the top of the list, and others to the bottom.
Also, if some templates are buttons and others are columns, the ability to group them would be great!
Comment | File | Size | Author |
---|---|---|---|
#2 | wysiwyg_template-1890714-1.patch | 6.53 KB | sun-fire |
Comments
Comment #1
guybedford CreditAttribution: guybedford commentedGreat suggestion - can't believe I never thought of this!
Unfortunately I just do not have the time to develop new functionality for this module, and can only maintain at this point.
If someone wants to take this on, I'm more than happy to review patches. Perhaps even put a bounty on it if you need someone to do this.
Comment #2
sun-fire CreditAttribution: sun-fire commentedHi. This is a patch, that allow to sort templates. I had not a lot of time to write a code with optimisation and according to all coding standarts. Therefore if my solution is the right way, i will rewrite it for all standarts.
Main idea:
1. Original function wysiwyg_template_overview moved to wysiwyg_template_overview_form (now it is a graggable table).
2. I use a variable to save a template weights into it. Maybe it will be better solution (sorting weights into array and save into variable will be faster than save weight per each template into database).
Patch baset on the latest dev
UPD: If you already have a templates into list, press button "Save" to init weight variable. It's need only one time after patch applying. Now it's a small bug.
Comment #3
vabue CreditAttribution: vabue commented#2 works for me, thank you!
Comment #4
guybedford CreditAttribution: guybedford commentedThanks so much for submitting this - that is a great feature that has been much needed.
The code seems fine to me at a quick glance, but I still need to review in more detail.
Using a variable for weights is fine. I don't think there is a speed roadblock when it comes to the loading of the edit page, so it may have made slightly more conceptual sense to include it in the base table which also would support the export and import features. But that can also be added later if anyone wants. Having the functionality is far more important though.
Hopefully I'll have some time this weekend to review and merge.
Comment #5
guybedford CreditAttribution: guybedford commented@sun-fire I just tested this out and it didn't display any of my existing templates!
Backwards compatibility is important for this, otherwise I can't push this change - can you provide an updated patch?
Comment #6
jurgenhaasI have now rewritten this feature so that it stores the weight as a weight field in the database. Defining the order happens by drag and drop in the template overview in the admin area.
Please review and let us know what everybody thinks. We're getting then close to a new official release of this module.
Comment #7
guybedford CreditAttribution: guybedford commentedExcellent, this looks great. It worked fine for me.
Comment #8
jurgenhaas