Cchost/customize/Navigation Tabs

From Creative Commons
Jump to: navigation, search


Docs Home Install Upgrade Troubleshoot Customize Admins Devs Content Query Templates Commands Skins

Cchost-tabs.png

Overview

The command that controls navigation tabs is view and the parameter is the name of the tab set followed the name of the tab to be selected:

http://ccmixter.org/view/media/picks

In this case the tabset name is media the tab to select is picks. If you leave off the selected tab, the default is the first tab:

http://ccmixter.org/view/media

is the same as

http://ccmixter.org/view/media/home

For ultimate flexibility is it theoretically possible to switch out the top main navigation bar by specifying another tab set:

http://ccmixter.org/view/alt_tabs (this is a 404 because ccM doesn't have such a tab set name)

It's not considered good interface practice but we didn't want to restrict it just because it's a bad idea.

However you can create tabs sets that are used as 'subtabs' that you hook up in admin/tabs. When selecting the tab type you select subtab and enter the name of the subtab set. The URL is then extended to include the subtabs and the selected tab with there:

http://ccmixter.org/view/media/extras/stats

Command is "view", tab set is "media", selected tab in "media" is "extras" which invokes the subtab set called "ccmixter_extras", select tab within that is "stats" (which maps to a command "docs/stats" which displays the file mixter-files/pages/stats.php)

Default Tab Set

When you don't specify ANYTHING

http://ccmixter.org

Then the system will look at the 'Homepage' setting under Manage Site->Settings to figure out what to display. ccMixter has that set to view/media/home - again, command is view to bring up the media tab set and select the home tab

Implicit Tab Set

All this may bring up the question: "How come when I enter a command OTHER than view I still get a nav tab set?"

That's because the skin itself is (essentially) performing the view command on the default tab set. The view command exists so that there is an explicit way to say to the system: "Do the selected view tab and nothing else."

Editing Tabs

  • Log in as admin (if not already)
  • Click on Manage Site, then Navigator Tab Sets (or browse admin/tabs)
  • Click on [edit tabs] to bring up the tab editor.
  • To create a new tab click on Add Tab
  • To edit a tab fill out the fields:
    • Order - Controls the order, left to right, of the tabs
    • Name - This is how to specify the tab in the view command
    • Text - The text displayed in the tab
    • Help Hint - The text displayed to the user when the mouse hovers the tab
    • Function - Select from one to tell the system how to deal with the Data field:
      • Execute URL - This means Data is a URL. If the URL is a command you just need to specify that. If the URL is a fully qualified URL that will cause a redirect to that URL.
      • SubTabs - The means Data is the name of another tab to execute when clicked on.
      • Query - This means Data is a query to execute.
    • Data - The thing to execute according to Function
    • Access - Select what kind of use can see this tab. This tab will be hidden from all other types of users.

The Data field in conjunction with Function has many powerful possibilities. Some of the more common ones:

To display a page from your <local_files>/pages directory:

 Function: Execute URL
 Data:     /docs/<page_name_no_extension>

To execute any ccHost command:

 Function: Execute URL
 Data:     /browse?reqtags=remix

To execute a query (using the default list_files template):

 Function: Query
 Data:     tags=remix,-digital_distortion&type=all