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

HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Conditional Rendering of Container ObjectsConditional Rendering of Container Objects
Previous
 
Next
New Post
7/23/2008 9:29 PM
 

Hi,

In my container I want to render only parts that should be visible. At this stage I want to apply code similar to one below (just directly editing .ascx file) (using C#):

 

<%
public bool IsIconVisible() {
  return true; // What should be here to determine if ICON is available?
}
public bool IsEditable() {
  return true; // What should be here to determine if module is in edit mode?
}
%>

<% If (IsIconVisible()) { %>
<dnn:ICON runat="server" id="dnnICON" />
<% }%>
<% If (IsEditable()) { %>
<dnn:ACTIONBUTTON runat="server" id="sttngs" CommandName="ModuleSettings.Action" />
<% }%>

 

So the main question is how to write IsIconVisible and IsEditable functions.

Thanks,
Dmitriy.

 
New Post
7/27/2008 2:24 PM
 

Hey Dmitriy,

Can you give an example - a "for instance" - of what you are trying to accomplish? There are probably several ways to go about solving the issue (or "meeting your requirements") - so I'd like to have a clear understanding of what the business requirement is first.

Thanks,

Ian


Software Engineer
Co-Founder, dnnGallery
Stack Overflow: Ian Robinson
Twitter: @irobinson
Linked In: Ian Robinson
 
New Post
7/29/2008 1:01 AM
 

Hi Ian,

At this stage it's not a business requirement, but rather technical one.

As a sample let's have a look at the "Text Header - Color Background.ascx" container from DNN installation.

It renders main table. Then first row has table with:

  • ACTIONS
  • ICON
  • TITLE
  • VISIBILITY

Each SkinObject is contained withing a table cell. In most cases the cells are blank (except TITLE,VISIBILITY) for non authenticated users.
Thus I don't see a reason table cells for ACTIONS, ICON to be rendered at all.

So depending on some condition I want to hide those cells (at least using colspan or DIVs+CSS instead of tables).
The aim for now - let the container skin to render cleaner HTML.

Cheers,
Dmitriy.

 
New Post
7/29/2008 1:14 AM
 

I don't know about the IconVisible, but for the IsEditable, remove the (). It is a variable in the PortalModuleBase that is inherited to the module.

Though - I agree that knowing what you are trying to do might allow us to give you a better method.

 
New Post
7/29/2008 10:29 AM
 

Hey Dmitriy,

Try taking a look into the DotNetNuke.Security class, you could use the HasNecessaryPermission method to find out if the user has edit permissions for the current context.

Take care,

Ian


Software Engineer
Co-Founder, dnnGallery
Stack Overflow: Ian Robinson
Twitter: @irobinson
Linked In: Ian Robinson
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Conditional Rendering of Container ObjectsConditional Rendering of Container Objects


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