Custom Interface for different user in DNN.. How to? - asp.net

I am new to DotNetNuke; I have following situation please suggest what are the options for me to target this situation.
I have a website which is in .Net (No CMS and pure logic only) and client want it to be migrated in DNN. Please let me know how to do this? what are the steps i need to perform and how should i approach ahead?
More to this; In DNN I want to do customization per users (or members of my website); so for that which module I should choose? My customization will be like if User A logged in my website then Skin A should be shown and if User B logged in then skin B should shown.
I want to extent this scenario.
I also wanted to know how can I make my website mobile enable?

1) Make a DotNetNuke module for each bit of unique functionality (example: each report) on your old ASP.NET site.
2) Make a content page for everything else (static pages)
3) For each module that you created, create a single content page and add each module to their own content page.
4) Make sure to categorize your users with the appropriate DNN user roles
5) To change the skin dynamically based upon the user's role, see this snippet, from DotnetNuke Corp:
There are a few different ways to dynamically or programmatically change the skin for a specific page load. DotNetNuke will look first for an override value in the URL. If specific value is found, then DNN will load that skin and/or container on that page load. Second, DNN will look in a local cookie to see if there is a skin being defined. Finally, if the first two methods did not specify a skin to load, DNN will load the default skins defined by the page or site. In the event that the skin doesn’t exist, the default skin that ships with DNN will be loaded.
This is why it’s important to not delete the original skin package after installing.
Probably the best way to approach dynamically loading a skin based on security role would be to create a simple cookie using either a DotNetNuke module, or HttpModule. Either way, you will be able to retrieve the user information, and based on the IsInSecurityRole() property, generate a cookie that will in effect load the desired skin.
6) Look at MobiNuke for adapting your site to be mobile-friendly

Related

Angular5 app conditionally load script and styling according to component

My angular application consist of 2 parts based on public and private pages:
1- Landing Page (Before Login)
2- Dashbaord and other Pages (For Authorized User)
Landing page component contain signup/login functionality and some other static html elements.
Both are seprate components and have different stylings. I have already mentioned landing page's styling in it's own style file.
After login user can access multiple pages including dashboard,users pages etc, and they share common stylings, they also have common components like header,sidebar etc, since they all share same styling, i will have to mention it in app component so that it inherit all stylings automatically.
How can i seprate rest of the page stylings with landing page ?
What will be the bets approch to handle this situation?
PS: I was also thinking about creating seprate applications under same project, is this method relevant handling multiple applications with angular cli
?
Yes, having multiple applications makes sense for your case. However, I would recommend keeping login pages free from any framework. We are developing something similar at work. We have login pages with plain html and css. When user logged in successfully, s/he can access angular application. Angular is great and we all love it but it comes with bunch of dependencies you are not aware of. Keeping pages, related to security, free of any framework is better in my opinion. It would mean you have to duplicate stylings for header, footer etc. but it would worth it.
Take a look at this article that is published recently. It lays out a great security risk if you don't know what you are shiping to your users.
P.S: Dependencies of angular are probably OK, however you cannot assume things are safe when it comes to security.

Can Sitecore templates be used to store SQL Queries or JavaScript

We are building a Page with dynamic functionality using ASP.NET + Sitecore 7.0.
Is it practical and appropriate use Sitecore templates for:
SQL Stored Procedure Name to be invoked
JavaScript to be invoked
ColumnNames to be used etc (related to coding customization)
Or should these configuration properties remain inside the ASP.NET Project itself?
What is the primary purpose of Data Templates in Sitecore?
Are they for developer customization or customer-level customization?
The purpose of a data template in Sitecore is to define the set of fields for content items which inherit from that template. - Think of a data template as a class and the content items (pages) as instances of that class.
Templates are usually used to define the user-editable content of pages within a site, that being said you can have items to store information which is not managed by regular content editors. The question is where do you draw the line between things which should be put into Sitecore and things which should be a part of the solution. My advice is only put things in Sitecore if they need to be there. If you have to have the ability for editors or admins to configure those settings/properties.
I would say that putting SQL/ColumnNames is probably a bad idea unless you are building some sort of report builder interface in which case it may be essential?
Likewise with placing JavaScript into Sitecore; this can be OK in moderation (e.g. snippets of analytics code which content editors may want control over?). If you're placing whole libraries of JavaScript into Sitecore, you're probably doing it wrong.
One final point to note is findability/re-factorability of code: if you have code spread between Sitecore and your solution, it can make it very difficult to maintain as it is difficult to get a complete overview of code involved.

Switching between skins with DotNetNuke

I just need help with this, I'm building a web site and i want each user to choose the skin he wants, where i give him two options and he will choose the one he likes.
Is there any way to do this with DotNetNuke?
Thanks
There are 2 parameters that you can pass. SkinSrc and ContainerSrc which take skin and container paths as values. Maybe you can keep the preference in a session then add to the querystring in page pre_init event.

How to change Css class using JQuery?

I have an multi user application with basic layouts where i want to change the layout and style of the page for individual user .
I have one way in mind that to change the css at run time but if i am changing the css then it will take effect for every user and if i will refresh the page then it shows basic page again.
Help me for this problem that if i will change the css then it will take effect only for the same user.
and it will not change after refresh.
Or any buddy has any other idea then please suggest me.
$("div#somediv").addClass("specialuserclass");
JQuery reference or have a stylesheet per user;
You might be interested in doing this using themes and the theme manager plugin I built. The plugin is built to work with jQuery UI themes, but could easily be adapted to your own custom CSS-based themes. This plugin works with individual user preferences for a particular theme stored in a database, though I suppose you could also use a cookie. the latter would take more customization. You can find more info on my blog, http://farm-fresh-code.blogspot.com.
You have to persist the style chosen by each user.
Your can design your function/screen to something like:
1. On create of a new user, give the user the default basic layout and persist this in the server side (you can probably save the user preference in your DB).
2. When he changes style, update the user's user preference record/file
3. On load of the page, retrieve the user preference and change the css style on the server side
If you want to implement this yourself, store your user-specific styles in a dedicated store such as a database, indexed by user. At page construction time (server side) consult your database, looking up the customizations for that user, and apply the CSS you want to that page.
Alternatively there are a variety of theming applications available. These will depend on your server-side tools. For example, ASP.NET offers the Web Parts Framework.

Implementing a 'reverse' or 'nested' master page with ASP.NET

I'm hoping my cryptic title isn't too cryptic, but I'll try to explain what it is I actually want to do.
I have a master page 'A' which has child pages 'B' and 'C'.
This is implemented with the standard master page model in ASP.NET just fine.
My site has two themes 'T1' and 'T2'.
They actually represent different partners, T1 being our own company and T2 is a partner.
I want to display specific things on pages 'B' and 'C' depending upon which theme I'm using. For instance I may want to insert additional buttons or graphics on page 'B' specific to partner for theme 'T2'. This content would be at an arbitrary point on the page depending upon the page itself. Some partners may not even use this feature.
The problem is I want to do this as declaratively as possible, and minimize the knowledge that the pages have about the theme.
This is where the 'reverse' master page concept comes in. I want to define an area on a child page into which 'theme' specific content can be inserted. (I'm saying 'theme' because thats what ASP.NET uses - and most likely what I'd tie the content to).
So you may be wondering :
Why can't you just use a master page for this and add extra content sections? Reason is that the content may appear anywhere on the page in a location that is specific to that page.
Why can't you use a 'nested' master page? Essentially the same reason.
Possible solution:
I'm wondering about creating some kind of user control that would have a textual key representing what type of content would be inserted there. The user control would have to know what to display for each 'theme' - probably by dynamically creating the relevant additional user control.
This seems a little clumsy - so I'm wondering what kind of solutions others may have created for similar situations.
you can use CSS to position your content sections anywhere on your page. so i wouldnt worry about page locations, etc.
if it were me, i'd just dynamically load the 2 different css files into the one masterpage and based on the same logic render the different content into the placeholders.
I'm currently working on a site that has similar requirements that are too much for CSS. In one layout the login is horizontal towards the top of the render order, and in another its in the right hand column.
We're using standard ASP.NET themes to push out CSS, logo URLs via SkinID, etc.
To obtain the custom layout I've created a "Loader" control that loads UserControls via a list specified in a Loader attribute. The attribute can be defined directly in the loader markup, or via a .skin file in the theme.
Each key in the list is just the base name of a UserControl (I add the path and extension). The controls are created via Page.LoadControl().
Do you have fix layout for different partners ? Or do you want the partners to choose the layouts on runtime ?
If the layouts are fixed than 1 way is to create zen style CSS (http://www.csszengarden.com/) and than dynamically load it as per the client/partner. If you want the partners to modify the layouts on runtime than probably you might want to use Webparts.
Hope this helps.
You CAN use nested master pages in VS2008!
See here --
Scott Guthrie's Blog

Resources