• Login
  • Register

DNN Forums

Ask questions about your website to get help learning DNN and help resolve issues.

Best Practice to store Custom CSS/JS in Resources folder

You are not authorized to post a reply.
Sort:


New Member


Posts:3
New Member

    Hi Team,

    just wanted to check, Is there any harm to store custom CSS/JS in Resources folder. is there any chances that it can be overwritten when we upgrade DNN. 

    Do we have any best Practice to store Custom CSS/JS in DNN e.g. site assets or desktop folder etc.

    Thanks in advance!



    Advanced Member


    Posts:246
    Advanced Member

      you may store custom css in portal.css file or any css/JS in individual skin folder or any custom subfolder folder inside /desktopmodules or /providers



      New Member


      Posts:3
      New Member

        Thanks a lot, Sebastian Leupold 

        Is it bad to store custom files in the Resources folder? is there any chance that it can be overwritten when we upgrade DNN?



        Veteran Member


        Posts:980
        Veteran Member

          Not necessarily a bad idea, but there are probably better places to store custom files. And the answer to "where" depends on the intended purpose of the custom files. What is the use of the files?
          Joe Craig
          DNN MVP
          Patapsco Research Group


          New Member


          Posts:3
          New Member

            thanks, Joe Craig

            Idea is to create a common module for all shared static resources.

            These are CSS/JS shared files across the portals, which we want to put in the Resources folder through the install package.



            Veteran Member


            Posts:980
            Veteran Member

              I'd probably use a custom folder, and I'd also probably put it in Portals/_default to make sure that it's more accessible to the Global Assets manager.
              Joe Craig
              DNN MVP
              Patapsco Research Group


              Advanced Member


              Posts:246
              Advanced Member

                /Resources is usually kept for DNN system resources and common JS libraries (installed by DNN), like jQuery and Knockout.
                Resources, you need for your custom extensions, should be placed in /desktopmodules/ or /providers/ subfolder, preferably using an individual name prefix or all stored in subfolders of a company folder, like /desktopmodules/mycompany/mymodule/ or /desktopmodules/mycompany/shared/. This convention prevents name conflicts and your libraries are easily identificable.
                For design files, DNN uses for historical reasons subfolders inside /portals/_default/skin/, /portals/_default/container/, /portals/[portalid]/skin and /portals/[portalid]/container. these are the best places for most of your visual resources, which are not tight to functional extensions. Have a look at existing folder structures of modules and themes included with DNN or availaible on this site or in the store.
                Just ask, if you still are having any questions :)


                Veteran Member


                Posts:814
                Veteran Member

                  Posted By Jasbir on 06 Apr 2021 02:09 PM

                  thanks, Joe Craig

                  Idea is to create a common module for all shared static resources.

                  These are CSS/JS shared files across the portals, which we want to put in the Resources folder through the install package.

                  As long as you use a unique path, these will not be overwritten.
                  BTW, you can create a package just for installing resources.

                  https://www.dnnsoftware.com/wiki/ma...-component

                   

                   



                  Veteran Member


                  Posts:521
                  Veteran Member

                    There is also a module for that I use quite often: Will Strohl's Content Injection, available here: github.com/hismightiness/dnnextensions. The current release can be found here.

                    Happy DNNing!
                    Michael

                    Michael Tobisch
                    DNN★MVP

                    dnnWerk Austria
                    DNN Connect
                    You are not authorized to post a reply.

                    These Forums are dedicated to discussion of DNN Platform.

                    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.

                    Would you like to help us?

                    Awesome! Simply post in the forums using the link below and we'll get you started.

                    Get Involved