Jump to content
DV-JF

Template Tags - easy way to modify multiple templates at once

Recommended Posts

Hi,

maybe I'm blind or I'm missing something 😕 What I'm asking myself: Is there a simple way to tag multiple templates in one step.

At the moment I'm restructuring a big ProcessWire site and want to tag all templates in order to get a better overview. Therefore I'd have to edit every single template. Instead it would be nice to select multiple templates and give them a tag them in one step.

EDIT: I'm using ProcessWire 3.0.148 © 2020


Many thanks in advance for any hints... DV-JF alias Jens.

Share this post


Link to post
Share on other sites

as far as I can tell Templates do not support tagging in the same way as the fields, there is no "manage tags" button, and no executeTags() method in ProcessTemplate.

  • Like 1

Share this post


Link to post
Share on other sites

You can use the API:

$tpl = $templates->get('service');
$tpl->tags = "foo bar something else";
$tpl->save();

or for multiple templates, just create an array with tpl-names, and do a foreach()

  • Like 2

Share this post


Link to post
Share on other sites

...or you can use this small module that (with a lot of nicked code from ProcessField) adds the functionality to the Template list:

https://github.com/BitPoet/TemplateTagsEditList

Best try it out on a copy of the site though, I haven't tested it much yet. Anyway...have fun 😉

(I'm soon going to use this a lot myself to clean up a few really complex sites...)

  • Like 5

Share this post


Link to post
Share on other sites

Hey,

thank you for the answers and hints. I've solved the problem using "Adminer" from "TracyDebugger". @BitPoet Special thank goes to you 👍, I'll have a closer look on your module soon and will test it for sure!

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...