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 ListF&L/UDT Search with Drop-Down ListsF&L/UDT Search with Drop-Down Lists
Previous
 
Next
New Post
10/30/2009 1:47 PM
 

Stefan (or someone else)....

I'm hoping that someone can nudge me in the right direction for this.

Using some guidance from Stefan, I created a search drop-down using XSLT and Muenchian grouping.

I added the following near the top of my XSLT:

  <xsl:key name="data-by-Author" match="udt:Data" use="udt:Author" />

I then modified the Search portion of the XSLT:

  <xsl:template name="Searchform">
    <select name="{$prefix_param}_searchPostback">
      <option value="">ALL</option>
      <xsl:for-each select="udt:Data[count(. | key('data-by-Author', udt:Author)[1]) = 1]">
        <xsl:sort select="udt:Author" />
        <option>
          <xsl:value-of select="udt:Author" disable-output-escaping="yes" />
        </option>
      </xsl:for-each>
    </select>

What if I want 2 drop-down search columns (Author and Publisher)?  Can anyone give me a push in the right direction?

My UDT is at http://www.devodog.us/MyStuff.aspx (the Books module).
    <input type="submit" name="go" value="{//udt:Context/udt:LocalizedString_Search}" />
    <input type="hidden" name="{$prefix_param}_ispostback" value="true" />
  </xsl:template>

 
New Post
11/3/2009 7:31 AM
 

Mike, thank you for sharing this example.

Adding a second drop down is quite easy, you would add a second select, but now with a new name, for example name="{$prefix_param}_searchPostback2".

The filter is most times quite easy, but it gets more complex if paging is enabled. The xslt script doesn't use viewsate, that way the whole state needs to be transferred via querystring.

 

 
New Post
11/18/2009 7:56 PM
 

Hey Stephan, trying to follow the above example, and got it most of the way.  I too wanted dual search dropdowns, one for State and one for a Certified Level for Instructors.  The state search is performing beautifully, but the Certified level search is not working.  It seems as if the search is performed solely off of the first dropdown.  Any advice you could lend would be amazing. 

Here's my search template code:

  <xsl:key name="data-by-State" match="udt:Data" use="udt:State" />
  <xsl:key name="data-by-Level" match="udt:Data" use="udt:Certified_x0020_Level" />

  <xsl:template name="Searchform">
    <div style="padding-right:15px; float:left;">
      State:
      <select name="{$prefix_param}_searchPostback">
        <option value="">ALL</option>
        <xsl:for-each select="udt:Data[count(. | key('data-by-State', udt:State)[1]) = 1]">
        <xsl:sort select="udt:State" />
        <option>
          <xsl:value-of select="udt:State" disable-output-escaping="yes" />
        </option>
        </xsl:for-each>
      </select>
      <input type="submit" name="go" value="{//udt:Context/udt:LocalizedString_Search}" />
      <input type="hidden" name="{$prefix_param}_ispostback" value="true" />
    </div>
    <div style="padding-right:15px; float:left;">
      Certified Level:
        <select name="{$prefix_param}_searchPostback2">
          <option value="">ALL</option>
          <xsl:for-each select="udt:Data[count(. | key('data-by-Level', udt:Certified_x0020_Level)[1]) = 1]">
          <xsl:sort select="udt:Certified_x0020_Level" />
          <option>
            <xsl:value-of select="udt:Certified_x0020_Level" disable-output-escaping="yes" />
          </option>
        </xsl:for-each>
      </select>
      <input type="submit" name="go" value="{//udt:Context/udt:LocalizedString_Search}" />
      <input type="hidden" name="{$prefix_param}_ispostback" value="true" />
    </div>
  </xsl:template>

The website is http://www.hankhaneygolfinstructor.com/CertifiedInstructorLocator/tabid/214/Default.aspx if that helps at all.

Thanks in advance!!

-Dustin Eatchel.
JC Video Systems

 
New Post
11/19/2009 4:53 PM
 

Dustin, you mastered the rendering part of the search form, now you need to start using the input.

If you enable search, the generator adds also these parameters in the beginning of the XSL script.:

  <xsl:param name="param_search" />
  <xsl:param name="param_searchpostback" />
  <xsl:param name="param_ispostback" />
  <xsl:variable name="search">
    <xsl:choose>
      <xsl:when test="$param_ispostback">
        <xsl:value-of select="$param_searchpostback" />
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="$param_search" />
      </xsl:otherwise>
    </xsl:choose>
  </xsl:variable>

What is missing in your case is the handling of the certified level. This would be placed in the parameter $param_searchpostback2

<xsl:param name="param_searchpostback2" />

and you need to tell your script what to do with the parameter, you want to filter.

Btw. the old filter statement is a bit outdated. Our team member Brett wrote a lesson about how this can be rewritten in FnL.

I hope you can combine this to get your problem solved.

 
New Post
6/23/2010 5:01 PM
 
I am close to figuring this out.. But it is not doing it exactly yet
<xsl:variable name="prefix_param">udt_<xsl:value-of select="//udt:Context/udt:ModuleId" />_paramxsl:variable>
  <xsl:param name="param_search" />
  <xsl:param name="param_searchpostback" />
  <xsl:param name="param_searchpostback2" />
  <xsl:param name="param_ispostback" />
  <xsl:key name="LessonLevel" match="udt:Data" use="udt:Lesson_Level" />
  <xsl:key name="ModuleUsed" match="udt:Data" use="udt:Module" />
  <xsl:variable name="search">
    <xsl:choose>
      <xsl:when test="$param_ispostback">
        <xsl:value-of select="$param_searchpostback" />
      xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="$param_search" />
      xsl:otherwise>
    xsl:choose>
  xsl:variable>

<xsl:template name="SearchForm">
   <div style="padding-right:15px; float:left;">
     Module Used:
   <select name="{$prefix_param}_searchPostback"><option value="">ALL><xsl:for-each select="udt:Data[count(. | key('LessonLevel', udt:Lesson_Level)[1]) = 1]"><xsl:sort select="udt:Lesson_Level" /><option><xsl:value-of select="udt:Lesson_Level" disable-output-escaping="yes" />option>xsl:for-each>select><input type="submit" name="go" value="{//udt:Context/udt:LocalizedString_Search}" /><input type="hidden" name="{$prefix_param}_ispostback" value="true" />div>
   <div style="padding-right:15px; float:left;">
     Difficulty Level:
   <select name="{$prefix_param}_searchPostback2"><option value="">ALL><xsl:for-each select="udt:Data[count(. | key('ModuleUsed', udt:Module)[1]) = 1]"><xsl:sort select="udt:Module" /><option><xsl:value-of select="udt:Module" disable-output-escaping="yes" />option>xsl:for-each>select><input type="submit" name="go" value="{//udt:Context/udt:LocalizedString_Search}" /><input type="hidden" name="{$prefix_param}_ispostback" value="true" />div>
 xsl:template>

and then my filter statement is

[Module] LIKE '*[Form:udt_15612_param_searchPostback]*'

I know i am missing the searchPostback2 in both the filter and the search parameter but what is the syntax for adding in that 2nd filter element?
and then my filter statement is I know i am missing the searchPostback2 in both the filter and the search parameter but what is the syntax for adding in that 2nd filter element?
and then my filter statement is I know i am missing the searchPostback2 in both the filter and the search parameter but what is the syntax for adding in that 2nd filter element?
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForm and ListForm and ListF&L/UDT Search with Drop-Down ListsF&L/UDT Search with Drop-Down Lists


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