For those wanting an easy interface to create news updates, this is the tool for you. Obviously, one simply needs to write up a news article. But the question of when, where and how to display it is also a matter of concern.
News Manager has many different options for how to include and configure content on a news article, as well as several other helpful features that make posting news articles to a website much easier.
Attaching files to a news article is easy with News Manager, and there are several different options for controlling availability and the display of the attachments to readers of the article. To attach something to an article, at the bottom of the page where you add and edit articles, there are several fields under the "Attachments" section that are for uploading attachments. Simply click "Browse" on one of the fields and locate the file you wish to attach.
To enable Image Repository Manager for news attachments feed, add LOCAL_NEWSMANAGER_REPOSITORY_IMAGE_CATEGORY_IDS map with comma delimited repository image category IDs list to use. Then, all images in the categories will show in a set of select boxes under attachment image upload section of news add/edit form. You can use Image Repository Manager for images which will be used over and over. After an image is selected and saved, the same attachment options will be applied to the image from Image Repository Image.
NOTE: The Auto Link, Article Image, Headline Thumbnail and Caption options are set on an attachment-by-attachment basis, so in order to have access to them, you must first add the article with the attachments and then edit the article either directly after adding by selecting "Edit Article" or by going to the News Manager administration page, finding the article and then selecting to edit it. The attachments are listed in a table at the bottom of the edit article page.
News Manager displays a list of articles at any location on your website by using typical LumpaCMS code. When each article is clicked, the content of clicked article displays. The example codes for a list of articles are as follows:
:::HEADLINES:5:ARGS: template=news_teaser_style&item_template=news_teaser_item_style&max_chars=55 :::
:::HEADLINES:-1:ARGS: yearly=1&rss_limit=10 :::
A number between HEADLINES and ARGS indicates maximum number of items to display in the list. -1 means no maximum. Comma separated variable and value pairs are options passed to news headline display function.
News Manager uses templatized HTML to generate output for News Headlines and News Article display.
Using templates and overriding CSS for News Headlines:
:::HEADLINES:5:ARGS: template=headline_style&item_template=headline_item_style :::
::DESCRIPTOR:rss_feed::- replaced with rss feed link
::DESCRIPTOR:year_list::- replaced with news year list
::DESCRIPTOR:filter_info::- replaced with news filter criteria
::DESCRIPTOR:item_list::- replaced with news item list
::DESCRIPTOR:news_id::- replaced with news id
::DESCRIPTOR:news_headline::- replaced with news headline
::DESCRIPTOR:news_subheadline::- replaced with news sub headline
::DESCRIPTOR:news_byline::- replaced with news by line
::DESCRIPTOR:pretty_news_date::- replaced with news date list
::DESCRIPTOR:image_count::- replaced with image attachment count
::DESCRIPTOR:thumbnail::- replaced with thumnail image
::DESCRIPTOR:attachment_list::- replaced with attachment list
::DESCRIPTOR:news_content_shorten::- replaced with shortened news content. Set the 'keep_paragraphs' variable to 1 in order to retain paragraph formatting.
::DESCRIPTOR:news_tag_list::- replaced with tag list
::DESCRIPTOR:news_category_list::- replaced with category list
::DESCRIPTOR:news_comment_count::- replaced with comment count
Using templates and overriding CSS for News Article:
:::HEADLINES:5:ARGS: article_template=news_article_style :::
::DESCRIPTOR:functions::- replaced with miscellaneous buttons group
::DESCRIPTOR:admin_embargo_notice::- replaced with news embargo notice for admin's view
::DESCRIPTOR:headline_block::- replaced with news headline, sub headline, and by line block
::DESCRIPTOR:news_date_list::- replaced with news date list
::DESCRIPTOR:news_content::- replaced with news full content
::DESCRIPTOR:photo_gallery::- replaced with photo gallery block
::DESCRIPTOR:all_attachment_list::- replaced with attachment list
::DESCRIPTOR:acrobat_reader::- replaced with acrobat reader link only when a PDF attachment exists
::DESCRIPTOR:comment::- replaced with comment list and comment add form
::DESCRIPTOR:email::- replaced with email form
::DESCRIPTOR:close_button::- replaced with close button in popup mode
Some sample template files (news_examples.template, news_archive_style.template, news_archive_item_style.template, news_article_style.template, news_teaser_style.template, and news_teaser_item_style.template) are available in your template directory. Please refer them. If you don't have them in your template directory, you can find them from LunpaCMS codebase.
:::HEADLINES:limit:ARGS: ... :::
:::HEADLINES:limit:ARGS: ... :::code to show requested article.
With a combination of the category_ids, template, and item_template options as well as formatting the templates with the proper descriptors, newsmanager can be easily formatted as a blog.
:::HEADLINES:5:ARGS: category_ids=1&template=news_blog_archive_style&item_template=news_blog_archive_item_style :::
This example has a blog where all the articles are set to the category of id 1, and the formatting of the news pages is controlled by the news_blog_archive_style template and the news_blog_archive_item_style template, shown below
news_blog_archive_style.template - simply displays the item_list for the news headline list block:
<div class="newsMgr"> <div> ::DESCRIPTOR:item_list:: </div> </div>
news_blog_archive_item_style.template - edits the display of each headline
<div style="padding-bottom: 25px;"> <table style="width: 100%;"> <tr> <td style="vertical-align: top; width: 30px; text-align: right; padding-right: 5px;">::DESCRIPTOR:thumbnail::</td> <td style="vertical-align: top; text-align: left; padding-top: 5px;"> ::DESCRIPTOR:news_headline:: ::DESCRIPTOR:news_byline:: ::DESCRIPTOR:news_subheadline::<br> ::DESCRIPTOR:pretty_news_date:: ::DESCRIPTOR:news_content_shorten:: ::DESCRIPTOR:news_tag_list:: </td> </tr> </table> </div>
You can enable comment feature on your news articles by adding the ::DESCRIPTOR:comment:: tag to the article style template.
By default, all news comments require moderation process before they are allowed to be posted on the site. To moderate comments, go to the News Manager Admin page, click "Moderate Comments" and review the comments to moderate. In order to skip moderation, set the LOCAL_NEWSMANAGER_COMMENT_AUTO_APPROVE map to 1, and comments will be posted as soon as they are entered.
In order to display the contents of a news article on another page of the site, without adding a link or using the
:::HEADLINES::: tag which just lists the headlines of various news articles, you can use the
:::NEWS_ARTICLE:ID:<news article id>::: tag. This displays the contents of the article where you place the tag, with the article truncated and including a link to the full article. By using using the
:::NEWS_ARTICLE:ID:<news article id>:ARGS: <options> ::: tag with the options below.
:::NEWS_ARTICLE:ID:<news article id>:ARGS: no_headline=1&max_chars=500&no_highlight_text ::: This will display the article with no main headline, 500 characters of the news article and will not highlight urls or email addresses.
News Manager provides a default sub routine for new headline, however, this sub routine can be overridden for any purpose. To override default sub routine, define LOCAL_NEWSMANAGER_CUSTOM_NEWS_OUTPUT map with custom sub routine's name as its value.
News Manager supports the option to embargo all new articles by default. This feature is useful for organizations that require a review process on new postings. To embargo news articles by default, set the
LOCAL_NEWSMANAGER_AUTO_EMBARGO map to
News Manager supports the option to email new postings to subscribers automatically.
The style template is called news_subscriber_email.template, which allows a style template to be configured seperately from other styles on the website due to the special nature of css and email.
In order for the subscriptions to be sent, several maps are required to be set:
Since a news article will be set a maximum of one time to the subscribers, it is recommended that the map LOCAL_NEWSMANAGER_AUTO_EMBARGO is set to 1 which will make it so news is automatically embargoed, and may help from accidentally sending articles before they are ready. This also allows the admin creating the article to view the article and share it with other admins for approval before sending. To send, either set a real embargo date and add the lines below to the crontab, or edit the article and turn off all embargos.
In order for news to be sent when they come off embargo, add these lines to the crontab for the site:
0,10,20,30,40,50 * * * * perl /htdocs/your domain.com/html/admin/newsmanager/sys/batch_send.pl 01 00 * * * perl /htdocs/your domain.com/html/admin/newsmanager/sys/expired_embargo_email_check.pl
To enable VERP, the following line must be added to the mail aliases file:
news-your-domain: "|/htdocs/local/newsmanageradmin/sys/news_mailbox_check.pl --cnf-file /home/mail/yourdomain-my.cnf --database yourdatabase --host yourdomain.com"
LunpaCMS keeps statistics on news articles. To view the statistics for news manager, go to the admin page, click on News Manager and then News Statistics. At the top will be several different statistics to look at, such as Top Emailed Articles, Top Viewed Articles, etc. When on one of the pages of statistics, they can be filtered by time period by selecting the period desired from the drop down menu and clicking "Refresh." Statistics are not collected if you are viewing the article through the admin side of the website.
In order to view a single article's statistics, find the article you wish to see the stats for under the admin newsmanager page and open it. On the functions bar, next to the social media links, there will be two admin functions "edit" and "stats." Click stats to see all of the stats for that article. These can also be acquired by going to the News Statistics Page and clicking "Single Article" and entering the News Article's ID.
For sites that have a large amount of news articles and high traffic, LunpaCMS has the ability to archive older statistics. By not keeping track of the day-by-day stats older than 6 months (by default), the table size is greatly reduced.
Setting Up Archiving:
Place this line in your crontab to run the archiving script once a month:
01 0 1 * * perl /htdocs/<Your Site Name>/html/admin/newsmanager/sys/archive_news_stats.pl
LunpaCMS indexes newsmanager articles once a day to make sure that searches in news articles are as accurate as possible. The price for this is that indexing news articles (especially on a site with a large amount of articles) can be a timely process. To avoid the first user of the day encountering a problem with a very slow load time on their page, an automatic call to the page does the index can be made daily.
crontab -ewhich will bring up the cron processes
01 00 * * * perl /htdocs/<sitename>/html/admin/newsmanageradmin/sys/generate_glimpse_general.pl
When the option no_popup is applied to a list of headlines, the news article will open on the same page as the headlines. This also activates the ajax email functionality for the news article. In order to make sure the email functionality still works properly when switching from a popup article to a no_popup article, make sure that you add the
::DESCRIPTOR:email:: tag to the news article style. This will add a form on the same page as the news article from which users can send the article and will submit the form via ajax.
Copyright © 2021 Peregrine Computer Consultants Corp. All rights reserved.
About Lunpa, our mascot. Her mother was a hamster and her father was an ill-tempered Chilean M00se. Oddly, neither smelt of elderberries.
The artist is Jennifer Lomax.