Bug 7181 - Template indentation
Summary: Template indentation
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P3 enhancement (vote)
Assignee: natasha
QA Contact:
Depends on:
Blocks: 7119
  Show dependency treegraph
Reported: 2011-11-06 05:31 UTC by Paul Poulain
Modified: 2020-01-06 20:17 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:

Screenshot of code (34.88 KB, image/png)
2016-01-20 21:03 UTC, natasha

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Poulain 2011-11-06 05:31:57 UTC
The template indentation make it very hard to read. For example, in circulation.tt:
    [% IF ( MARCURLS ) %]
    <div class="results_summary"><span class="label">Online Resources:</span>
    <ul>    [% FOREACH MARCurl IN MARCURLS %]
        <li>[% IF ( MARCurl.part ) %][% MARCurl.part %]
            <br />[% END %] 
        <!-- here you might do a tmpl_if name="toc" and use greybox or equivalent for table of contents -->
        [% IF ( MARCurl.OPACurlOpenInNewWindow ) %]<a href="[% MARCurl.MARCURL %]" title="[% MARCurl.MARCURL %]" target="_blank">[% ELSE %]<a href="[% MARCurl.MARCURL %]" title="[% MARCurl.MARCURL %]">[% END %]
        [% MARCurl.linktext %]</a>
            [% IF ( MARCurl.notes ) %]<ul>[% FOREACH note IN MARCurl.notes %]<li>[% note.note %]</li>[% END %]</ul>[% END %]</li>
            [% END %]</ul>
    [% END %]

The last end, that is aligned with the first [IF] don't close this if...

During kohacon11 hackfest, we tried to investigate how to indent templates.
We haven't found THE solution, but here are a few links (thanks mason) :
Comment 1 natasha 2016-01-20 21:03:53 UTC
Created attachment 47050 [details]
Screenshot of code

This looks like it has already been fixed.
Comment 2 Hayley Pelham 2019-03-14 22:11:53 UTC
This appears to be fixed. Changing status to Resolved.