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

ocPortal Tutorial: Advanced news

Written by Chris Graham, ocProducts
The ocPortal news system is advanced and flexible. It can be used for placing simple and short news pieces, for organising the articles that make up the main content of your website, and for giving members of your website their own personal blogs.



Personal Categories / Blogs

Thumbnail: A blog being started by adding news to a category that will automatically be created

A blog being started by adding news to a category that will automatically be created

Thumbnail: The blog is linked to in the member profile

The blog is linked to in the member profile

When we originally designed the ocPortal news system, the emphasis on the concept of 'blogging' was not as it is today: people have always had personal websites, and on-line personal journals, often as a segment of a larger website. Perhaps the phenomenon is due to the public's need to focus on a simple concept that interests them, and to reshape terminology around the way they wish to think about the technology available to them. Perhaps it is due to an increased accessibility and understanding of complex communication technology, with the rise of mobile phones and the need to regularly use the Internet. Perhaps it is due to the desire to be heard in an always expanding populous, and to reach those who share similar interests, when it is becoming increasingly common not to know your neighbours.
Thumbnail: The blog in action

The blog in action

But social commentary beside, ocPortal has advanced support for blogging: members in permitted user-groups may have their own personal news categories, otherwise known as 'blogs' (short for 'web logs').
To create a 'blog', a member only needs to choose to add news, and select their own personal category; if the category does not yet exist, it will be displayed as 'new', and created automatically upon submission. The news will display on the front page of the website (by default), and the blog for the member may be viewed from the links given in their member profile.

Feeds

Thumbnail: Syndication links are displayed in the news block

Syndication links are displayed in the news block

ocPortal supports the two main formats for syndication of news (and most other kinds of content) in clean XML format: 'Atom' and 'RSS'. These formats are simple representations of news that may be viewed using an external program such as 'FeedReader', or incorporated onto another website. ocPortal itself provides two blocks that allow display of RSS and atom feeds in a news-like fashion (including feeds from other ocPortal sites, or any other site that provides them).
Thumbnail: RSS/Atom are really XML formats, and look a bit like this

RSS/Atom are really XML formats, and look a bit like this

Links to view the feeds are made available from the new block, and if the news block is filtered (for a blog, for example) the link will open up the feed with the same filter. The URLs are not intended to be viewed directly, although we have used a technology called 'XSLT' to allow them to be displayed in the browser if desired; instead, they should be copied and pasted to another program.
The Comcode syntax you should use to place the main block in a page is as follows:

Code

[block="http://example.com/feed.xml"]main_rss[/block]
You may also use the compressed version intended for the sides of pages:

Code

[block="http://example.com/feed.xml"]side_rss[/block]
Thumbnail: FeedReader is a good free program for viewing feeds

FeedReader is a good free program for viewing feeds

Please note that you should trust a feed before you consider placing it on your site, as it is possible for them to contain Javascript that could intercept your password cookies, and perform other malicious actions.

Before RSS and Atom became popular, there was a type of feed called a 'Javascript feed', and also feeds that work via 'iframes'. ocPortal supports use of these feeds simply by putting the HTML that the feed maintainers ask you to use in your website, inside a Comcode HTML tag. The nature of these feeds are such that they embed portions of HTML into your own site, either via Javascript adding it directly on the client-side (users computers), or via a frame: they provide a simple bridge, rather than a clean feed.

To see all the feeds available in ocPortal (news is just the most typical usage for them), you may go to http://yourbaseurl/backend.php: you will be presented with a screen that lists the feeds. The screen here is written in yet another language named OPML, and again made viewable in a web browser using XSLT.

Trackbacks

Thumbnail: Special invisible mark-up code in the ocPortal HTML allows systems to see how they can place trackbacks to ocPortal

Special invisible mark-up code in the ocPortal HTML allows systems to see how they can place trackbacks to ocPortal

Thumbnail: Trackbacks as displayed

Trackbacks as displayed

Trackbacks are an advanced blogging feature, programmed according to a standard, that allow a link to be established on an article on one blog, with an article on another. Essentially the original article has a 'trackback' link written into the HTML and when a blogger decides to write an article based upon the original article, they inform their software of it which loads up the trackback link so as to inform the original article of the new one. The original article then can display a list of articles that lead on from it, along with other features such as comments.

ocPortal can send trackbacks for news and receive them for almost any kind of content.


Concepts

Blog
A contraction of web-log: the popular term for an on-line journal
Blogger
Someone who runs a blog
RSS
Really simple syndication: a family of news feed formats
Atom
A news feed format made official by a standards body
Trackback
A trackback is placed at the content home-site when a blogger references a piece of content- in essence, allowing the source material to automatically link to those that reference/quote/comment-upon it

See also