HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

ocPortal Tutorial: Advanced custom pages of information

Written by Chris Graham, ocProducts
ocPortal provides features to allow Comcode pages to be very feature rich. This tutorial explains two advanced aspects to this: blocks and 'inline attachments'. It will also explain how ocPortal allows your website content to be organised using different methodologies.



Blocks

If you have read the 'custom pages of information' tutorial, you will know that using Comcode pages, you can type in text that visually resembles the look of the page (unlike HTML, which can look very complicated). This is a very powerful tool, but it is ultimately limited by the fact that you are only producing a document, not an interactive, data-bound, part of a website: if this was all you could do (forgetting modules for a minute), then ocPortal would not be much more powerful than a word processor.

ocPortal has a concept called a 'block'. Blocks are essentially building blocks that can be inserted into a Comcode page in order to add the aforementioned interactive and date-bound functionality that is so important to a modern website. At the time of writing, ocPortal contains 67 blocks (at the time of writing) for you to use, and we are planning more of them for future versions.

How to use a block

Thumbnail: Actual Comcode that references blocks

Actual Comcode that references blocks

Unlike other systems that you may have experience with, ocPortal blocks (such as news blocks or poll blocks) are not arranged graphically. Usage of blocks is easiest shown by example. If you login to your site as your administrator user, and choose to edit the front page of the Welcome Zone, then you will see the page consists of Comcode: in particular, you will see that the '[block]' tag is used many times in the page.
To use a block, all you actually need to do is to use the Comcode '[block]' tag, with the name of the block as the tag contents. Parameters passed to the block simply get placed as parameters for the block tag itself.

The available blocks are classified into three groups:
  • Side blocks. These are intended to be shown on a menu page.
  • Main blocks. These are intended to be shown on the body of the site (an actual page).
  • Bottom blocks. These are intended for use in the footer of the site.
These classifications are not fixed however. It is common, for example, to use the main_poll block on a menu; by re-templating, any pre-written visual assumptions about placement may be broken down.

Cheating

As mentioned in the above section, you can add a block using the Comcode '[block]' tag. However, you don't need to type this code manually – instead just click the obvious 'Block' button and ocPortal will provide a popup wizard to help you.
The Wizard will generate the Comcode for you and place it approximately where your caret was. You can move it around by cut&pasting.

Available blocks

It is advisable that you use the "block construction assistant" (linked to via the 'Add block' button on the Comcode page editing screen). This assistant will list all the blocks, provide a helpful interface to defining the block parameters, and allow you to preview the blocks. There is no reason to type in the block Comcode manually.

bottom_forum_news

Description Forum topic ticker.
Use If you want to show the active topics on your main website.
Parameter 'date_key' Whether to sort/display according to first or last post time. Value must be either 'firsttime' or 'lasttime'. Default: 'lasttime'.
Parameter 'param' The number of the most recent topics to display. Default: '6'. Note: do not refer to a restricted forum or your security will be eroded.
Parameter 'forum' The name of the forum from which to display topics. May be a comma-separated list. Using forum IDs instead of names is more efficient. Default: 'Announcements'.

bottom_news

Description News ticker.
Use If you want links to news on the side so they are shown from all pages.
Parameter 'param' The number of news entries to show. Default: '5'.
Parameter 'filter' If set, only news from this category ID will be shown. This can also be a comma-separated list.
Parameter 'zone' The zone to look for the news module in. Default: search.

bottom_rss

Description RSS (Really Simple Syndication) or Atom news ticker.
Use Syndicate another site's news into the side of your site, like news. This is great for multi-site-networks; you can syndicate news from the network's central site.
Parameter 'param' The source for the feed. Default: 'http://channel9.msdn.com/Feeds/RSS/' (Microsoft's Channel9 RSS feed). Note: feed update time, and the number of entries to display is decided by a configuration setting.
Parameter 'max_entries' Maximum number of posts to show. Default: '10'.

main_as_zone_access

Description Give a permission denied error if the user does not have access to the given zone.
Use Used in the documentation, to only allow staff to read staff documentation.
Parameter 'param' The zone.

main_awards

Description This displays the current selected holder of an award (the awarded content, not the submitter of the awarded content). Awarding is a method of giving prominence to content, usually on your front page.
Use To give focus to specific items of content.
Parameter 'param' The ID of the award type to use (hook-type: 'systems/awards'). Default: the default (download of the week) award.
Parameter 'zone' The zone to look for the content module in. Default: search.

main_banner_wave

Description Show banners so that they are displayed in a line.
Use Showing a list of sponsors.
Parameter 'param' The banner type to display banners from.
Parameter 'extra' Advanced feature. Meaningless extra parameter that is relayed through to templates.
Parameter 'max' The maximum number of banners to show in the wave. If the limit is exceeded, random ones are chosen up to the maximum. Default: '100'.

main_block_help

Description Show information about all blocks.
Use Used in the Admin Guide to show all the block parameters.

main_cc_embed

Description This embeds a catalogue category's entries into the page.
Use If you wish to have a page that is based on the entries in a catalogue, yet has the properties of a Comcode page.
Parameter 'param' The catalogue category ID. Note: do not choose a restricted category or your security will be eroded.
Parameter 'select' Advanced feature. An [concept]ocFilter[/concept] format list of ID's determining which entries from this category to show on the list. Default: show all.
Parameter 'template_set' Advanced feature. The template set to render the category with. Default: normal one for the catalogue.
Parameter 'display_type' The display type to render the category with (must be either ''="default for catalogue", '0'="boxes", '1'="list" or '2'="tabular"). Default: ''.

main_code_documentor

Description Documents code modules, based on special comments in those modules.
Use Used in the devguide to provide API documentation.
Parameter 'param' The name of the code module to document. Default: 'sources/global2.php'.

main_comcode_page_children

Description Show links to child pages of a Comcode page, if there are any.
Use Placed by-default on new pages, to automate navigation toward child pages. The page may be removed and the navigation entered by other means, if desired.
Parameter 'param' Advanced feature. The page for which we are showing children. Default: the page it is placed on.
Parameter 'zone' The zone that the page for which we are showing children is in. Defaults to the zone the page is in, and if that fails to be found, the current zone.

main_comments

Description This puts a comment form and comments onto the page. The comment topic is unique to the page.
Use Allow member comments on online documentation.
Parameter 'param' Advanced feature. An identifier for the comment box on this page; you only need to specify this if you have more than one comment block in a page. You may make one up.
Parameter 'page' Advanced feature. If specified, this overrides the page name part of the comment topic name. You may leave this blank as usually the name of the page you place this on will be used and will do just fine.
Parameter 'extra_param_from' Advanced feature. The name of the URL parameter to use as an additional comment topic name specifier (e.g. "comment_type"). You may leave this blank.
Parameter 'reverse' Whether comment posts will be shown in reverse order (newest first). Default: '0'.
Parameter 'forum' The forum where the comments will go (an ID number, or name). Default: the normal comments forum.
Parameter 'invisible_if_no_comments' Whether this comment block will not be shown if there are no comments for it. Default: '0'.

main_contact_simple

Description This allows sending of messages to the staff via e-mail.
Use Useful for those who prefer to receive messages directly via e-mail.
Parameter 'param' The e-mail address to relay to. Default: staff address.
Parameter 'title' The title for the contact-us box. Default: 'Contact Us'.
Parameter 'private' Whether to not collect an e-mail address and subject. Default: '0'.

main_contact_us

Description This allows sending of messages to the staff.
Use You must have a forum created with the name as is configured for 'Contact Us' messaging.
Parameter 'param' The title for the message type. Default: 'General'.
Parameter 'title' The title for the contact-us box. Default: 'Contact Us'.

main_content

Description This displays random content of a content type, or a specific item of content.
Use To bring content into Comcode pages, optionally randomly.
Parameter 'param' The content type to use (hook-type: 'systems/awards'). Default: 'download'.
Parameter 'efficient' Whether to skip category access checks. Default: '1'.
Parameter 'id' The item ID of the item to display (item ID format is determined by the selected content type). Default: randomisation.
Parameter 'filter' The categories (category ID format is determined by the selected content type) which may be chosen (from) during randomisation, in [concept]ocFilter[/concept] notation (e.g. 1,2,3,6-7). Default: any.
Parameter 'filter_b' As for 'filter', except this applies to the secondary category for the items (if there is a secondary category for the content type). Default: any.
Parameter 'title' The title to give the select content. Default: 'Random content'.
Parameter 'zone' The zone to look for the content module in. Default: search.

main_count

Description A hit counter, or some other form of counter.
Use To display a count on a page, such as an automatically managed hit-count.
Parameter 'param' A name for the counter (each named counter operates with an independant tally). Default: 'hits'.
Parameter 'start' If the named counter has not been used before, this defines the number it starts at. Default: '0'.
Parameter 'hit_count' Whether this is to behave as a hit counter; otherwise the counting is done by something else (what that is is undefined – you'd write some custom PHP code somewhere for it). Default: '1'.

main_countdown

Description Display a count-down.
Use Useful on a page that needs to show a count-down to some kind of event.
Parameter 'param' The time to count-down to. This may be a 'unix timestamp' (a number representing the time) or a simple date phrase understood by PHP's 'strtotime'. Search Google for 'convert timestamp' to find tools for working out timestamps. Default: '25th December 2010'.
Parameter 'precision' The amount of precision to go down to. Must be either '0'="Years" or '1'="Days" or '2'="Hours" or '3'="Minutes" or '4'="Seconds". Default: '4'.

main_custom_comcode_tags

Description Show all the custom Comcode tags.
Use Used on the Comcode help page.

main_db_notes

Description Display an editable (by anyone with page access) plain-text box of notes, driven by a database row.
Use Used in the Admin Zone for staff notes.
Parameter 'param' An identifying name for a row in the database, which will be used for the notes. You may make these up as you choose. Default: 'admin_notes'.
Parameter 'title' Title for the edit box.
Parameter 'scrolls' Whether horizontal scrollbars are to be used on the editor, rather than hard word-wrapping. Note that this scroll-bar functionality requires Javascript to be enabled. Default: '0'.

main_download_category

Description This embeds a download category's subcategories.
Use If you wish to list the main categories on a download site on the front page.
Parameter 'param' The download category ID. Default: the root category.
Parameter 'title' The title to box in. Default: 'Downloads'.
Parameter 'order' The order to sort the downloads in. Must be either 't.text_original ASC' or 't.text_original DESC' or 'file_size ASC' or 'file_size DESC' or 'num_downloads DESC' or 'add_date ASC' or 'add_date DESC'. Default: 't.text_original ASC' (alphabetical).

main_download_tease

Description This shows all the downloads in a multi-page browser, ordered by number of downloads.
Use For membership sites which want to show off download content without giving full membership.
Parameter 'zone' The zone to look for the downloads module in. Default: search.

main_emoticon_codes

Description Show all the emoticon codes.
Use Used by the Comcode help page to show which codes are available.

main_feedback

Description Allows members to give private feedback.
Use If you want members to be able to give feedback, without the feedback being displayed guestbook-style like a normal comment block would.
Parameter 'param' An optional parameter to give a unique ID (topic) to this feedback form.
Parameter 'forum' The forum where the feedback topic will go (an ID number, or name). Default: the normal comments forum.

main_forum_news

Description This displays news pieces based on the posts in a forum.
Use If you wish to use a forum for placing news rather than the standard news system.
Parameter 'param' The number of topics from which to display news. Default: '14'.
Parameter 'forum' The name of the forum from which to display news. May be a comma-separated list. Using forum IDs instead of names is more efficient. Default: 'Announcements'. Note: do not refer to a restricted forum or your security will be eroded.
Parameter 'member_based' Whether news will be given a member by-line instead of an author by-line. This option has no effect is the authors addon is not installed, as this situation will always yield a member by-line. Default: '0'.
Parameter 'date_key' Whether to sort/display according to first or last post time. Value must be either 'firsttime' or 'lasttime'. Default: 'lasttime'.

main_forum_topics

Description Shows the topics in a forum.
Use If you want to show the active topics on your main website.
Parameter 'param' The name of the forum from which to display topics. May be a comma-separated list. Using forum IDs instead of names is more efficient. Default: 'General chat'. Note: do not refer to a restricted forum or your security will be eroded.
Parameter 'limit' The number of the most recent topics to display. Default: '6'.
Parameter 'hot' Whether to show only hot topics. This parameter can only be used with OCF. Default: '0'.
Parameter 'date_key' Whether to sort/display according to first or last post time. Value must be either 'firsttime' or 'lasttime'. Default: 'lasttime'.
Parameter 'username_key' Whether to say 'by' the topic starter or latest poster. Value must be either 'firstusername' or 'lastusername'. Default: 'firstusername'.

main_gallery_embed

Description Show the images in a gallery.
Use Embedding a gallery inside a Comcode page is an excellent way to attach collections of images to an article.
Parameter 'param' The ID of the gallery to display. Note: do not refer to a restricted gallery or your security will be eroded. Default: 'root'.
Parameter 'select' Optional. The images from the gallery to select, given in a specially encoded form. Example: '1-3,6,8,10-45'. Default: selects full contents.
Parameter 'zone' The zone to look for the galleries module in. Default: search.

main_gallery_tease

Description This shows all the galleries which aren't empty and which are directly underneath the given gallery.
Use For membership sites which want to show off gallery content without giving full membership.
Parameter 'param' The gallery root from which to show subgalleries. Default: 'root'.
Parameter 'zone' The zone to look for the galleries module in. Default: search.
Parameter 'reverse_thumb_order' Whether to show newer galleries first. Default: '0'.

main_greeting

Description Show a greeting to the user, customised according to whether they are logged in.
Use In conjunction with the configuration setting for greeting text, this is a great way to give users customised greetings on the front page.

main_include_module

Description Include a module as if it was a block.
Use Useful for situations where the module-based content organisation is inappropriate, and a Comcode page hierarchy is to be constructed to frame content in an alternative manner.
Parameter 'param' The page-link that will be used to build up simulated URL parameters (e.g. site:search:misc).
Parameter 'striptitle' Whether the page title is to be stripped. Default: '1'.
Parameter 'onlyifpermissions' Whether page and zone permissions are to be checked. Default: '1'.

main_iotd

Description Show the Image Of The Day (IOTD).
Use Make your site seem more lively with content changing daily.
Parameter 'param' Must be either 'current' or 'random'. Default: 'current'. Note: random IOTDs are chosen from the IOTDs which have been used before. This mode is intended for use when IOTDs are getting harder to come by, or when you've had enough for users to not be concerned with re-use. Note that random IOTDs stick for 24 hours due to caching (probably a good thing).
Parameter 'zone' The zone to look for the iotds module in. Default: search.

main_leader_board

Description Show the members with the most points.
Use Encourage competition between members, keeping up community interest and participation.
Parameter 'param' The number of members to show in the leader-board. Default: '5'.
Parameter 'zone' The zone to look for the leaderboard module in. Default: search.

main_news

Description Display news.
Use Use the news system to display news onto your front page.
Parameter 'param' The number of days from which to show news. A proportion of these will be displayed with summaries, and the others as linked titles. Default: '14'.
Parameter 'member_based' Whether news will be given a member by-line instead of an author by-line. This option has no effect is the authors addon is not installed, as this situation will always yield a member by-line. Default: '0'.
Parameter 'filter' If set, only news from this category ID will be shown. This can also be a comma-separated list.
Parameter 'multiplier' This determines the proportion of summaries to linked titles. Default: '0.5' (meaning half are summaries and half are linked titles).
Parameter 'fallback_full' If there is no news in the days given, then this many summarised pieces will be shown. Default: '3'.
Parameter 'fallback_archive' If there is no news in the days given, then this many titled pieces will be shown. Default: '6'.
Parameter 'blogs' Whether to only show blog results. If set to 0, do not show blog results. If set to -1, show all both types. Default: '-1'.
Parameter 'historic' Must be either 'day', 'week', or 'month' to make the block pick posts based on "this day/week/month in history", or '' (blank) to display in normal style. Default: ''.
Parameter 'zone' The zone to look for the news module in. Default: search.

main_newsletter_signup

Description Provide a very lightweight newsletter signup-form.
Use If you want a quick-signup form on your panel. This block is intended for expert users only.
Parameter 'subject' The subject line for the welcome email. Default: 'Welcome'.
Parameter 'path' The relative or absolute URL to a file containing Comcode. This file will be used for the email body. Default: 'uploads/website_specific/email.txt'.
Parameter 'to' The name to to refer to the recipient with (e.g. "Subscriber"). Default: website default.

main_notes

Description Display an editable (by anyone with page access) plain-text box, driven by a file.
Use Used for editing files, such as the quotes file.
Parameter 'param' The filename (without the .txt extension) of a file in the text directory, which will be used for the notes. This file must be writeable. Default: 'admin_notes' (which translates to text/admin_notes.txt).
Parameter 'title' Title for the edit box.
Parameter 'lang_none' Whether the text file is not language-specific. Default: '0'.
Parameter 'scrolls' Whether horizontal scrollbars are to be used on the editor, rather than hard word-wrapping. Note that this scroll-bar functionality requires Javascript to be enabled. Default: '0'.

main_only_if_match

Description Shows the given caption only if the page matches one of the match tags.
Use To customise Comcode pages (especially panels) according to URL environment.
Parameter 'param' A comma-separated string of match tags (e.g. site:downloads:type=ad).
Parameter 'caption' The caption in escaped Comcode form.

main_poll

Description Show the poll.
Use You can get the opinions of your members, and reflect that there are other visitors by the fact that other people have voted.
Parameter 'param' The ID of the poll to use. Default: the current poll.
Parameter 'zone' The zone to look for the polls module in. Default: search.

main_quotes

Description Show a random quote.
Use Give your site a feeling of variation: make it slightly different each time it is viewed.
Parameter 'param' The name of a file (without the .txt extension) in the /text/[lang] folder. Default: 'quotes'. Note: if there is no quote file as specified in the user's language, the quote file for the site language is used.

main_rating

Description This puts a rating box onto the page.
Use For those who want rateable Comcode pages.
Parameter 'param' Advanced feature. An identifier for the rating box on this page; you only need to specify this if you have more than one rating block on a page. You may make one up.
Parameter 'page' Advanced feature. If specified, this overrides the page name part of the rating identifier.
Parameter 'extra_param_from' Advanced feature. The name of the URL parameter to use as an additional rating name specifier (e.g. "rating_type"). You may leave this blank as usually the name of the page you place this on will be used and will do just fine.

main_recent_cc_entries

Description Show the most recent entries in a catalogue.
Use Make it so users know the entries which have been most recently added to the site.
Parameter 'param' The number of entries to show. Default: '10'.
Parameter 'catalogue' The name of the catalogue to use.
Parameter 'zone' The zone to look for the catalogues module in. Default: search.

main_recent_downloads

Description Show the most recent downloads.
Use Make it so users know the downloads which have been most recently added to the site.
Parameter 'param' The number of downloads to show. Default: '10'.
Parameter 'zone' The zone to look for the downloads module in. Default: search.
Parameter 'show_dload_trees' Whether to show inline breadcrumbs ('0' or '1'). Default: what the site is configured for.

main_recent_galleries

Description Show the most recent galleries.
Use Make it so users know the galleries which have been most recently added to the site (especially useful for a personal gallery-orientated site).
Parameter 'param' The number of galleries to show. Default: '10'.
Parameter 'zone' The zone to look for the galleries module in. Default: search.

main_rss

Description Show an RSS (Really Simple Syndication) or Atom news feed.
Use Syndicate another site's news onto your front page. This is great for multi-site-networks; you can syndicate news from the network's central site.
Parameter 'param' The source for the feed. Default: 'http://news.google.co.uk/news?hs=UTT&tab=wn&topic=w&output=atom' (Google News' RSS feed – one of the most popular). You may aggregate multiple feeds by making the parameter span multiple lines, with an URL on each line. Note: feed update time, and the number of entries to display is decided by a configuration setting.
Parameter 'max_entries' Maximum number of posts to show. Default: '10'.
Parameter 'title' HTML to use for the feed title of the results. Default: the feed's own.
Parameter 'copyright' HTML to use for the copyright area of the results. Default: the feed's own.

main_search

Description Place a search box.
Use Used by Comcode help pages to allow searching of content.
Parameter 'limit_to' Optionally, only search the given search hook (hook-type: 'modules/search'). Default: ''.
Parameter 'search_under' Only search underneath the given category ID (only applicable if "Limit To" is set).
Parameter 'zone' The zone to look for the search module in. Default: search for it.

main_staff_actions

Description Show the recent staff actions.
Use Used to be used on the Admin Zone front page to show an overview of what the administrators are doing.

main_staff_checklist

Description Show tasks the staff need to complete or have already completed.
Use This is a big help in making sure staff do not forget to perform regular actions, such as making backups and validating submissions.

main_staff_new_version

Description This block provides information about the installed version of the software, such as security issues.
Use Used on the Admin Zone front page to notify of updates to the software.

main_staff_tips

Description This block provides dismissable tips in increasing levels of difficulty.
Use Used on the Admin Zone front page to aid administrators in getting to grips with the software.

main_top_downloads

Description Show the most popular downloads.
Use Make it so users know the most popular downloads on the site, so they can download them themselves.
Parameter 'param' The number of downloads to show. Default: '10'.
Parameter 'zone' The zone to look for the downloads module in. Default: search.
Parameter 'show_dload_trees' Whether to show inline breadcrumbs ('0' or '1'). Default: what the site is configured for.

main_top_galleries

Description Show the highest-rated galleries.
Use Make it so that users know the most popular galleries on the site, to direct them or their attention to the best content.
Parameter 'param' The number of galleries to show. Default: '10'.
Parameter 'zone' The zone to look for the galleries module in. Default: search.

main_trackback

Description Announce a trackback URL.
Use So that an entry may have trackbacks registered to itself (blog style).
Parameter 'param' Advanced feature. An identifier for what the trackbacks are being stored for; you only need to specify this if you have more than one rating block on a page. You may make one up.
Parameter 'page' Advanced feature. The page (effectively, module) which is accepting trackbacks. You may leave this blank as usually the name of the page you place this on will be used and will do just fine.
Parameter 'id' Advanced feature. The ID of the entry of the module which is being trackbacked.

side_calendar

Description Show a calendar box for the current month.
Use Provides a very brief overview on calendar entries, with links to the full calendar for more detail.
Parameter 'param' The type of interface to show. Must be either 'month' or 'listing'. Default: 'month'.
Parameter 'zone' The zone to look for the calendar module in. Default: search.
Parameter 'days' The number of days shown on the view (only relevant for the 'listing' display type). Default: '30'.

side_forum_news

Description Shows the topics in a forum (perhaps as news).
Use If you want to show the active topics on your main website.
Parameter 'param' The number of the most recent topics to display. Default: '6'. Note: do not refer to a restricted forum or your security will be eroded.
Parameter 'forum' The name of the forum from which to display topics. May be a comma-separated list. Using forum IDs instead of names is more efficient. Default: 'Announcements'.
Parameter 'date_key' Whether to sort/display according to first or last post time. Value must be either 'firsttime' or 'lasttime'. Default: 'lasttime'.

side_language

Description Allows users to choose a language in which to view the site.
Use For a site with multiple languages, users will need to be able to choose a language to use if it isn't detected properly.

side_network

Description Choose a site to jump to from a multi-site-network.
Use Multi-site networks allow you to bind multiple websites together (preferably all running this software). This provides easy navigation between the sites specified under the netlink URL.

side_news

Description Shows news titles, with links.
Use If you want links to news on the side so they are shown from all pages.
Parameter 'param' The number of news entries to show. Default: '5'.
Parameter 'blogs' Whether to only show blog results. If set to 0, do not show blog results. If set to -1, show both types. Default: '-1'.
Parameter 'historic' Must be either 'day', 'week', or 'month' to make the block pick posts based on "this day/week/month in history", or '' (blank) to display in normal style. Default: ''.
Parameter 'zone' The zone to look for the news module in. Default: search.
Parameter 'filter' If set, only news from this category ID will be shown. This can also be a comma-separated list.

side_ocf_personal_topics

Description Shows a list of all personal topics for the currently-logged-in member which have unread posts. If there are no such topics, or the user is a guest, then nothing is shown.
Use Used in the forum zone to alert new personal topics.

side_personal_stats

Description Shows a login box, or personal stats.
Use Allows quick login, and shows information about the logged-in member so they can keep quick track of their own stats.

side_printer_friendly

Description Get a 'printer-friendly' URL for the current page.
Use Used in the documentation.

side_root_galleries

Description This shows links to all the galleries beneath the given one.
Use For a gallery-intensive site, provides easy access to galleries.
Parameter 'param' The gallery from which to show subgalleries. Default: 'root' (the root gallery).
Parameter 'depth' Whether a two-layer gallery structure is displayed (rather than a flat list of galleries). Default: '0'.
Parameter 'zone' The zone to look for the galleries module in. Default: search.

side_rss

Description Show an RSS (Really Simple Syndication) or Atom news feed.
Use Syndicate another site's news into the side of your site, like news. This is great for multi-site-networks; you can syndicate news from the network's central site.
Parameter 'param' The source for the feed. Default: 'http://channel9.msdn.com/Feeds/RSS/' (Microsoft's Channel9 RSS feed). Note: feed update time, and the number of entries to display is decided by a configuration setting.
Parameter 'max_entries' Maximum number of posts to show. Default: '5'.
Parameter 'title' HTML to use for the feed title of the results. Default: the feed's own.
Parameter 'copyright' HTML to use for the copyright area of the results. Default: the feed's own.

side_shoutbox

Description Shows a 'shoutbox', where visitors may leave messages.
Use If you want to allow visitors to leave messages on the side of your website.
Parameter 'param' The room ID to use for the shoutbox. Default: The first chatroom.

side_stats

Description Shows site statistics.
Use Let users know about the state and size of the site.

side_stored_menu

Description This shows a menu.
Use Used throughout menu pages to provide actual menus.
Parameter 'caption' The caption of the standard-box in which to wrap the menu. Default: no standard-box.
Parameter 'type' The type of menu (types listed/explained in the 'Customising what's on the menus tutorial'). Default: 'tree'.
Parameter 'param' The name of the menu.
Parameter 'tray_status' The default tray status for the menu (must be either 'tray_open', 'tray_closed', or '' [blank]). Default: ''.
Parameter 'silent_failure' Whether no error message is to be output, if the menu does not exist. Default: '0'.

side_users_online

Description Shows the usernames of all the logged in members, and the guest count.
Use Users get a feeling of activity, and know who is currently online.

side_zone_jump

Description Shows a list of zones that the member has permission to enter, and allows you to select them to jump to any zone in the list.
Use Used on all Comcode left-hand panels to provide easy navigation.
Parameter 'table' Whether the block is shown in a standard box. Default: '1'.


Website content organisation

Web Content Management systems typically provide one of two systems for organising content:
  • Organising content types separately via modules
  • Organising content types together via a single tree structure (or often, just categories without an actual tree structure)

ocPortal organises content types via modules (with their own tree structures), but it also provides functionality so that your website can appear organised under a single tree structure.

Comcode pages may be organised to form a tree structure and then those Comcode pages may have blocks placed within them to display content.

Embedding entries

To embed entries you may use the 'main_content' block. This is described in more detail in the 'Providing featured content' tutorial.

Embedding categories

The 'main_download_category', 'main_cc_embed', 'main_gallery_embed' and 'main_news' blocks allow you to combine categories with your own personal wrapping Comcode, which is a very useful tool if you wish to integrate them tightly into your site. We do not, however, provide this functionality for all kinds of module because it would become over-complex. We provide a special module->block feature to bridge this (further details in the 'Provided featured content' tutorial).

Exporting attachments

Thumbnail: Where to export a Comcode page from

Where to export a Comcode page from

Thumbnail: An exported Comcode page consists of text like this

An exported Comcode page consists of text like this

Comcode pages support attachments, so that media may be arranged in the document to make a rich experience. When you create or edit your page, you have the option to add your attachments, and to arrange the Comcode attachment tags in your document, to perfect the layout.
The Comcode system also has support for 'inline attachments', which are constructed in a similar way to how attachments are stored in e-mail addresses (technically, it is called base64-encoding). This feature is very useful if you want to give a Comcode page, complete with attachments (images, or downloads, for instance), to another ocPortal user (for example, we are using it to distribute tutorials). When 'inline attachments' are found, ocPortal will extract them, much like the extracting of an archive, and rewrite the page so as to reference the extracted files as if the attachments were uploading locally.
To export a Comcode page with 'inline attachments', choose to edit the page, and click the 'Export page' link.








Concepts

Block
Building blocks that can be inserted into a Comcode page, in order to add interactive and date-bound functionality

See also

Is this tutorial insufficient?

If you think this tutorial needs work (maybe we didn't explain things well enough?) please let us know.