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 Listdisplay both name and valuedisplay both name and value
Previous
 
Next
New Post
8/21/2012 3:30 PM
 

Thanks for the reply, Stefan.  I'm trying to get my head around this.  Let me try applying this to my situation and see if this is what you are saying:

So I have a stylesheet I created using the built-in generator.  I have a value list with four items, names of courses for an online training.  Each course has an associated email address; that of the instructor.  I want FnL to email an instructor based on the course name chosen in the form, and in the body of the email I want to display the course name AND the email address.

So I will end up with a series of 

<xsl:when test="udt:Course='instructor1@email.com'">  

CourseName

<xsl:when>

statements, one for each item in the value list?  The last one being the "otherwise" statement?

So I'm actually coding my value list into the stylesheet, and if I add more courses, I will not only need to edit the dropdown list for the "Course" field, I will need to add another "when test" to the stylesheet?  Is that correct?


 
New Post
8/22/2012 1:54 AM
 

Jerry, yes. At least this approach is simple and straight forward. The "otherwis"e part is optional, it could all be handled with "when" statements.

One other way would be to examine the setting string, split it into a collection of name value pairs, and look up the right name for the key. But this is not obvious for a beginner in XSLT.

There is one big problem is both designs: what happens if one instructor serves two or more courses?


 
New Post
8/22/2012 3:11 AM
 

This worked for me in showing name value pairs

<xsl:template match="udt:Data" mode="list">
<div class="dnnGridItem">
<xsl:for-each select="*[not (contains(name(), 'x00')) and not (contains(name(), 'EditLink')) and not (contains(name(), 'RowId'))]">
<b>
<xsl:value-of select="local-name()" />
</b> : <xsl:value-of select="." /><br /></xsl:for-each>
</div>
</xsl:template>

Replace the list section of your xsl with the above and modify it

what I am doing is here is taking the list collections and i do an for each * since I want every element per row and then I just filter out the rows not pertaining to my original dataset ( so all the auto injected udt xml elements )

 
New Post
8/22/2012 12:11 PM
 

Armand, this is a bit off topic. Jerry is asking about the name|value collections for option lists, combo fields. The field contains only the value, but he wants to display also the name which was shown in the form.

That infomation resists inside the xml within the following XPath: udt:UserDefinedTable/udt:Fields[udt:FieldTitle='fieldname']/udt:Inputsettings 
for example <InputSettings>name1:value1|name2:value2</InputSettings>

The field node contains only value1, but he want to return both name1 and value1 inside the email text. We both would write a template for that,  won't we? 


 
New Post
8/23/2012 5:12 AM
 

Oh my bad

yeah seeing in .Net we cant use XSLT 2.0 function in combination with XPATH 2 this would have to be done using the template option suggested earlier

 

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForm and ListForm and Listdisplay both name and valuedisplay both name and value


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