I'm personally not a big fan of the "single big file" approach. I find it difficult to navigate through, and can cause git conflicts more often. Also, it means that all blocks need to be parsed by TT on every page. Maybe it doesn't affect performance too much (or maybe it affects performance in a good way), but it makes more sense to me to only include what's needed.

I'd try to use WRAPPER + PROCESS directives to achieve the same thing:

[%# acq-searches.inc %]
[% WRAPPER 'header.inc' %]
  [% PROCESS 'vendor-search.inc' %]
  [% PROCESS 'orders-search.inc' %]
[% END %]

[%# header.inc %]
[% search_tabs = [] %]
<header>
  <div id="header_search">
    [% content %]
  </div>
  <ul>
    [% FOREACH tab IN search_tabs %]
      <li>[% tab %]</li>
    [% END %]
  </ul>
</header>

[%# vendor-search.inc %]
<form>...</form>
[% search_tabs.push('Search vendors') %]

Not sure if it works or if it is better than your solution, I just thought about that while reading your code. It probably has downsides too.


Le 14/07/2020 à 02:58, Owen Leonard a écrit :
this looks good to me - why do you think it might not be worth pursuing?
No particular reason, I just wanted to get some opinions in case there
was a downside I wasn't seeing.

--
Julian Maurice
BibLibre
_______________________________________________
Koha-devel mailing list
Koha-devel@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to