Very simple and flexible plugin to show an article of the day.
Purpose: Sets articles as an "Article of the Day" and displays it in nice calendar widget (look at Screen 4).
Installation is a quick process:
Run the command:
$ php application/console plugins:install "newscoop/articles-calendar-plugin" --env=prod
Plugin will be installed to your project's newscoop/plugins/Newscoop
directory.
Include below smarty block into template (ex. front.tpl - calendar will be shown on homepage)
{{ articles_calendar }}{{ /articles_calendar }}
Go to an article edition in Newscoop Admin Panel to see Newscoop Article Of The Day Plugin on the right sidebar in action.
If you included calendar smarty block in front.tpl file then go to your homepage to see the calendar widget!
Plugin allows you to fully control article of the day calendar in very simple way (admin panel). Through plugin administration panel you are able to define all the settings regarding plugin.
Settings: (Entity/Settings.php
)
firstDay
- define first day of the month in calendar viewearliestMonth
- define the earliest month in calendar view for specified yearlatestMonth
- define latest month of the current year in calendar view (similarly to an example above)currentMonth
- define if the latest month should be the current month (if set, latestMonth
option doesn't apply)showDayNames
- show / hide day names on top of calendar viewnavigation
- show / hide navigation barimageWidth
- articles image width (optional field)imageHeight
- articles image height (optional field)rendition
- image defined resolution (ex. issuethumb (130x70))publicationNumbers
- list of publications IDs where articles of the day should appear (posibillity to add many publications)styles
- field to save CSS styles for calendar viewlast_modified
- date when custom CSS was last editedNOTE: firstDay
should be only numeric value: minimum: 1, maximum: 31. earliestMonth
and latestMonth
should be numeric values from 1 to 12.
All options listed above (without last_modified
, styles
and currentMonth
) can be overridden by the request parameters as given in example:
$firstDay = $request->get('firstDay', $settings->getFirstDay());
$navigation = $request->get('navigation', $settings->getNavigation());
...
If you wish to set your custom preferences by overriding Request parameters then you have to place your custom Javascript code with Ajax in any template file you wish calendar widget to appear.
Custom Ajax code example with all parameters possible to override:
<script type="text/javascript">
$.ajax({
type: 'POST',
url: '/plugin/articlescalendar/widget',
data: {
'publication_numbers': '2',
'currentMonth': true,
'earliestMonth': '2012-05',
'latestMonth': '2013-09',
'navigation': true,
'showDayNames': true,
'image_width': 130
'image_height': 70
},
dataType: 'html',
success: function(msg){
$('.js-articles-calendar-widget-container').html(msg);
}
});
</script>
When you set currentMonth
option to true
then the current month in calendar widget will be up to date -latestMonth
option won't apply in that case anymore.
Article edit screen:
Screen 1: Plugin view before any action is taken.
Status
- determines whether the article is an Article of the DayDate
- determines the date of an article (if set then the date format is: yyyy-mm-dd
), when we set an article as an article of the day, option to change date will appear (look at Screen 2).Visible in
- publications we wish an article of the day may show up. If defined, plublications list will show up (look at Screen 2)Choose date
- define an article of the day date. Date picker will show up when clicked.Choose publication
- multiple select box to choose publications where an article of the day may appearScreen 2: Plugin view after we set an article as an article of the day.
Unmark
button let us remove an article from an article of the day. If pressed then view on Screen 1 will show up with message: Article successfully unmarked.
and article will disappear from calendar view.
Screen 3: Plugin Admin Panel screen. Full size here.
All options from this screen are described in More about plugin
section.
Calendar widget screen: (with added articles)
Screen 4: Calendar widget screen. Full size here.
There has been error in communication with Booktype server. Not sure right now where is the problem.
You should refresh this page.