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 ListRestricting access with User RightsRestricting access with User Rights
Previous
 
Next
New Post
3/23/2009 11:21 AM
 

Yes, this is manageable.

  1. Add a field  named "Restricted", type boolean, and disable "visible", so that column won't appear in a default grid. Enable required and set the default value to false.
  2. Generate a XSL-Stylesheet.
  3. Edit the generated XSL: look for

      <xsl:template match="udt:Data" mode="list">
         <tr class="Normal">
             ....
            </tr>
       </xsl:template>

    and change it to

      <xsl:template match="udt:Data" mode="list">
        <xsl:if test="udt:Restricted_UDT_Original = 'false' or
                              contains(/udt:Context/udt:UserRoles, ''|Subscriber|">
            <tr class="Normal">
             ....
            </tr>
         </xsl:if>
      </xsl:template>

 

 
New Post
3/23/2009 11:36 AM
 

in addition to Stefan's previous post, please be aware, that UDT:Context is a new option available in form and List (UDT5) only.


Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
3/23/2009 12:38 PM
 

Sorry, Sebastian is wrong.

udt:Context is part of UDT since UDT 3.3., (Documentation P.46, chapter "Advanced XSLT)

 
New Post
3/29/2009 11:32 PM
 

Many thanks.  I will give it a go and if I have any questions (which I am sure I will), I will be back in touch.

 
New Post
4/5/2009 9:33 PM
 

Have inserted the suggested code using a simple table layout and am getting an "XSL Tranformation failed" error.  The template i have made has 3 columns - Name, Description, and for test purposed, the restricted column.  The template I have constructed is:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:udt="DotNetNuke/UserDefinedTable">
  <xsl:output method="xml" indent="yes" omit-xml-declaration="yes" />
  <!--
  This prefix is used to generate module specific query strings
  Each querystring or form value that starts with udt_{ModuleId}_param
  will be added as parameter starting with param
  -->
  <xsl:variable name="prefix_param">udt_<xsl:value-of select="//udt:Context/udt:ModuleId" />_param</xsl:variable>

  <xsl:template match="udt:Data" mode="list">
    <xsl:if test="udt:Restricted_UDT_Original='false' or contains(/udt:Context/udt:UserRoles,'|Subscriber|'">
      <tr class="normal">
        <td>
          <xsl:call-template name="EditLink" />
        </td>
        <td>
          <xsl:value-of select="udt:Name" disable-output-escaping="yes" />
        </td>
        <td>
          <xsl:value-of select="udt:Description" disable-output-escaping="yes" />
        </td>
        <td>
          <xsl:value-of select="udt:Restricted" disable-output-escaping="yes" />
        </td>
      </tr>
    </xsl:if>
  </xsl:template>

  <xsl:template match="/udt:UserDefinedTable">
    <xsl:variable name="currentData" select="udt:Data" />
    <table>
      <xsl:apply-templates select="$currentData" mode="list">
      </xsl:apply-templates>
    </table>
  </xsl:template>

  <xsl:template name="EditLink">
    <xsl:if test="udt:EditLink">
      <a href="{udt:EditLink}">
        <img border="0" alt="edit" src="{//udt:Context/udt:ApplicationPath}/images/edit.gif" />
      </a>
    </xsl:if>
  </xsl:template>
</xsl:stylesheet>

What have I done wrong?

Thanks.

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForm and ListForm and ListRestricting access with User RightsRestricting access with User Rights


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