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 ForumsXMLXMLPaging with XML module Please Please help!Paging with XML module Please Please help!
Previous
 
Next
New Post
12/1/2009 1:28 PM
 

I have created a form in DNN that posts values to my XML module. All is working fine and parameters are sent and outputed perfectly using my XSL stylesheet. However, for the life of me i cannot figure out how to get the paging working.

My XML source is set to this url: http://data.dezrez.com/Search.ASP?WCI=results&EAID=782&xslt=-1&perpage=6

The paging area of my XSL looks like this:

        <xsl:for-each select="//pages/page">
            <xsl:if test="@hidden">
                <xsl:choose>
                    <xsl:when test="@selected">
                            <xsl:choose >
                                <xsl:when  test="@number=//properties/pages/@number">
                                    <!--when last property-->
                                </xsl:when>
                                <xsl:otherwise>
                                        <a><xsl:attribute name="href"> document.form.page.value='<xsl:value-of select="@number + 1"/>';document.form.submit();</xsl:attribute>Next</a>
                                </xsl:otherwise>
                                </xsl:choose>
                    </xsl:when>
                </xsl:choose>      
            </xsl:if>
        </xsl:for-each>

You can see this search functionality in action at: http://www.lesixtysix.fr/BeautifulSouth/QuickSearch/tabid/118/Default.aspx

The various page links are displayed but when clicked they just dont page through. However, when i create a standalone asp page outside of DNN (which you can see here: http://www.lesixtysix.fr/BeautifulSouth/asp/search%20form.htm) the paging functionality works fine.

Is it a case that the XML module doesnt support or recognise the paging javascript? If so, what can i do instead to create a paging function that will solve my problem?

Please please help! Im tearing out my hair over this!

 
New Post
12/1/2009 2:17 PM
 

The javascript does a form post and submits a form parameter with the name page and the wanted page number.

By default, the XSL script knows nothing about any context, neither form or querystring  or any other kind of information. The XML module is able to pass that information into the script, but you need to define that, AND you need to add a <xsl:param> in your script and work with it.

 
New Post
12/1/2009 3:10 PM
 

Thanks Stefan, but that all sounds French to me. Are you able to explain a bit more?

I found this post you made: http://www.dotnetnuke.com/Community/Forums/tabid/795/forumid/59/threadid/152833/scope/posts/Default.aspx which gives me some clue to what an XSL parameter is but i have no clue at all what this part is: (sorry, im a complete novice at all this XML XSL stuff)

< xsl:variable name="elementsPerPage" select="15" />
 <xsl:variable name="totalNumberOfPages" select="ceiling (count(/root/element)-$elementsPerPage)" />

What would i have to put in my own XSL to reference the pages at my external url that im querying at: http://data.dezrez.com/Search.ASP?WCI=results&EAID=782&xslt=-1&perpage=6?

 
New Post
12/1/2009 4:20 PM
 

I have no glue how your sktipt is supposed to work, and it makes no sense to answer questions about fragementsof it.

You  asked how to get a page number into the script. Let us a assume we have a querystring like ?page=4

Than you need first to pass the parameter page into the script:

Now the value is passed into the script, and you can set it in your script like:

  <xsl:param name ="currentpage" select ="1"/>

The parameter @currentpage is now available. If you want to read the form value like used in your javascript, you would configure it wit "Pass-through form Post" instead of "Pass-Through Query String"

 
New Post
12/2/2009 7:43 AM
 

Hi Stefan, i really do appreciate your attempts at helping me with this but you will have to bare with me, im a complete novice at this!

There has been a slight change. Ive been told by the data providers at Dezrez that i can page through results by passing a 'page' parameter to the search query. And also the url to query the results changed from http://data.dezrez.com/Search.ASP to http://www.dezrez.com/drapp/search.asp. So, in my XML module ive modified the url and set up a parameter as follows: page - Pass-Through Querystring (page). So my XML options now look like this

This is working fine and when i search an example of the url results look like as follows: http://www.lesixtysix.fr/BeautifulSouth/Results/tabid/119/Default.aspx?property_type=65&minprice=100000&maxprice=300000&page=1

If i manually change the page url e.g http://www.lesixtysix.fr/BeautifulSouth/Results/tabid/119/Default.aspx?property_type=65&minprice=100000&maxprice=300000&page=2 it all works fine and page 2 results are shown.

Now, my XSL looks like this and outputs the page results links:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" >
<xsl:output method="html"/>               
<div class="page">
  <div class="pages">
    <xsl:if test="//properties/pages/@number>1">
        <xsl:if test="//properties/@page>1">
            <a><xsl:attribute name="href"> document.form.page.value='1';document.form.submit();</xsl:attribute>&lt;&lt;|</a>
        </xsl:if>
        <xsl:for-each select="//pages/page">
            <xsl:if test="@hidden">
                <xsl:choose>
                    <xsl:when test="@selected">
                                <xsl:choose >
                                <xsl:when  test="@number=1">
                                <!--when first property-->
                                </xsl:when>
                                <xsl:otherwise>
                                        <a ><xsl:attribute name="href"> document.form.page.value='<xsl:value-of select="@number - 1"/>';document.form.submit();</xsl:attribute>Previous</a>
                                </xsl:otherwise>
                                </xsl:choose>
                    </xsl:when>
                </xsl:choose>
            </xsl:if>
        </xsl:for-each>
            <span class="pagenumbers">
                <xsl:for-each select="//pages/page">
                    <xsl:if test="@hidden=0">
                    <xsl:choose>
                    <xsl:when test="@selected">
                        <span class="selected"><xsl:value-of select="@number"/></span>           
                    </xsl:when>
                    <xsl:otherwise>
                    <a><xsl:attribute name="href"> document.form.page.value='<xsl:value-of select="@number"/>';document.form.submit();</xsl:attribute><xsl:value-of select="@number"/></a>
                    </xsl:otherwise>
                    </xsl:choose>
                    </xsl:if>
                </xsl:for-each>
            </span>
        <xsl:for-each select="//pages/page">
            <xsl:if test="@hidden">
                <xsl:choose>
                    <xsl:when test="@selected">
                            <xsl:choose >
                                <xsl:when  test="@number=//properties/pages/@number">
                                    <!--when last property-->
                                </xsl:when>
                                <xsl:otherwise>
                                        <a><xsl:attribute name="href"> document.form.page.value='<xsl:value-of select="@number + 1"/>';document.form.submit();</xsl:attribute>Next</a>
                                </xsl:otherwise>
                                </xsl:choose>
                    </xsl:when>
                </xsl:choose>       
            </xsl:if>
        </xsl:for-each>
        <xsl:if test="//properties/@pagecount &gt; //properties/@page">
            <a><xsl:attribute name="href"> document.form.page.value='<xsl:value-of select="//properties/pages/@number"/>';document.form.submit();</xsl:attribute>|&gt;&gt;</a>
        </xsl:if>
    </xsl:if>
</div>
                <div class="content">
                    <xsl:choose>                   
                        <xsl:when test="//properties/@total > 0">                   
                            <xsl:call-template name="pagestop"/>
                            <div id="properties">
                                <xsl:apply-templates select="properties"/>
                            </div>           
                            <xsl:call-template name="pagesbottom"/>
                        </xsl:when>
                        <xsl:otherwise>
                            <div class="noresults">Your search has returned 0 results. Please expand your search criteria and try again.</div>
                        </xsl:otherwise>
                    </xsl:choose>
                </div>
                <div class="footer">
                    <a href="http://www.dezrez.com/" target="_top">
                        <img src="http://www.dezrez.com/drapp/EstateAgents/dezrezgraphic.gif"  border="0"/>
                    </a>
                </div>
            </div>   
    </xsl:template>
    <xsl:template match="properties">
        <xsl:for-each select="property">
                <div class="property">
                    <div class="image">
                        <a>
                            <xsl:attribute name="HREF">http://www.lesixtysix.fr/BeautifulSouth/Results/tabid/119/Default.aspx?PropertyID=<xsl:value-of select="@id"/>
                            </xsl:attribute>
                           
                            <xsl:if test="@picture = 1">
                                <img border="0" class="dezrez-thumb">
              <xsl:attribute name="SRC">http://www.dezrez.com/drapp/EstateAgents/<xsl:value-of select="@eid"/>/<xsl:value-of select="@ebid"/>/<xsl:value-of select="@id"/>_1t.jpg</xsl:attribute>
                                </img>
                            </xsl:if>
                            <xsl:if test="@picture = 0 ">
                                <img src="http://www.dezrez.com/drapp/Images/AwaitingPhoto.jpg" border="0" class="dezrez-thumb"/>
                                                    </xsl:if>                           
                        </a>
                    </div>
                    <div class="addressprice">
                        <div class="address">
                            <xsl:value-of select="num"/>: <xsl:value-of select="twn"/>
                        </div>
                        <div class="price">
                        <xsl:choose>
                            <xsl:when test="@price='P.O.A.'">
                                P.O.A.
                            </xsl:when>
                            <xsl:otherwise>
                              €<xsl:value-of select="@priceval"/>
                          </xsl:otherwise>               
                        </xsl:choose>
                        <xsl:if test="@price != @priceconv and @price!='P.O.A.'"></xsl:if>
                        </div>
                    </div>
                    <div class="addressprice">
                        Bedrooms: <xsl:value-of select="@bedrooms"/> Bathrooms: <xsl:value-of select="@bathrooms"/> Garage:
            <xsl:choose>
              <xsl:when test="@garages=&apos;0&apos;">
                <span>No</span>
              </xsl:when>
              <xsl:otherwise>
                <span>Yes</span>
              </xsl:otherwise>
            </xsl:choose> Garden:
            <xsl:choose>
              <xsl:when test="@gardens=&apos;0&apos;">
                <span>No</span>
              </xsl:when>
              <xsl:otherwise>
                <span>Yes</span>
              </xsl:otherwise>
            </xsl:choose>
                    </div>
                    <div class="description">
                        <div align="justify"><xsl:value-of select="concat(substring(description, 1, 300), '...')"/></div>
                    </div>
                    <div class="links">
                      <a>
                            <xsl:attribute name="HREF">http://www.lesixtysix.fr/BeautifulSouth/Results/tabid/119/Default.aspx?PropertyID=<xsl:value-of select="@id"/>
                            </xsl:attribute>Read more...</a>
                        <span class="propertyid" style="display:none">
                            id=<xsl:value-of select="@id"/>
                        </span>
                    </div>
                    <div style="clear:both"></div>
                </div>   
        </xsl:for-each>
    </xsl:template>
<xsl:template name="pagestop">
  <div class="portfolioMessage" id="portfolioMessage">
    </div>
</xsl:template>
<xsl:template name="pagesbottom">
</xsl:template>   
</xsl:stylesheet>

I want the page results links to change the 'page=' at the end of the results url to the appropriate page number so that users can page through the various results.

Ive tried to follow your steps but getting nowhere. Please please please tell me what i need to do to configure this. Ive no idea what to do. Im sorry.

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsXMLXMLPaging with XML module Please Please help!Paging with XML module Please Please help!


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