Composr Tutorial: Advanced news
Written by Chris Graham
This tutorial describes some of the more complex features available for news, including blogging and syndication.Table of contents
Scheduled news / Manual date selection
See the basic configuration tutorial for information on setting up the system scheduler.You will see an advance scheduling option once the system scheduler is enabled (requires the Composr calendar and commandr addons to be installed also).
Scheduling posts work by having the entry initially not 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:
- {title} (which will become the title of the article)
- {url} (which will become the URL of the article)
- {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
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 Admin Zone > Content > Blogs. It has to be enabled via the "Separate blogs" configuration option. It is a stripped down version of the main news posting module, designed to make blog posting simpler. This is provided for two reasons:
Permissions required for blogs are:
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 Admin Zone > Content > Blogs. It has to be enabled via the "Separate blogs" configuration option. It is a stripped down version of the main news posting module, designed to make blog posting simpler. This is provided for two reasons:
- as a nicety 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
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:
- If you want to direct users to see a list of categories/blogs
- 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
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.
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
Links/URLs to view the feeds are made available from:
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&select=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 algorithm=happening to show events happening in the future (within the specified time window) or algorithm=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.
- from the OPML list
- the web browsers auto-discovery mechanism (via HTML metadata)
- the news blocks (disabled by default actually)
- 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&select=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 algorithm=happening to show events happening in the future (within the specified time window) or algorithm=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
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). HTTP-authentication is supported in the URL syntax.
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:
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:
http://www.makeuseof.com/tag/12-best-yahoo-pipes-alternatives-look/
Trackbacks (advanced)
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:
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" configuration option, and enable them on individual content items.
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
- Composr 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.
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" configuration 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.
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 online 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:
Have a suggestion? Report an issue on the tracker.