https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30657

--- Comment #7 from Martin Renvoize <[email protected]> ---
There are already a couple of options here I believe.. but I think we should
perhaps make it simpler/clearer.

You can use all accessors available from the Koha::Patron object assuming
you've been passed said object into the template.

We have a few different attribute accessors:

* 'extended_attributes' which returns a resultset of attached extended
attributes
* 'get_extended_attribute(code)' which returns the attribute associated with
the code passed (but doesn't work properly for repeatable attributes)

To use those in TT:

*  [% FOREACH extendedattribute IN patron.extended_attributes %]
        <li class="patronattribute">
            <span class="patronattributelabel">[%
extendedattribute.type.description | html %]</span>: [%
extendedattribute.description | html %]
        </li>
    [% END %]

* [% SET attribute = patron.get_extended_attribute('code') %]
  [% attribute.description | html %]

The second one is clearly simpler to use, but only works for non-repeatable
attributes so you need to know a little about the underlying patron data setup.
 I also think it's a get wordy 'get_' and would prefer, I think, to have a
simple 'extended_attribute($code)' accessor.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to