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 ForumsForm and ListForm and ListCustom Paging - Form and ListCustom Paging - Form and List
Previous
 
Next
New Post
4/26/2012 11:00 AM
 

Hello,

I'm using the form list rendering method  "XSLT using self made or generated style sheet" and custom XSL script to produce a list of document downloads. I am trying to customize the paging. I have my CSS worked out, but I can't seem to wok out how to change the default text for "Previous" and "Next". I removed "First" and "Last" just by removing those sections in my xsl file. I'd like to replace the previous with << and next with >>.

Any help is appreciated.

Thank you.

Richard English

 
New Post
4/26/2012 11:07 AM
 

Here is the paging section of my xsl file:

<xsl:template match="/udt:UserDefinedTable">
    <xsl:variable name="currentData" select="udt:Data" />
    <xsl:variable name="from">
      <xsl:choose>
        <xsl:when test="$paging">
          <xsl:value-of select="$paging * number($param_page) - $paging" />
        </xsl:when>
        <xsl:otherwise>0</xsl:otherwise>
      </xsl:choose>
    </xsl:variable>
    <xsl:variable name="to">
      <xsl:choose>
        <xsl:when test="$paging">
          <xsl:value-of select="$paging * number($param_page) +1" />
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="count($currentData)+1" />
        </xsl:otherwise>
      </xsl:choose>
    </xsl:variable>
    <xsl:if test="$currentData">
      <xsl:apply-templates select="$currentData" mode="list">
        <xsl:with-param name="from" select="$from" />
        <xsl:with-param name="to" select="$to" />
      </xsl:apply-templates>
    </xsl:if>
    <xsl:if test="$paging">
      <xsl:call-template name="renderPaging">
        <xsl:with-param name="maxPages" select="ceiling(count($currentData) div $paging)" />
      </xsl:call-template>
    </xsl:if>
  </xsl:template>

  <xsl:template name="pagingSinglePages">
    <!--renders paging links-->
    <xsl:param name="pageNumber" select="1" />
    <xsl:param name="maxPages" select="ceiling(count(//udt:Data) div $paging)" />
    <xsl:choose>
      <xsl:when test="number($param_page)=$pageNumber">
        <span class="NormalDisabled"><xsl:value-of select="$pageNumber" /></span>
      </xsl:when>
      <xsl:otherwise>
        <a href="?{$prefix_param}_page={$pageNumber}" class="CommandButton">
          <xsl:value-of select="$pageNumber" />
        </a>
      </xsl:otherwise>
    </xsl:choose>
  <xsl:if test="$pageNumber &lt; $maxPages"><xsl:call-template name="pagingSinglePages">
    <xsl:with-param name="pageNumber" select="$pageNumber +1" />
    <xsl:with-param name="maxPages" select="$maxPages" /></xsl:call-template></xsl:if></xsl:template>

  <xsl:template name="renderPaging">
    <xsl:param name="maxPages" select="ceiling(count(//udt:Data) div $paging)" />
    <xsl:variable name="previous" select="number($param_page) - 1" />
    <xsl:variable name="next" select="number($param_page) + 1" />
    <table class="PagingTable">
      <tr>
        <td class="Normal" align="Left">
          <xsl:value-of select="//udt:Context/udt:LocalizedString_Page" />&#160;<xsl:value-of select="number($param_page)" />&#160;<xsl:value-of select="//udt:Context/udt:LocalizedString_Of" />&#160;<xsl:value-of select="$maxPages" /></td>
        <td class="Normal" align="Right">
          
  <xsl:choose><xsl:when test="number($param_page)&gt;1"><a href="?{$prefix_param}_page={$previous}" class="CommandButton">
  <xsl:value-of select="//udt:Context/udt:LocalizedString_Previous" /></a></xsl:when><xsl:otherwise>
   <span class="NormalDisabled"><xsl:value-of select="//udt:Context/udt:LocalizedString_Previous" /></span></xsl:otherwise></xsl:choose> 
          
  <xsl:variable name="startpage"><xsl:choose><xsl:when test="number($param_page)&gt;5">
  <xsl:value-of select="number($param_page) -4" /></xsl:when><xsl:otherwise>1</xsl:otherwise></xsl:choose></xsl:variable>
          <xsl:variable name="endpage">
  <xsl:choose><xsl:when test="$startpage+9&gt;$maxPages"><xsl:value-of select="$maxPages" /></xsl:when><xsl:otherwise>
    <xsl:value-of select="$startpage +9" /></xsl:otherwise></xsl:choose></xsl:variable>
          <xsl:call-template name="pagingSinglePages"><xsl:with-param name="pageNumber" select="$startpage" />
            <xsl:with-param name="maxPages" select="$endpage" /></xsl:call-template><xsl:choose><xsl:when test="number($param_page)&lt;$maxPages">
              <a href="?{$prefix_param}_page={$next}" class="CommandButton">
                <xsl:value-of select="//udt:Context/udt:LocalizedString_Next" /></a></xsl:when><xsl:otherwise>
                  <span class="NormalDisabled">
                    <xsl:value-of select="//udt:Context/udt:LocalizedString_Next" /></span></xsl:otherwise></xsl:choose> 
   
  </td>
      </tr>
    </table>
  </xsl:template> 

 
New Post
4/26/2012 11:22 AM
 

Hello Richard

Replace <xsl:value-of select="//udt:Context/udt:LocalizedString_Next" />  with &gt;&gt;  
and <xsl:value-of select="//udt:Context/udt:LocalizedString_Previous" />  with &lt;&lt; 

<> needs to be escaped, thats why I am prposing &gt; and &lt;
The xsl:value lloks up the localized string for next and previous

Regards,
Stefan

 
New Post
4/26/2012 11:37 AM
 

Thank you Stefan!

Great!  I had been trying to place the characters within the "value-of select" and I wasn't escaping them.

If I could ask a follow up. How would I eliminate "previous" when on page 1 and "next" when on the last page?

Thank you very much for your help.

Richard English

 
New Post
4/26/2012 11:52 AM
 

Remove the  bold text (Previous should look similiar)

<xsl:choose>
  <xsl:when test="number($param_page)&lt;$maxPages">
           <a href="?{$prefix_param}_page={$next}" class="CommandButton">
                <xsl:value-of select="//udt:Context/udt:LocalizedString_Next" /></a>
   </xsl:when>
   <xsl:otherwise>
                  <span class="NormalDisabled">
                    <xsl:value-of select="//udt:Context/udt:LocalizedString_Next" /></span>
    </xsl:otherwise>
</xsl:choose>   

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForm and ListForm and ListCustom Paging - Form and ListCustom Paging - Form and List


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