Difference between revisions of "Cchost/customize"

From Creative Commons
Jump to: navigation, search
(New page: =Customizing a ccHost Installation= There are many levels of customization to a ccHost with each level require more and more technical skill. It will not be obvious what kind of customizat...)
 
(Configuration Customizations)
Line 27: Line 27:
  
 
==Configuration Customizations==
 
==Configuration Customizations==
The way the system is set up, ''all'] of the customizations in the 'Admin' section above are actually fancy ways of manipulating configuration files already in your system, many of which can be superseded by simply making your own version.
+
The way the system is set up, ''all'' of the customizations in the 'Admin' section above are actually fancy ways of manipulating configuration files already in your system, many of which can be superseded by simply making your own version.
 
    
 
    
 
Even if you don't exactly know what the configuration syntax is or how it works, you can easily customize your installation with some judicious cut and paste in configuration files that the system will look for in your <local_files> directory. These include:
 
Even if you don't exactly know what the configuration syntax is or how it works, you can easily customize your installation with some judicious cut and paste in configuration files that the system will look for in your <local_files> directory. These include:

Revision as of 12:30, 1 November 2008

Customizing a ccHost Installation

There are many levels of customization to a ccHost with each level require more and more technical skill. It will not be obvious what kind of customization is possible at each level so here are some hints that might help you to decide what you need to do in order to achieve your goals.

Admin Customizations

In ccHost 5 there are dozens of customizations that do not require any coding knowledge. You can do all these simply by filling out forms:

  • Create formatted content pages
  • Upload banner images (logos)
  • Control the text in the header and footer of every page
  • Control the menu items and groups on every page
  • Control the navigation tabs at the top of every page and create sets of "sub-navigation" tabs that are embedded in a page
  • Create your own submit form types
  • Select basic layout of pages from a list of over 40 schemes (e.g. menus on the right, flexible width of main content page, etc.)
  • Select default font family and size from a list.
  • Select color scheme from a list of pre-authored color sets
  • Select 'sidebar extras' from a list of available plugins
  • Select how your forms are laid out from a list of available layouts.
  • Select a string set that changes every string in the system to fit your type of site (e.g. image gallery, remix community, etc.)
  • Save and retrieve multiple versions of 'skin profiles' and create 'mini sites' with different look and feel for each one
  • Add "pseudo verifying" file types to the system

Query Customizations

With a little knowledge of URL building you gain control over what uploaded content is displayed in the settings of your choice. For example if you want to show the most popular uploads tagged 'remix' for the last two weeks you specify that using URL syntax in a navigation tab, including the title to display:

 tags=remix&sinced=2 weeks ago&sort=rankings&title=Hot Remixes

The query engine also works with topic contents.

Configuration Customizations

The way the system is set up, all of the customizations in the 'Admin' section above are actually fancy ways of manipulating configuration files already in your system, many of which can be superseded by simply making your own version.

Even if you don't exactly know what the configuration syntax is or how it works, you can easily customize your installation with some judicious cut and paste in configuration files that the system will look for in your <local_files> directory. These include:

  • String sets
  • Color schemes
  • Sidebar extras

Markup Customization

If you are comfortable with a little HTML and CSS hacking and you still want more control over your installation then you will find quite a large world open up to you.

NOTE to PHP developers: Because all templates are parsed as PHP, extreme hacking is always available to you at this level of customization. While it's not the most 'portable' way to hack the site, if you're convinced you understand the consequences of such actions here is the first place where a few lines of PHP hackery can have powerful effect.

Custom Pieces

If you are generally happy with the overall look and layout of the site but want to change specific screen, you can create customized display layouts and then select them through the admin screens:

  • Upload page
  • Upload listings
  • Query browser listing
  • Form layouts
  • Custom query templates (way more powerful than you might first realize)

This assumes that all the data you need to display is already available and you are simply re-arranging items. You can remove items by simply not displaying them, but if you want to add new data fields you can not do that at 'Markup' level of customization.

Custom Skins

The ultimate control over look and feel of an installation can be accomplished by creating your own skin template by browsing to admin/skins/create which will not only copy a template framework, but also a skin profile.

Once this template is installed into your <local_files>/skins directory, you can customize the 'body' template which controls the contents of every page's header, footer, layout, etc. You can also start copying individual templates to your skin directory from ccskins/shared and the system will use your version.

Developer Customizations

Common

There are many customizations that can be done with just a few lines of code. Some of those the more popular ones are:

  • Add or remove form fields including the submit forms
  • Add data fields per user and per upload
  • Retrieving custom data for listing display
  • Saving and retrieving data from the system configuration
  • Adding an admin setting to settings menu
  • Mapping a URL to your custom code

ccHost triggers events at certain key moments and you can register to be notified at those times. The more popular ones of those are:

  • When a new file has been uploaded
  • When a file or entire upload record has been deleted
  • When the remix sources for an upload has changed
  • When a new topic has been added or deleted
  • When a page session is starting (but after the user is known and configuration in place)
  • After the page has been setup, but before handed off to the template engine for rendering
  • Several different phases of a form being constructed (this applies to every single form in the system)

Esoteric

There are many other hooks in the system (over 100) many of which still fall in the category of "easy to hook" even if the hook itself may or may not require heavy lifting. These include:

  • Adding % macros that expand on file renaming and ID3 tagging
  • Adding and verifying new parameters to the query engine
  • Replacing the getID3 verifier
  • Adding a new search type