Composr Tutorial: Advanced news

Written by Chris Graham (ocProducts)
This tutorial describes some of the more complex features available for news, including blogging and syndication.


Scheduled news / Manual date selection

See the basic configuration tutorial for information on setting up the CRON bridge scheduler.

You will see an advance scheduling option once the CRON bridge scheduler is enabled (requires the Composr calendar addon to be installed also).

Scheduling posts work by having the entry initially non-validated, then it will be auto-validated at the chosen time.

Pinging

'Pinging' (in the context of blogging) refers to an automatic alert feature that some software (including Composr) has. When you write a news post the URL to the news post can automatically be given to one or more ping services (defined in Admin Zone > Setup > Configuration > Feature options). These ping services typically are blog search engines, and the ping action automatically tells the search engine to go and index your new article.

A default service of http://pingomatic.com/ping/?title={title}&blogurl={url}&rssurl={rss} is configured for you. This particular service is a ping relay service which takes your ping and relays it off to many other ping services for you. Most users therefore won't have a reason to add any additional ping services.

The ping descriptors are just normal URLs, except you can put these three little placeholders in them which Composr will use to insert the specifics of any article being pinned:
  1. {title} (which will become the title of the article)
  2. {url} (which will become the URL of the article)
  3. {rss} (which will become the URL to your news RSS feed)

Pinging will only happen for news categories which may be accessed by guests.

Personal Categories / Blogs

Image

The blog in action

The blog in action

(Click to enlarge)

Image

The blog is linked to in the member profile

The blog is linked to in the member profile

(Click to enlarge)

Image

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

(Click to enlarge)

Composr has advanced support for blogging: members in permitted usergroups may have their own personal news categories, otherwise known as 'blogs' (short for 'web logs').

A member's blog is displayed in a tab on their member profile (Conversr-only). Depending on how you set up your news block on your main site, they may or may not display in it also.

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.

There is also a blogs CMS module separate to the news CMS module, under Content Management > Blogs. It is a stripped down version of the main news posting module, designed to make blog posting simpler. This is provided for two reasons:
  1. as a nicety so that you don't need to explain 'blogs are news' to your users
  2. so you can lock down access, so that members may submit to blogs but not website news
The presence of the blogs CMS module does not stop you using the regular news CMS module to submit blog posts.

Permissions required for blogs are:
  • Permission to access the cms zone [set in Admin Zone > Security > Permissions tree editor]
  • Permissions to access the cms:cms_blogs module (it's on by default) [set in Admin Zone > Security > Permissions tree editor]
  • The 'Have personal categories' privilege [set in Admin Zone > Security > Privileges, or as 'Have blog' in the Permissions tree editor on the cms:cms:news module if you want to set it just to apply for cms:cms_blogs]
  • The 'Add mid-impact content' privilege [set in Admin Zone > Security > Privileges, or as 'Add news' in the Permissions tree editor on the cms:cms:news module if you want to set it just to apply for cms:cms_blogs]

Advanced filtering of the news archive

The 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.

News archive / category indexes

The default view of the news module is the news archive, i.e. showing chronological news posts, drawn out dependent on the configured above category filtering.

There are also category index screens. The menu editor can find the entry-points for these index screens, but for reference they are:
  • site:news:select – list of all news categories (including blogs)
  • site:news:cat_select – list of all news categories (excluding blogs)
  • site:news:blog_select – list of all blogs

The index screens are generally useful for two reasons:
  1. If you want to direct users to see a list of categories/blogs
  2. If you want something to help you generate our the links to individual categories/blogs. Follow through from these and you will find URLs to specific categories/blogs (i.e. filtered versions of the news archive). Maybe you had thought Composr could only show blogs on a member profile tab: not true :).

Feeds

Image

Vienna is a good free program for viewing feeds on the Mac

Vienna is a good free program for viewing feeds on the Mac

(Click to enlarge)

Image

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

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

(Click to enlarge)

Feeds are very helpful – they make sure that the content on your site becomes available to a much wider audience, beyond direct visitors to your website. It's a very widely used tool throughout the web.

Composr 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 'Vienna' or 'Sputnik' or 'Feedly' (there are many programs), or incorporated onto another website. In reality it can be more than news, it fits anything that can match a similar title/author/body/category pattern (which is just about all content).

RSS is more common than Atom, but Atom is a cleaner standardised format; practically speaking there is very little to set them apart.

Outbound

Image

Viewing the list of feeds a Composr site supports (the OPML) from backend.php

Viewing the list of feeds a Composr site supports (the OPML) from <kbd>backend.php</kbd>

(Click to enlarge)

Image

Syndication links are displayed in the news block if the 'Visible RSS/Atom links' option is enabled

Syndication links are displayed in the news block if the &#039;Visible RSS/Atom links&#039; option is enabled

(Click to enlarge)

Links/URLs to view the feeds are made available from:
  1. from the OPML list
  2. the web browsers auto-discovery mechanism (via HTML metadata)
  3. the news blocks (disabled by default actually)
  4. or you can work them out yourself

To see all the feeds available from Composr (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.
Alternatively, go to Admin Zone > Tools > RSS/Atom Feeds.

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 real feed reader app or otherwise used with some kind of RSS tool.

If a news block is filtered (for a blog, for example) the URLs provided by it will open up the feed with the same filter.
The filter is driven by Selectcode. This is an example selecting all news from category #1:
http://yourbaseurl/backend.php?type=RSS2&mode=news&days=30&max=100&filter=1

Note also how there is a days parameter and a max parameter for limiting results. These work in the obvious way.

Birthdays and Calendar are implemented with extra configurability. By default they will show events that have happened (i.e. news-style). However you can pass method=happening to show events happening in the future (within the specified time window) or method=stream_in to show events as they become known to the system (i.e. when calendar events are added or members join).

Be aware that feeds may be filtered or empty depending on access permissions. Particularly, if you use a 3rd party service to process your feed it will be accessing that feed as a guest user, unless you set up HTTP authentication with a valid member's username or password.

Inbound

Image

Viewing an external RSS feed

Viewing an external RSS feed

(Click to enlarge)

Image

Adding a main_rss block via the Block construction assistant

Adding a <kbd>main_rss</kbd> block via the Block construction assistant

(Click to enlarge)

Composr itself provides two blocks that allow display of RSS and atom feeds in a news-like fashion (including feeds from other Composr sites, or any other site that provides them).

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]

Important security note

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.


Legacy feeds

Before RSS and Atom became popular, there was a type of feed called a 'JavaScript feed', and also feeds that work via 'iframes'. Composr 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.

Feed merging

If 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 Composr.

Yahoo Pipes no longer exists, but alternatives do:
The 13 Best Yahoo Pipes Alternatives You Should Look at Today

Trackbacks (advanced)

Image

Trackbacks as displayed

Trackbacks as displayed

(Click to enlarge)

Image

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

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

(Click to enlarge)

Trackbacks are an advanced standard-based blogging feature, that allow a link to be established from an article on one blog to an article on another. It basically is a citation mechanism.

Trackbacks work as follows:
  1. The original article has a 'trackback' link written into the HTML
  2. When a blogger decides to write an article based upon the original article, they inform their software of the source article they are citing
  3. Composr loads up the trackback link so as to inform the original article of the new one.
  4. The original article then can display a list of articles that lead on from it, along with other features such as comments.

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

By default trackbacks are not enabled in the configuration. To use them you need to enable the "Trackbacks" option, and enable them on individual content items.

Avatars in news posts

By 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 Composr 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.tpl template – this template encodes the logic described above, so by changing the template you can achieve either behaviour, or any combination.

Integrating third-party widgets

There are a lot of 'widgets' out there for blogging platforms and there's nothing stopping you using them with Composr 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.tpl template.

Make news archive screens show summaries

The 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.

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


Feedback

Please rate this tutorial:
Item has a rating of 5 (Liked by enelson)

Have a suggestion? Report an issue on the tracker.

Back to Top