Turn a blog into an event calendar (in conjunction with NP_EventCalendar 1.0 or greater, included in download). Show a calendar with past and future events, display a few upcoming events on your main page, or in a sidebar. Requires Nucleus CMS 3.60 or higher.
| General Plugin info | |
|---|---|
| Author: | gRegor, ftruscot |
| Current Version: | 2.00.01 |
| Download: | download |
| Code: | na |
| Demo: | demo |
| Forum Thread: | http://forum.nucleuscms.org/viewtopic.php?t=9035&highlight= |
You probably already have a main blog set up for your group, organization, etc… To use this plugin, you should create a New Weblog following the “Advanced” method described in the instructions on the New Weblog form (click “New Weblog” in the left navigation bar of the admin area).
Once the blog is created, edit its settings (from the Admin Home page in the admin area) and set the “Enable Event Blog plugin” field to “yes” and then save the setttings. This will allow this blog to show future items and work with the EventBlog plugin. Your main blog should leave this field set to “no”.
Now you have a blog ready to be used to display events and the real work begins. In the following example, we have a comedy troup with weekly engagements. We want the next upcoming event to be listed in a sidebar of the main site with a link to a page with the full calendar view of all past and future events. We have given this new weblog the shortname of “events”. We are using the default skin, but this can be done with any skin.
1. Add some event items into the events blog. Be sure to complete the Extra Plugin fields for the Event Blog plugin (event date, venue, times, etc…).
2. Add the “Upcoming Events” block to the sidebar. In the skins/default/sidebar.inc file, insert the following block of code where you want the list of upcoming items displayed:
<div class="sidebar"> <div class="nextevent"> <h3>Next Show</h3> <%EventBlog(future[list],1,events,default/eventlist)%> </div> </div>
3. Create a new template called default/eventlist to format listed events in sidebar.inc. The easiest way to do this would be to clone the default/index skin and to rename it default/eventlist. Then edit the default/eventlist template and replace the Item Body field with the following:
<h4><a href="<%itemlink%>" title="<%title(attribute)%>"><%title%></a></h4> Date: <%date%><br /> Time: <%EventBlog(var,starttime)%> to Time: <%EventBlog(var,endtime)%> <br /> Venue: <%EventBlog(var,venue)%> <br /> Address: <%EventBlog(var,street)%> <%EventBlog(var,city)%>, <%EventBlog(var,state)%> <%EventBlog(var,zip)%> <p>Tickets are $<%EventBlog(var,cost)%> at the door. <%EventBlog(var,ages)%> ages welcome.</p> <%body%> <%morelink%>
4. Add another template for showing the events on the item pages skin part. Clone default/item and rename the clone to default/event. Modify the Item Body field of the default/event template to look like this:
<div class="contenttitle"> <h2><%date%>: <%title(raw)%></h2> </div> <div class="contentbody"> Date: <%date%><br /> Time: <%EventBlog(var,starttime)%> to Time: <%EventBlog(var,endtime)%> <br /> Venue: <%EventBlog(var,venue)%> <br /> Address: <%EventBlog(var,street)%> <%EventBlog(var,city)%>, <%EventBlog(var,state)%> <%EventBlog(var,zip)%> <p>Tickets are $<%EventBlog(var,cost)%> at the door. <%EventBlog(var,ages)%> ages welcome.</p> <%body%><br /><br /> <a name="more"></a><%more%> </div>
5. Adjust the template/html/css as needed to make it fit your site, but you should now see the next event in the sidebar.
6. Modify the Main Index skin part of the default skin to handle the events blog and the main blog differently. Remember, we want the Upcoming Shows page (index of events blog) to show a calendar and the next so many shows. In the admin area, find the Main INdex part of the default skin and replace <%blog(default/index,10)%> with the following:
<%if(blogsetting,bshortname,events)%> <hr /> <%EventBlog(calendar,events)%> <hr /> <%EventBlog(future,10,events,default/eventlist)%> <%else%> <%blog(default/index,10)%> <%endif%>
7. Modify the Item Pages skin part. Replace <%item(default/item)%> with this:
<%if(blogsetting,bshortname,events)%> <%EventBlog(all,1,events,default/event)%> <%else%> <%item(default/item)%> <%endif%>
8. Modify the Archives skin part. Replace <%archive(default/index)%> with this:
<%if(blogsetting,bshortname,events)%> <hr /> <%EventBlog(calendar,events)%> <hr /> <%EventBlog(all,100,events,default/eventlist)%> <%else%> <%archive(default/index)%> <%endif%>
9. Finally, somewhere in the sidebar.inc file, add a link to your events blog so visitors can find your Events.
10. Add some CSS to your css file (default_right.css in the default skin). It might look like this:
.calendar { position:relative; left: 100px; width: 300px; } table.calendar { font-size: small; color: black; } tr.calendardateheaders { font-size: small; color: #ededed; } td.days { text-align: center; } td.today { text-align: center; color: #ededed; background-color: #696a64; }
11. Now pretty it up and tweak it to meet your needs. You may want to have the main blog's category list appear in the sidebar of the events blog. In the sidebar.inc file where you see the categorylist variable, add the blogname parameter using the shortname of your main blog (mainblog in example): <%categorylist(default/index,mainblog)%>
Please report any bugs at http://forum.nucleuscms.org/viewtopic.php?t=9035&highlight=