This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Report Template

Tags: None
(comma "," separated)
asteinhauf
Registered Member
Posts
6
Karma
0

Report Template

Tue Aug 02, 2016 9:37 am
Hello,

I'm working on an own report template based on the category view template. How I can access a field of an item, without adding it to the list view of tellico ? Example: I want to show my description and tags fields in the table cell with the title, beyond it.

best regards


Andy Steinhauf
robbystephenson
KDE Developer
Posts
384
Karma
1
OS

Re: Report Template

Wed Aug 03, 2016 11:21 am
asteinhauf wrote:I'm working on an own report template based on the category view template. How I can access a field of an item, without adding it to the list view of tellico ? Example: I want to show my description and tags fields in the table cell with the title, beyond it.


How you reference it really depends on how the XSL is set-up. If your context is already inside the tc:entry element, then you can use ./tc:description, for example. If you can show details of what you're trying to edit or what you've tried without working, I may be able to help more easily.

Robby
asteinhauf
Registered Member
Posts
6
Karma
0

Re: Report Template

Wed Aug 03, 2016 4:14 pm
robbystephenson wrote:How you reference it really depends on how the XSL is set-up. If your context is already inside the tc:entry element, then you can use ./tc:description, for example. If you can show details of what you're trying to edit or what you've tried without working, I may be able to help more easily.


I used your Group_view.xsl as base, changed the layout (one table per category, category name as h2-tag outside the table), I added:

- jquery js library
- fancybox to open the images in a lightbox
- dataTables, a jquery script, which allows to sort and filter tables via javascript
- font awesome

I will use it as a kind of catalogue / index of my books / newspapers on my website. I want to add my description and tag fields beyon the tilte, without adding the fields to the list view, see the following image:

Image

best regards


Andy
robbystephenson
KDE Developer
Posts
384
Karma
1
OS

Re: Report Template

Tue Aug 09, 2016 12:50 am
asteinhauf wrote:
robbystephenson wrote:How you reference it really depends on how the XSL is set-up. If your context is already inside the tc:entry element, then you can use ./tc:description, for example. If you can show details of what you're trying to edit or what you've tried without working, I may be able to help more easily.


I used your Group_view.xsl as base...I want to add my description and tag fields beyon the tilte, without adding the fields to the list view

One approach is to hard code those two fields that you want to add. Near the top of the .xsl file, edit the two blue lines:
<xsl:param name="column-names" select="'title'"/>
<xsl:param name="column-names-extra" select="'description tag'"/>
<xsl:variable name="columns" select="str:tokenize(concat($column-names,' ',$column-names-extra))"/>


See where I add description and tag there? You'll need to use the field name, not the field title.
asteinhauf
Registered Member
Posts
6
Karma
0

Re: Report Template

Thu Oct 27, 2016 5:06 pm
Hello,

sorry for the long delay, but I had no time to work on it during the last weeks.

Thanks a lot for your suggestion. Now, the needed fields where added as new column, but this was not the target.

How I can place the value on the needed places (see screenshot above).

Is it possible to change this block:

<xsl:otherwise>
<xsl:call-template name="simple-field-value">
<xsl:with-param name="entry" select="$entry"/>
<xsl:with-param name="field" select="$column"/>
</xsl:call-template>
</xsl:otherwise>

according this rules:

- if the field name (or title) is "tag", "signature" or "description": dont display this block
- if the field name (or title) is "title", show description, tags and signature in <p>-Tags beyond the title

best regards



Andy
asteinhauf
Registered Member
Posts
6
Karma
0

Re: Report Template

Thu Oct 27, 2016 7:23 pm
Hello,

I think, I got it:

I've inserted the following lines after the block mentioned in the last post:

Code: Select all
<xsl:if test="$field/@title='Titel'">
       <xsl:if test="$entry/descendant-or-self::*[name() = 'beschreibung']!=''"><p><xsl:value-of select="$entry/descendant-or-self::*[name() = 'beschreibung']" disable-output-escaping="yes" /></p></xsl:if>
      <xsl:if test="$entry/descendant-or-self::*[name() = 'stichwörter']!=''"><p>Stichwörter: <xsl:value-of select="$entry/descendant-or-self::*[name() = 'stichwörter']" disable-output-escaping="yes" /></p></xsl:if>
      <xsl:if test="$entry/descendant-or-self::*[name() = 'ordner']!=''"><p>Signatur: <xsl:value-of select="$entry/descendant-or-self::*[name() = 'ordner']" disable-output-escaping="yes" /></p></xsl:if>
</xsl:if>


The not needed table columnes I've disabled via CSS for now, is there another way ?

best regards


Andy


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]