Skip to content

Article list sections

Victor Jonsson edited this page May 20, 2015 · 13 revisions

As of version 2.8

When you create a list (wp-admin -> Manage Lists -> Edit lists) you can choose if the list should support sections. This means that you will be able to group articles into sections as can be seen on http://www.vk.se and http://www.folkbladet.nu/

When a list is supporting sections a button with a plus sign will appear in the right corner of the list in the list manager. By pressing the button a "section divider" will be inserted in the list. This divider defines where one section ends and another one begins.

There is no template support out-of-the-box for this feature so you will have write your own logic in the theme. Here's an example of a page template that supports list sections:

<?php
/**
Template Name: Arlima Sections
 * Template for displaying an arlima list with articles divided in sections
 */
get_header();
if( !arlima_has_list() ): ?>
  <p>You must connect a list to this page!</p>
<?php 
else:  
  global $post;
  $current_list = arlima_get_list();
  $list_connector = new Arlima_ListConnector();
  $connection = $list_connector->getRelationData($post->ID);
  for($i=0; $i<6; $i++): ?>
    <div class="arlima-section section-<?php echo $i ?>">
      <?php arlima_render_list($current_list, array('section'=>$i, 'width'=>$connection['attr']['width'])) ?>
    </div>
  <?php endfor;
endif; 
the_footer();

This Wordpress plugin was created by Swedish newspaper Västerbottens-Kuriren to give its editorial staff an easy to use tool for customizing the front pages of their online magazines.

Installing Arlima

  1. Download the latest release from github and unzip the folder in your plugin directory.
  2. Open up wp-admin and activate the plugin.
  3. Go to "Article lists" -> "Edit lists" in wp-admin and create your first article list.
  4. Open up a page (or create it) in wp-admin. Down to the right you will see a meta box labeled "Arlima" where you choose the list that you created on step 2.
  5. Go to "Article lists" -> "Manage lists" and start stuffing your article list with interesting content.

Top links

Clone this wiki locally