Unusual website sections that need special attention
Most content sections are very simple: a home "listing" page with summary views of multiple entries, and an "story" or "program" page for a complete view of single entries within the content section. But a few sections are more complex, and require unique design solutions.
The WILL Education Section was revamped in 2015 to consist mostly of a new blog maintained by the Public Engagement Coordinator and the Educational Outreach Coordinator. The Index page and the blog pages use the same Tagger-based filtering as described above in the Election 2014 section.
The sidebar labeled WILL Education Links contains legacy content that should probably either be updated or archived. The Book Mentor Project may need to be revised, as there may be a desire to post new content to it, but this is as yet undefined.
The index template uses a unique {sn_homepage_education} to display a 2x2 grid of Education Blog posts sorted by tag. The Education Blog displays all blog entries, and has four sub-blogs sorted by the four main tags:
Important: Blog authors must use these exact tags to allow posts to be correctly sorted. Adding a hyphen between any of the tag words entered conflicts with the url-safe tag, so hyphens should never be used in tags.
The Home page of the Illinois Youth Media section uses the snippet {sn_homepage_illinoisyouthmedia} to create a display featuring the top three/most recent projects, and below that a grid showing all other projects.
Project pages use a snippet named {sn_homepage_projects} to create a project Home page. This snippet is also used for each single entry page in the project using {if} statements to display conditional markup. This is either extremely clever and elegant, or more complicated than it needs to be.
Look carefully at the templates for each project to see variables like {preload_replace:video_in_project="no"} which are used for conditionals in the sidebar template.
With a little more development, {sn_homepage_projects} might be useful for any future projects of any kind. This would require adding a variable-driven sidebar, at the very least.
The template for this single-page legacy project uses {sn_articles_related_entries} to display related entries from arbitrary channels, and a new channel Content Collections or {collections} to create a single entry containing the related entries.
Important: The mentalhealth/index template contains a variable for {pre_entry_id}, which contains the entry_id of the Mental Health entry in the Content Collections channel. Like this: {preload_replace:pre_entry_id="33111"}
New collections can now be created simply by:
{pre_entry_id} variableThis section consists of two main web pages and the live audio player for IRR. The two pages are both created as WILL Pages. These point to the illinoisradioreader/index template, which uses the standard {sn_pages} snippet and the embeds/_embed_sidebar_illinoisradioreader template for its sidebar. The audio player template is player/audioplayer_irr, and the sidebar contains the link to launch it.
Recently added are four "podcast" pages containing a weeks worth of IRR archives of readings from four area newspapers. The Director of the IRR manages this content.
Starting in 2014 we built a new kind of Election News page, which is a great template for using tags to aggregate content on one "collection" page.
The idea is to use the Tagger module to display content from several channels. In the election2014 template group, the index page contains the following key preload_replace key:value pairs (plus other stuff):
{preload_replace:pre_channel="features|news|newsnational|focus|highlights"}{preload_replace:pre_tags="election-2014"}{sn_articles_by_tag}The template calls the snippet {sn_articles_by_tag} which contains all the html and EE code to display the tagged entries. Here's the opening EE Tagger code:
{exp:tagger:entries_quick channel="{pre_channel}" tag="{pre_tags}" orderby="entry_date" sort="desc" limit="10000"}
The snippet simply displays any entries in the specified channels containing the tag “election-2014” (which is added to entries as election 2014, without the hyphen - the Tagger module adds hyphens between words, and the resulting string becomes the "uri safe tagname").
The other templates in the Election2014 group do the same thing using tags for the different election contests, e.g. the election2014/illinois-governor template contains this variable: {preload_replace:pre_tags="illinois-governor-2014"}
{preload_replace:pre_tags="tag-name"} variable. The tag name must be "uri safe," meaning no spaces, so if the chosen tag has spaces use a – between words. Make sure content authors use this exact tag.{pre_channel} variable.{pre_title} and {pre_description} variable values to say what the page is about. Almost there!{pre_channel_description_entry_id}After setting up the new template, entries using the designated tag will display on the tag page as they are added to the site.
Documentation on the EE Tagger extension is available here: http://www.devdemon.com/documentation/tagger/
This solution depends on content producers consistently using the specific tags with each entry intended for the collection. When setting up a new tag-based collection, make sure to document and communicate which tag(s) to use.
As with most site templates, the sidebar on tag-based collection pages can be anything desired. If you want something custom, just create a new sidebar in the embeds template group and include it in the template like this:
{preload_replace:pre_sidebar_template="embeds/_embed_sidebar_election2014"}
The right sidebar of the Election 2014 templates also contains a feed pulling from the NPR Story API. In this case it's a feed of election stories but the API call can be changed to any other topic. For example, we used the NPR API to pull stories on Mental Health and display them on WILL's Mental Health project page.