Customizing Files
Customizing Files
This documenation refers to ccHost 4.5. There are serious changes coming in 5.0
Make sure to keep tabs at the ccHost Wiki
Table of Contents
Before You Do Anything Else
It is important to understand the role of the various
directories involved
in a ccHost installation. Using the correct directory
structure and setting up the corresponding paths in the
Global Settings/Paths configuration screen
means that you never have to worry about losing any
work or configuration when you update to a newer version
of ccHost.
The install program for 3.1 and above has set you
up with a default structure that you are welcome use as is. Future
upgrades of ccHost will never interfere with that structure.
Edit Your Home Page
If no other command is specified, the system defaults to executing the homepage command.
Admins define the actions of the homepage command via the Manage Site/Setting.
Assuming you have followed the instructions in the section Before You Do Anything Else the default home page is in your viewfile directory called home.xml. Edit this file to create your custom home page. Before you get too frustrated you should probably read the section on XHTML do's and don'ts.
If you want a different home page for a specific virtual root:
- Create a new file in your files directory called something like
home2.xml.
- Go to Manage Site.
- Select your virtual root from the drop down selection box
- Select Settings
- In the Homepage field change viewfile/home.xml to viewfile/home2.xml.
Setting the 'Home' Tab
Most sites with want a 'Home' tab in their navigator tabs and they will want to
have that tab highlighted when the root url of their site is requested. In order to set
that up follow these steps:
- Go to Manage Site/Navigator Tab Sets
- Click on [ edit tabs ] for the first tab set.
- Set Name for the first tab to 'home'
- Set Text for the first tab to 'Home'
- For Function select "Execute URL"
- Set Data to viewfile/home.xml
- Click on Submit
- Go to Manage Site/Settings
- For Homepage field enter view/media/home
The above steps makes some assumptions (e.g. your actual home file is called home.xml and your default tab set is called 'media', etc.). You should make the appropriate adjustments for your
setup.
Edit Your Welcome Page
Assuming you have followed the instructions in the section Before You Do Anything Else
the default welcome screen for newly registered users is in your viewfile directory called welcome.xml.
Edit this file to create your custom welcome page but before you get too frustrated you should probably read the section on XHTML do's and don'ts.
Create New Pages
Creating a new page in your ccHost system is simply a matter of creating a new XML file in
your viewfile directory. If you haven't read the Before You Do Anything Else yet, now
would be a good time and before you get too frustrated you should also read the section on XHTML do's and don'ts.
Viewing Your Pages
All XML files in your viewfile directory are
viewable in a ccHost page by using the viewfile command and the filename as the parameter:
http://example.com?ccm=/media/viewfile/terms_of_use.xml (Pretty URLs off)
http://example.com/media/viewfile/privacy.xml (Pretty URLs on)
HINT: If you are using Apache's mod_rewrite module you can pretty the URLs up
even more:
RewriteRule ^terms$ /media/viewfile/terms_of_use.xml [L]
RewriteRule ^privacy$ /media/viewfile/privacy.xml [L]
Which would yield:
http://example.com/terms
http://example.com/privacy