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, ...Is it bad to modify existing DNN ascx files for custom skin?Is it bad to modify existing DNN ascx files for custom skin?
Previous
 
Next
New Post
6/10/2015 7:46 AM
 

Hi, 

I've create a custom responsive skin for DNN-7 app. To achieve the proposed design, I have made modifications in the files like - login, register, search, etc. which looks great. Maybe an upgrade can easily replace these files and will break my design!

Do you modify the existing ascx files in the DNN core folders?  What is the right way to go forward safely when my goal is to not to change any existing functionality and just change the markup changes for my design?

 
New Post
6/10/2015 9:47 AM
 
Siddharth Pandey wrote:

Hi, 

I've create a custom responsive skin for DNN-7 app. To achieve the proposed design, I have made modifications in the files like - login, register, search, etc. which looks great. Maybe an upgrade can easily replace these files and will break my design!

Do you modify the existing ascx files in the DNN core folders?  What is the right way to go forward safely when my goal is to not to change any existing functionality and just change the markup changes for my design?

 

Yes, it's bad :-)
These (skin objects they are called) will be overwritten on upgrade and you will loose your changes.
Most of these changes should be doable without changing the .ascx files (in the /admin or /DesktopModules folder), by setting the skin objects attributes.
If you cannot accomplish what you want with that you should create your own version of these Skin Objects.
The simplest way is to copy the .ascx and it's code behind file to a folder inside your skin folder and change the reference to the new location.

HTH

 
New Post
6/10/2015 9:51 AM
 

Hi, I tried replicating the search skin object but it didn't worked. Maybe I missed something. 

What do you mean by "change the reference to the new location." ? Just in the skin, right?

 
New Post
6/10/2015 10:55 AM
 
A skin object has to be "registered" in the system so that you can then use it in your skin.  The Wiki has some info on how to create/use skin objects. Essentially, what Timo is telling you to do is to copy the ascx to another location, register your copy with unique token in the system and then use your new skin object in your skin.  The articles in the Wiki should help you get started.

Joe Brinkman
DNN Corp.
 
New Post
6/10/2015 12:07 PM
Accepted Answer 
Siddharth Pandey wrote:

Hi, I tried replicating the search skin object but it didn't worked. Maybe I missed something. 

What do you mean by "change the reference to the new location." ? Just in the skin, right?

 Yes, I mean in the skin.
It would be cleaner to register the ascx controls as a skin object in DNN as Joe suggest.
Especially if you want to re-use them.

But if this is your first try, I suggest to simply copy them without registering them as a skin object extension.
This should work for most of them (unless that have some code behind in another location).
Then in alter stage package and install them as a new skin object.

I use this trick whenever a client says I'm not allowed to separately install skin objects.
I include them in the skin package as I explained :-)

I just did a test with the Search skin object and it does work.

I placed  "search . ascx" and "search . ascx . cs" in the folder: "Controls/Search" in my Skin folder

I use this to register the skin object:
<%@ Register TagPrefix="dnn" TagName="SEARCH" Src="Controls/Search/Search.ascx" %>

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Is it bad to modify existing DNN ascx files for custom skin?Is it bad to modify existing DNN ascx files for custom skin?


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.

Content Layout

Subscribe to DNN Digest

Subscribe to DNN Digest

DNN Digest is our monthly email newsletter. It highlights news and content from around the DNN ecosystem, such as new modules and themes, messages from leadership, blog posts and notable tweets. Keep your finger on the pulse of the ecosystem by subscribing.  


Copyright 2017 by DNN Corp Terms of Use Privacy
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out