Macro or plugin for in-house use

Right now I don’t really have the time (or so I assume) to push out a plugin, and a simple macro seems the way to go, but is there a performance hit or something else I’m missing?

I’ll be calling two variables from the page header to build out a simple menu based on an array of page titles. The first variable is a boolean, the second will be an array of strings. I’ll parse the array from a collection of pages from a single taxonomy category, and product a styled list of links.

So is it better to make a plugin rather than use a macro?

Thanks in advance.

Plugins are pretty simple affairs, and are not really anything that is a huge effort to create. You can even put plugin events into your theme class to save you even more time.

That said, If the logic is not overly complex and you find a macro solves the problem, then it’s probably fine. If you get to the point where your twig code in the macro is really starting to get out of hand, that’s probably a good indicator that a plugin (ie php logic, and setting some resulting object/var back to the twig variables) is probably a better option.

Speed wise a plugin will be faster, but the differences is probably a ms or two, depending on what you are doing, so you probably would not even notice.

Thanks man, that’s pretty much exactly the info I was looking for.