This page last changed on Oct 18, 2011 by jed.wheeler@involver.com.
content_list
The content_list system is used to build custom content items in SML.
Attributes
name |
type |
value |
active_content_list_items |
array |
Returns array of content list items |
pending_content_list_items |
array |
Returns array of pending items |
archived_content_list_items |
array |
Returns array of archived items |
Configuration
Caching issues
Examples
SML tags to enable Content List
(NOTE: There is no default template so nothing will be displayed in the tab until you add content inside the opening and closing tags.)
{% content_list %}{% endcontent_list %}
Output a List of Titles
<h2>My List</h2>
{% content_list %}
<ul class="data-list">
{% for content_list_item in content_list.active_content_list_items %}
<li>
<h3>{{ content_list_item.title }}</h3>
</li>
{% endfor %}
</ul>
{% endcontent_list %}
Simple Q & A List
(Using jQuery to toggle answer display and pagination to limit number of items per page)
<script>
$(document).ready(function() {
$('.toggle-content').hide();
$('.toggle-control').live('click', function() {
var control = $(this);
var parent = control.parents('.toggle-unit');
parent.toggleClass('expanded');
parent.find('.toggle-content').slideToggle();
});
});
</script>
<style>
.toggle-control {cursor: pointer;}
</style>
<h2>Q & A</h2>
{% content_list name:"my_list" %}
{% paginate content_list.active_content_list_items per_page: 5 %}
<ul class="data-list">
{% for content_list_item in active_content_list_items %}
<li class="toggle-unit">
<h3 class="toggle-control">{{ content_list_item.title }}</h3>
<div class="toggle-content">{{ content_list_item.description }}</div>
</li>
{% endfor %}
</ul>
{{ pagination_links }}
{% endpaginate %}
{% endcontent_list %}
|