Learning XSL

Xavier Brochard xavier at alternatif.org
Fri Oct 5 15:59:09 BST 2018

Le vendredi 5 octobre 2018, 14:32:44 CEST Robby Stephenson a écrit :
> 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>
> </xsl:template>
> And changing the next line from
> <xsl:template match="tc:collection[@type=4]">
> to
> <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.
> Robby

See also
and https://userbase.kde.org/Tellico/DefaultFields

might help for further changes.
Xavier Brochard - 07 68 13 14 35
« La liberté est à l'homme ce que les ailes sont à l'oiseau »
(Jean-Pierre Rosnay)

More information about the tellico-users mailing list