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 word based on content of fieldDisplay word based on content of field
Previous
 
Next
New Post
5/6/2010 11:00 PM
 
My client is using an Access DB for maintaining a large list of companies (about 1500). They are exporting the db to a CSV text file that is then being imported into a Form & List module on their website.

There is one column in the Access db that indicates registered status (Yes or No) with a "1" or "0" in that column (they aren't using the logical Y/N field type in Access). Is there any way for F&L to display the word "yes" or "no" based on finding a "1" or "0" in the associated field? I assume that it might be doable via the XSL script, but I know nothing about XSL programming.

Thanks for any suggestions offered!

Jim
 
New Post
5/7/2010 4:29 AM
 
I would create a new query in Access which transforms the data. If the query returns the string true or false, you can convert the column to a true/false column in FnL.
 
New Post
5/7/2010 8:40 AM
 
That would work, but I'm trying to make the module as simple to operate for the client as possible. That being the case, they would go into settings for the FnL and change the field type each time they import. By adding the logic to the template, the field would correctly displayed without tweaking the settings each time.

Do you think you might be be able to write a little xsl code fragment for me?

I would think that a choose / when / otherwise would work. The current line that displays the "1" or "0" in the xsl template is:

<td>
      <xsl:value-of select="udt:FA_Y_x002F_N" disable-output-escaping="yes" />
</td>

I made a wild guess (and of course it didn't work...) with the following:

<td>
   <xsl:variable name="statusType">
      <xsl:variable name="statusType" select="udt:FA_Y_x002F_N" />
      <xsl:choose>
         <xsl:when test="$statusType='1'">
            <xsl:text>Yes</xsl:text>
         </xsl:when>
         <xsl:otherwise>
            <xsl:text>No</xsl:text>
          </xsl:otherwise>
      </xsl:choose>
   </xsl:variable>
</td>

Thanks for any help you can provide!

Jim
 
New Post
5/7/2010 9:18 AM
 
Yes, that should work.
 
New Post
5/7/2010 9:31 AM
 
It didn't work. I figure it had to do with the logic not matching the actual value in the udt:FA_Y_x002F_N field.

I did get it working though :-) With a little more testing and I ended up with the following code.

<xsl:choose>
      <xsl:when test="udt:FA_Y_x002F_N > 0">
         <td><xsl:text>Yes</xsl:text></td>
      </xsl:when>
      <xsl:otherwise>
         <td><xsl:text>No</xsl:text></td>
      </xsl:otherwise>
</xsl:choose>

Thanks again!
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForm and ListForm and ListDisplay word based on content of fieldDisplay word based on content of field


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