Pentaho

 View Only

 How to get xcdf tags value inside a dashboard template?

  • Pentaho
  • Ctools
  • Pentaho
Donato La Perna's profile image
Donato La Perna posted 09-03-2019 09:56

Hi, I'm trying to get some values stored in the xcdf tags inside the dashboard template, specifically the title of the dashboard so that I can set a template to dynamically get the correct title in a header bar outside {content}. Something like using the {content} or the {isAdmin} placeholders, but for the tags in the xcdf file. How can I accomplish this? Cheers!


#Ctools
#Pentaho
David da Guia Carvalho's profile image
David da Guia Carvalho

Why not use the standard html/js?

 

$(document).ready(function() { document.title = 'blah'; });

 

Or... in case of a specific template object just use ID?

 

Donato La Perna's profile image
Donato La Perna

Hi David, thanks for the interest.

 

I'm sorry if I wasn't clear enough, I'll try to explain what I'm trying to accomplish.

 

Developing a dashboard using CDF I use three different files:

  • an .xcdf file, specific to the dashboard, that has the <title> tag
  • an .html template file, common to all the dashboards, that has the {content} placeholder
  • an .html file, specific to the dashboard, that goes in place of the {content} placeholder

 

What I'd like is to be able to use the value of the .xcdf's <title> tag (that corresponds to the title shown in the PUC, and not to the title of the document) inside the .html template file, so that it can be automatically placed inside a header without any code in the .html specific file.

 

Using IDs is a viable option, but it would require the same code inside every .html specific file: I'm looking for a way to avoid that, using only code inside the .html template file.

 

Thanks anyway!

 

Donato