John Mitchell Posts:3352


| | 03/20/2007 10:28 PM |
| If you are looking for a way to have conditional content shown in your skin without having to use a module, you can do it with some inline code. <% If DotNetNuke.Security.PortalSecurity.IsInRoles(PortalSettings.AdministratorRoleName) %> Admin only content here <% End If %> | | | |
|
|
|
cgrill Posts:5

| | 04/06/2007 9:32 AM |
| Is there a way to conditionally show content from every page once logged, and not just from admin pages. I'd like to provide page editors with some additional restricted content. Great tips. Keep them coming! thanks, cpg | | | |
|
cgrill Posts:5

| | 04/06/2007 9:36 AM |
| | oops, that first part show read "...from every page once logged in" | | | |
|
John Mitchell Posts:3352


| | 04/10/2007 8:06 AM |
| Sorry I didn't get to this sooner. If you put the above code into your skin it will show on every page that uses that skin. Put it in as many skins as you need to get it on all the pages that you want. If you want the code for specifying other roles then let me know. | | | |
|
nina Posts:41

| | 04/17/2007 5:05 PM |
| Hi John - I want to add another role on skincovered. I want to put my CSS icons so that only they see them.
What do I change in the code to allow specific roles to see things.
Nina | | Nina
http://www.xd.com.au http://www.skincovered.com
....Make sure you last words are sweet.. you never know when you have to eat them... | |
|
John Mitchell Posts:3352


| | 04/17/2007 5:25 PM |
| Hi Nina,
That would be done like this:
<%If DotNetNuke.Security.PortalSecurity.IsInRole("Skincovered Role") Then %>
Role Based Content
<% End If %> | | | |
|
nina Posts:41

| | 04/17/2007 5:51 PM |
| Thanks - so I can make the careful assumption on putting the actual name of the role in, exactly as it's displayed.
I'll give it a try.
Cheers
Nina | | Nina
http://www.xd.com.au http://www.skincovered.com
....Make sure you last words are sweet.. you never know when you have to eat them... | |
|
dnncreative Posts:19

| | 05/23/2007 5:51 AM |
| Hi John,
Is it possible to use this method to display content to users who are not in a role? ie taking ninas example any users that do not have the "Skincovered Role"
Thanks, | | | |
|
nina Posts:41

| | 05/23/2007 6:19 AM |
| Hi Lee Wouldn't that be the Unauthenticated users role.. that's everyone who's not logged in? Nina | | Nina
http://www.xd.com.au http://www.skincovered.com
....Make sure you last words are sweet.. you never know when you have to eat them... | |
|
dnncreative Posts:19

| | 05/23/2007 6:29 AM |
| Hi Nina,
Thanks for responding - It's been a while since we have had a chat - hope everything is going ok over at your end of the world!
Unfortunately it's not that simple. - There are registered users who are logged in and unauthenticated users that I want to display content to if they do not have a 'subscriber' security role. - So I want to display content to every security role except the 'subscriber' role.
Thanks,
Lee | | | |
|
nina Posts:41

| | 05/23/2007 6:51 AM |
| Everything is going well - not enough hours in the day - perhaps I can borrow some of your daylight hours - :-) No doubt you're keeping busy too. I wonder if John would know any code that has an 'exclusion' instead of 'inclusion'. But by default the registered users are also the subscribers of information - they share that role - so I think you'd need an exclusion - that said - ok you're a registered user but NOT a subscriber.. so you see this.. Does that make sense - either way - John will see this and may come up with suggestion. Nina | | Nina
http://www.xd.com.au http://www.skincovered.com
....Make sure you last words are sweet.. you never know when you have to eat them... | |
|
dnncreative Posts:19

| | 05/23/2007 7:08 AM |
| Hi Nina,
Glad to hear all is ok, yes keeping busy over here as well!
Yes it's an exclusion type code that I need as a user can be in several roles at once - a NotIn type rule | | | |
|
John Mitchell Posts:3352


| | 05/23/2007 7:40 AM |
| Hi Lee, Thanks for the question. That can be done by adding one word to the logic -
<%If NOT DotNetNuke.Security.PortalSecurity.IsInRole("Skincovered Role") Then %>
Put Content here for everyone not in the subscriber role
<% End If %> | | | |
|
dnncreative Posts:19

| | 05/23/2007 7:43 AM |
| ha ha brilliant of course!
Thanks John | | | |
|
dnncreative Posts:19

| | 05/23/2007 7:53 AM |
| ok that works great in the skin code, is there a way to get this to work in a Text / HTML module?
Thanks,
Lee | | | |
|
John Mitchell Posts:3352


| | 05/23/2007 7:57 AM |
| No, it is server side code that is processing, but I will be adding that ability to PageBlaster soon.
The only thing you can do for now in an html module is set view access to every other role but that one. | | | |
|
dnncreative Posts:19

| | 05/23/2007 8:41 AM |
| Very interesting, I haven't looked at PageBlaster yet so I've just read through the manual, this looks to be a very powerful module. - Takes me back to those MagicGadget days in dnn2 ;-) - I've got several clients who are stuck in DNN2 because of magic gadget but this may solve all of their problems!
I know you are very busy but do you have any idea when you will be adding it to the module? - I'm needing to find a solution to the text / html content for a re-design I'm currently doing for DNN Creative. - I've gone the pure css skin route and I'm literally having to recode every single text / html module and tab across the entire site. If I can integrate this module in while I am doing these changes that would be great. - I'm hoping to have a localhost version completed by June is there any chance in PageBlaster being ready by then?
Thanks, | | | |
|
John Mitchell Posts:3352


| | 05/23/2007 8:51 AM |
| Yes, it is like MagicGadget and a lot more. Did you know you can also use it to make your pages validate XHTML strict? I'd like to work with you on getting DNNCreative.com using PageBlaster.
Send me an e-mail by replying directly to the notification from this post. | | | |
|
dnncreative Posts:19

| | 05/23/2007 9:08 AM |
| | I've sent you an email, thanks, Lee | | | |
|
jncraig Posts:79

| | 05/23/2007 7:47 PM |
| To paraphrase the Mastercard ad ..
This thread: $1000's
Getting to watch John, Nina, and Lee collaborate: PRICELESS!
Seriously, this is a valuable thread! | | | |
|