Learning XSL

Robby Stephenson robby at periapsis.org
Fri Oct 5 13:32:44 BST 2018

On Thu, Oct 4, 2018 at 12:39 PM Urban Planet
<urbanplanet.manticore at gmail.com> wrote:
> As we like the Album template more than the others, we thought that we could apply that template for Books.  The system message told us not, but we change the type of collection to '4'  in the tellico xml file that is inside of the .tc
> Then, we could view the book entries with the album template, but without the nice functionality to be able to see each entry with Author + Title + Year.
> Well, we thought this was due that the internal name of the field shown in the bar were "artist" and not "author".   Quickly we changed that internal name in the xml file ("author" to "artist").

> But this means that if we want to modify the template, we must learn XSL, isn't it?

Yes, modifying the XSL template is the easiest to do what you want,
and shouldn't be too hard in this case. Copy and rename the Album.xsl
file into your $HOME/.local/share/tellico/entry-templates folder. You
can create that path if it doesn't already exist.

Then, remove the restriction to be music collections only by deleting
these lines:

<xsl:template match="tc:collection[@type!=4]">
 <h1><i18n>This template is meant for music collections only.</i18n></h1>

And changing the next line from
<xsl:template match="tc:collection[@type=4]">
<xsl:template match="tc:collection">
which essentially allow the template to apply to any collection type.

Then do a search/replace for artist to author and see how well that works.


More information about the tellico-users mailing list