Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsNews FeedsNews FeedsHow to set font and size in the xsl file ?How to set font and size in the xsl file ?
Previous
 
Next
New Post
10/17/2006 2:24 PM
 

I'm trying to display the title of the feed in verdana 12px, so I've scripted this in the .xsl file :

<a href="{link}" target="_new">
<font size="12px" font-family="verdana">
<xsl:value-of select="substring(title,1,60)"/>
</font>
</a>

or this with no more luck :

<font size="12px" font-family="verdana">
<a href="{link}" target="_new">
<xsl:value-of select="substring(title,1,60)"/>
</a>
</font>

The display is changed, but not at all as expected (letters are becoming very large like 64px or so). What is the right way to code css-like formatting elements in an xsl file ?

 

 


Benoît Sarton
www.bsi.fr
www.dotnetnuke.fr
 
New Post
10/17/2006 2:37 PM
 

You could do the following:

<a href="{link}" target="_new" style="font-size:12px;font-family:verdana;">
<xsl:value-of select="substring(title,1,60)"/>
</a>

But, you should always try to not use inline styles.  You could create a style class and reference it like the following:

<a href="{link}" target="_new" class="yourclass">
<xsl:value-of select="substring(title,1,60)"/>
</a>

 
New Post
10/17/2006 4:37 PM
 

Of course ! I had my head so deap in those xsl , xls-fo , xslt specs,  that I forgot my HTML basics...

About creating a style class, I agree in general, but in this case what I (we ?) want is create a set of .xsl files that we could reuse in most DNN sites. So I prefer an .xsl file that will be standalone and not require any extra settings in the style sheet. Furthermore, our content is basically a title and a description, so having to depend on 4 or 5 different places to set the the display of such a simple content is somewhat opposite to DNN's philosophy of beeing easy, even if it's good programming practice.

In fact, title and description's lenght, size and color should probably be module settings in a future version. That would be the most simple way for non-programmers.

Finally, I've changed RSSDisplayHtml.xsl so that only the first 60 characters of the title are displayed, and if it had to be truncated, I add "...". 

I did that because I noticed one problem with the concept of 'channels'  (a great thing !) is that rss sources can have very different sizes for their titles and description, so you may want to uniformize all this. Here is the portion of the .xsl :

<a href="{link}" target="_new" style="font-size:12px;font-family:verdana;">
<xsl:value-of select="substring(title,1,60)"/>
<xsl:if test="string-length(title)&gt;60">
     <xsl:text>...</xsl:text>
</xsl:if>
</a>

 

 


Benoît Sarton
www.bsi.fr
www.dotnetnuke.fr
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsNews FeedsNews FeedsHow to set font and size in the xsl file ?How to set font and size in the xsl file ?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out