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 FeedsSet description limit and container widthSet description limit and container width
Previous
 
Next
New Post
4/20/2007 11:52 AM
 

is there a way to limit the description length to show only certain amount of text, say 100 characters?

Is there a way to set the width of the module container?

 
New Post
4/27/2007 2:16 PM
 

Setting the number of any xml element is really a matter of using a xslt function.  One I use, substring, is illustrated here in a modified version of the default dnn xsl:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes"/>
<xsl:param name="TITLE"/>
<xsl:template match="rss">
  <!-- Do not show channel image -->
  <xsl:for-each select="channel/item">
    <br>
<strong><a href="{link}" target="_main"><xsl:value-of select="title"/></a></strong><br></br>

   <!-- only display 100 characters of the description, and allow html -->
  <xsl:value-of select="substring(description,1,100)" disable-output-escaping="yes"/>
    </br>
    <br></br>
  </xsl:for-each>
</xsl:template><xsl:template match="description">
  <br>
    <xsl:value-of select="."/>
  </br>
</xsl:template></xsl:stylesheet>

The second question's answer depends on the skin you are using, but generally, container set widths to align with thier parent skin.  I take a look at the skin width overall, then the container.  Then, I include an inline style section in the xsl to use that respects the width of the containers I am going to use.  Otherwise, the skin graphics may not align within the contraints of the skin and container.  Though this is just one way to approach it, I follow the order of precedence provided by the skin, container, and develop an inline style to work for the effect I need.

If you need more info about it, provide the type of skin and container you are using, the newsfeed source, and  an idea of the effect you need, then we can help put you on a solution path.

 
New Post
5/23/2007 11:25 AM
 

Hi I'm using this newsfeed http://weather.yahooapis.com/forecastrss?p=84060 and the default DNN skin.  I'd like to se the width of the container to 200 pixels.

Thanks for the help.

 
New Post
5/24/2007 11:44 AM
 

Allright, this actually is a skinning question, so I'll give you one way to achieve a solution, but you may need to play around with the skins to get it the way you want.  Remember, there is more than one way to skin a cat... er, DNN.

Just for clarity, I'm using the DNNv4.5.0 using the default DNN-Blue Horizontal-Fixed-Width skin.  To change the column width of a pane for that skin, you need to edit the skin.css, which resides under your website folder as: website\portals\_default\skins\DNN-Blue\skin.css

You change the width of the class defined for the pane you want, Then, you need to login to your site in the Host account, go the skins menu, pull and reparse the skin package.  Logout, and access your site, and you should see your changes.  Keep in mind that a change of this type affects you whole site.  Alternatively, you could create a custom skin for a page, with the look you want, and set it up.  But that's another skinning type of chore, and I'm not the best resources for that type of thing, and that is a entry for the skins forum.

Here's a snippet of the changes I made to allow for a left pane width of 200.

.leftpane {
 width: 225px;
 background-color: transparent;
 padding-left: 6px;
 padding-right: 4px;
 padding-top: 6px;
}
.contentpane {
 width: 100%;
 background-color: transparent;
 padding-left: 6px;
 padding-right: 4px;
 padding-top: 6px;
}
.rightpane {
 width: 150px;
 background-color: transparent;
 padding-left: 6px;
 padding-right: 4px;
 padding-top: 6px;
}

Also, with that feed you will need a custom xsl to display it properly. So, here's an example to get you started. 

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="xsl"
   xmlns:dc="http://purl.org/dc/elements/1.1/">
<xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>
<!-- rss2_0simple.xsl - rss v2.0 simple  - Phil 'iwonder' Guerra -->

<xsl:template match="/">
 <div>
  <xsl:apply-templates select="rss/channel"/>
  </div>
</xsl:template>
<xsl:template match="rss/channel">
<xsl:variable name="link" select="link"/>
  <xsl:variable name="description" select="description"/>
  <xsl:variable name="image" select="image/url"/>
  <xsl:variable name="idesc" select="image/description"/>
  <xsl:variable name="ilink" select="image/link"/>
  <xsl:variable name="iwide" select="image/width"/>
  <xsl:variable name="ihigh" select="image/height"/>

<div class="rssChannel">
 <xsl:if test="$image">
    <a href="{$ilink}" title="{$idesc}"><xsl:value-of select="ilink" /></a>
    <img src="{$image}" height="{$ihigh}" width="{$iwide}" style="float: left; margin: 2px; border: 0px;"/>
 </xsl:if> 
 <a href="{$link}"><xsl:value-of select="title" /></a><br/>
 </div>
<div class="rssChannelDescription">
 <xsl:value-of select="description"/><br/>
</div>
<div class="rssChannelsubHead">
 <xsl:value-of select="webMaster"/><br/>
 <xsl:value-of select="copyright"/><br/>
 <xsl:value-of select="lastBuildDate"/>
 <hr/>
</div>

  <xsl:apply-templates select="item"/>
</xsl:template>
<xsl:template match="item">
  <xsl:variable name="item_link" select="link"/>
  <xsl:variable name="item_title" select="description"/>
  <div class="rssItem">
    <a href="{$item_link}" title="{$item_title}"><xsl:value-of select="title" disable-output-escaping="yes"/></a>
</div>
<div class="rssItemDescription">
 <xsl:value-of select="description" disable-output-escaping="yes"/><br/>
</div>
<div class="rssItemSub">
 By: <xsl:value-of select="dc:creator"/><br/>
 (<xsl:value-of select="pubDate"/>)<br/> <hr/> 
</div>
 </xsl:template>

</xsl:stylesheet>

Cheers

 
New Post
5/24/2007 11:44 AM
 

Allright, this actually is a skinning question, so I'll give you one way to achieve a solution, but you may need to play around with the skins to get it the way you want.  Remember, there is more than one way to skin a cat... er, DNN.

Just for clarity, I'm using the DNNv4.5.0 using the default DNN-Blue Horizontal-Fixed-Width skin.  To change the column width of a pane for that skin, you need to edit the skin.css, which resides under your website folder as: website\portals\_default\skins\DNN-Blue\skin.css

You change the width of the class defined for the pane you want, Then, you need to login to your site in the Host account, go the skins menu, pull and reparse the skin package.  Logout, and access your site, and you should see your changes.  Keep in mind that a change of this type affects you whole site.  Alternatively, you could create a custom skin for a page, with the look you want, and set it up.  But that's another skinning type of chore, and I'm not the best resources for that type of thing, and that is a entry for the skins forum.

Here's a snippet of the changes I made to allow for a left pane width of 200, although you will probably need to play around with the dimensions to get it just the way you want.

.leftpane {
 width: 200px;
 background-color: transparent;
 padding-left: 6px;
 padding-right: 4px;
 padding-top: 6px;
}
.contentpane {
 width: 100%;
 background-color: transparent;
 padding-left: 6px;
 padding-right: 4px;
 padding-top: 6px;
}
.rightpane {
 width: 175px;
 background-color: transparent;
 padding-left: 6px;
 padding-right: 4px;
 padding-top: 6px;
}

Also, with that feed you will need a custom xsl to display it properly. So, here's an example to get you started. 

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="xsl"
   xmlns:dc="http://purl.org/dc/elements/1.1/">
<xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>
<!-- rss2_0simple.xsl - rss v2.0 simple  - Phil 'iwonder' Guerra -->

<xsl:template match="/">
 <div>
  <xsl:apply-templates select="rss/channel"/>
  </div>
</xsl:template>
<xsl:template match="rss/channel">
<xsl:variable name="link" select="link"/>
  <xsl:variable name="description" select="description"/>
  <xsl:variable name="image" select="image/url"/>
  <xsl:variable name="idesc" select="image/description"/>
  <xsl:variable name="ilink" select="image/link"/>
  <xsl:variable name="iwide" select="image/width"/>
  <xsl:variable name="ihigh" select="image/height"/>

<div class="rssChannel">
 <xsl:if test="$image">
    <a href="{$ilink}" title="{$idesc}"><xsl:value-of select="ilink" /></a>
    <img src="{$image}" height="{$ihigh}" width="{$iwide}" style="float: left; margin: 2px; border: 0px;"/>
 </xsl:if> 
 <a href="{$link}"><xsl:value-of select="title" /></a><br/>
 </div>
<div class="rssChannelDescription">
 <xsl:value-of select="description"/><br/>
</div>
<div class="rssChannelsubHead">
 <xsl:value-of select="webMaster"/><br/>
 <xsl:value-of select="copyright"/><br/>
 <xsl:value-of select="lastBuildDate"/>
 <hr/>
</div>

  <xsl:apply-templates select="item"/>
</xsl:template>
<xsl:template match="item">
  <xsl:variable name="item_link" select="link"/>
  <xsl:variable name="item_title" select="description"/>
  <div class="rssItem">
    <a href="{$item_link}" title="{$item_title}"><xsl:value-of select="title" disable-output-escaping="yes"/></a>
</div>
<div class="rssItemDescription">
 <xsl:value-of select="description" disable-output-escaping="yes"/><br/>
</div>
<div class="rssItemSub">
 By: <xsl:value-of select="dc:creator"/><br/>
 (<xsl:value-of select="pubDate"/>)<br/> <hr/> 
</div>
 </xsl:template>

</xsl:stylesheet>

Cheers

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsNews FeedsNews FeedsSet description limit and container widthSet description limit and container width


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