The Robertson Team


 

 
 

 

 

 

 

 

 

 

 

 

 

 

 

 
 
 
  Programmers' Tools >  ContentMonger >  Registered User Area >  FAQ >  How Do I Add A New Section?
 

How Do I Add A New Section?

Synopsis:
To create a new section you make a copy of the ENTIRE cmpro file/tree structure. Then you paste that into a new folder inside your CMPro tree structure. THEN you delete the folders you don't need. THEN you create the section inside of the CMPro admin area and set the urls and paths for this new section to point to your new file set. Lastly, you set the section name in the new section's copy of /Application.cfm.

  1. Initially, your CMPro installation looks like this (going down one level only):
    /(root with files in it)
    /admin/
    /cart/
    /fckeditor/
    /images/
    /includes/
    /install/
    /lang/
    /lmenu/
    /menu/
    /tags/
    /toolbox/
    /vgmenu/

     
     
  2. On any installation, you should always remove the /install/ folder after completing the install routine, and also delete the menu systems you have decided you won't be using. Plus the toolbox is for information only during development, so it can go on a production box. Assuming you are using the Vertical Graphic menu system, and you aren't going to be using the shopping cart, your tree now looks like this:
    /(root with files in it)
    /admin/
    /fckeditor/
    /images/
    /includes/
    /lang/
    /tags/
    /vgmenu/

     
     
  3. Now, you want to create a new section named WooHoo. Before you actually create anything, inside of Windows Explorer click on the root folder of your CMPro installation in the left window. Select all the files in the window (Edit/Select All). COPY this to the clipboard (Edit/Copy). 
     
     
  4. Create a new folder underneath the root of your CMPro installation. Call the folder something sensible or memorable. In this case we’ll match the section name. Now the tree looks like this:
    /(root with files in it)
    /admin/
    /fckeditor/
    /images/
    /includes/
    /lang/
    /tags/
    /vgmenu/
    /woohoo/
     
     
     
  5. In Windows Explorer, click on the new folder in the left pane so its (empty) contents are displayed in the right pane. Right-click into this right pane and choose Paste. The WHOLE CMPro system will now copy into this new folder. 
     
     
  6. In the COPY you just made (!) Delete the /admin/ folder and all of its children (one admin area will serve the entire CMPro system). Your tree now looks like this:
    /(root with files in it)
    /admin/
    /fckeditor/
    /images/
    /includes/
    /lang/
    /tags/
    /vgmenu/
    /woohoo/(root with files in it)
    /woohoo/admin/
    /woohoo/fckeditor/
    /woohoo/images/
    /woohoo/includes/
    /woohoo/lang/
    /woohoo/tags/
    /woohoo/vgmenu/

    Note that this creates a section that uses the vertical graphic menu. If instead you want to use the Inverted L menu or one of the others, copy in the necessary folder from a clean copy of the CMPro installation and delete the unnecessary /vgmenu/ folder (the default html menu's files are in the root folder and thus are always present). Note also that if you have done design and upload work on your installation you may want to copy in 'clean' files fresh from the installation, or you may want to use a modified file set that reflects your design considerations. 
     
     
  7. log in to CMPro and go to the Admin Area home page. From the drop-down, choose Create New Section. Name the section as desired (we're using WooHoo here). You will be planted directly into a blank settings record for your new section. Fill this form out now, specifying the new paths and urls to the new section along with all other information. 
     
     
  8. In the new section’s copy of /Application.cfm, change the section name (variables.SectionName) to whatever the new section name is (in this case <cfset variables.SectionName="WooHoo">.
     
    This is the only code modification necessary. 
     

OPTIONAL STUFF:

  1. This new section has its own /ApplicationToo.cfm as well, which means it has its own application name. In /Application.cfm you can optionally change
     
    <cfinclude template="ApplicationToo.cfm">
    to
    <cfinclude template="../ApplicationToo.cfm">

     
    so that file is shared between the two sections.
     
    You could also leave the setting alone and just make sure both cfapplication statements share the same application name, thereby ensuring that session info is passed between the two sections transparently.
     
    A third alternative is to alter the new section's /ApplicationToo.cfm so that it has its own application name, and is thus an independent system with its own sessions and application variables.

      
  2. At your option, you can share the contents of the root /tags/ and /includes/ folders with your new section. To do so you will have to change every cfinclude and cfmodule call in your new section to have a "../" or a "../../" prepended to the tag or module call -- which notation you use will depend on the menu system you choose. Whether this is a good idea or not will depend entirely on your specific implementation (i.e. design factors) and whether its worth the trouble to eliminate the file duplication and make both sections dependent on a single file set rather than being independent entities. If you are not customizing the CMPro file set than this is probably more trouble than its worth, and we have seen developers cause themselves considerable trouble by taking this purist no-code-duplication route.
     
      
  3. This can be a section of your web site kept separate from others for various reasons or... an entirely different web site, with different domain urls. If its a different domain you will have to keep it as a completely unique file set, with no co-dependencies on the front end of the system. However, if you have your own server and can fire up dsn's at will it is generally simpler just to do a completely separate CMPro install to support multiple web sites.  Remember that CMPro licensing is one-per-domain so if you run multiple domains you must purchase multiple licenses. 
     
  4. If installing multiple web domains, there is no requirement to place the web sites in the same heirarchy.  However at present if you attempt this you will not be able to use the bundled alternate editor.  The default ActivEdit editor must be used.

The Robertson Team, TheKing@mysecretbase.com
1.559.360.1717 


HostMySite.com is a leader in ColdFusion web hosting and managed dedicated servers.