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, ...How to check from within container if module is editable?How to check from within container if module is editable?
Previous
 
Next
New Post
2/5/2008 2:16 PM
 

On my portal, I have some rather small modules with little content, which don't need a visible title. The title is required only for internal identification. But for users with edit rights it would be helpful to see the title as soon as they are logged in.

So I thought of checking programatically (with a little VB script in the module container) if the current user has edit rights, and set the title visibility with dnnTITLE.Visible = True/False.

Question:
AFAIK each module has an isEditable property, but I cannot figure out how to access that property from within the container. Any suggestions would be appreciated!

 
New Post
2/6/2008 9:14 PM
 

     Dim objUser As DotNetNuke.Entities.Users.UserInfo = UserController.GetCurrentUserInfo
     If objUser.UserID = -1 Or Not Me.IsEditable Then  'You must be signed in and also have edit priviledges...
        dnnTITLE.Visible = False

     Else
        dnnTITLE.Visible = True
     End If


    - Doug Vogel     

 
New Post
2/7/2008 1:21 PM
 

Thanks a lot for the answer! But I have one more question (I should have mentioned that I'm no programmer):

Where would you put that code? I planned to put it in a page onload handler in the module container .ascx file, but there it doesn't work, because the "Me" in "Me.IsEditable" refers to the page object, not to the module (and there is no Page.IsEditable property).

 
New Post
2/11/2008 1:45 AM
 

Any other suggestions?

 
New Post
2/11/2008 12:05 PM
 

I've never used this in a container.

But here's an example lline of code out of a custom module's .ascx file:

<asp:Image id="editLinkImage" AlternateText="Edit" Visible="<%#IsEditable%>" ImageUrl="http://localhost/PHDnet/images/edit.gif" runat="Server" resourcekey="Edit"/>

So maybe try placing Visible="<%#IsEditable%>"  in a custom container & see what Happens?


    - Doug Vogel     

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...How to check from within container if module is editable?How to check from within container if module is editable?


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