ocPortal Tutorial: Advanced news
Table of contents
Personal Categories / Blogs
A blog being started by adding news to a category that will automatically be created
The blog in action
The blog is linked to in the member profile
There is a blogs CMS interface separate to the news CMS interface. This is provided for two reasons:
- as a niceity so that you don't need to explain 'blogs are news' to your users
- so you can lock down access, so that members may submit to blogs but not website news
Advanced filteringThe news system supports some advanced filtering:
- Whether to show just non-blog posts, blog posts, or both
- Whether to limit results to within certain news categories
- As above, but double filtered so that news is only returned if it matches a second category filter also (this allows you to have a two-level news categorisation system, useful for large news sites)
The news blocks take parameters representing these filters, and then the links they spawn relay those, throughout the various navigation links.
Also, when you view a news post you can see what categories it is in and choose a new filter to limit results just to ones within that category.
Syndication links are displayed in the news block
RSS/Atom are really XML formats, and look a bit like this
The Comcode syntax you should use to place the main block in a page is as follows:
You may also use the compressed version intended for the sides of pages:
FeedReader is a good free program for viewing feeds
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.
Yahoo PipesIf you want to merge or filter feeds, Yahoo Pipes is an absolutely fantastic tool. You basically tell it to look at a set of RSS feeds, give it some filters, and you get an RSS feed you can then plug into ocPortal.
Special invisible mark-up code in the ocPortal HTML allows systems to see how they can place trackbacks to ocPortal
Trackbacks as displayed
Trackbacks work as follows:
- The original article has a 'trackback' link written into the HTML
- When a blogger decides to write an article based upon the original article, they inform their software of the source article they are citing
- The software 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.
Avatars in news postsBy default news posts show the news category image rather than the poster's avatar.
If you uninstall the 'authors' addon it will automatically change to showing avatars. The reason being that default ocPortal acts more like a news site than a community site – but by removing 'authors' you tell it you're not interested in that focus.
Instead of removing the 'authors' addon you could change the NEWS_BOX template – this template encodes the logic described above, so by changing the template you can achieve either behaviour, or any combination.
Integrating third-party widgetsThere are a lot of 'widgets' out there for blogging platforms and there's nothing stopping you using them with ocPortal too. For example, this widget allows you to see what people are saying about your article on Twitter. You could easily put the HTML provided into your NEWS_ENTRY_SCREEN template.
Make news archive screens show summariesThe default news archive screen shows just the news headlines. By adding :inline=1 to the page-link you can make it show like the news block does.
- A contraction of web-log: the popular term for an on-line journal
- Someone who runs a blog
- Really simple syndication: a family of news feed formats
- A news feed format made official by a standards body
- 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