SMT Page Items
Total customization possibilities.
last updated April 23, 2019
You can choose the kinds of data you load in ScotsBlogger if you want to customize the experience. For example, you could display the latest three posts on your home page or have some ScotsBlogger links in your sidebar.
Note about displaying data:
The variable l.settings:scotsblogger:currentpost:title can be display two different ways.
<mvt:eval expr="l.settings:scotsblogger:currentpost:title" />
or as a page entity like this: sb mvt:scotsblogger:currentpost:title]
The Basic Page Items
The following three calls are used in the main blog page. All of these calls could be put together manually, the styles in the head, the javascript in the foot, and all of the template actions, however this makes it much easier.
This is a general load for the main blog page and loads loads various css, parses featured image, first image found, and sets twitter card and open graph (facebook) data from current post.
<mvt:item name="scotsblogger" param="head" />
Automatically loads up the SCOTSBLOGGER_TEMPLATE page.
<mvt:item name="scotsblogger" param="content" />
Automatically loads ajax for reviews, loads featherlight js (if in use) for images, writes javascript for verifying certain actions.
<mvt:item name="scotsblogger" param="foot" />
AMP and RSS
AMP and RSS page items must be placed at the top of the main blog page to work properly. All templates from 2.2 and up have these in place.
<mvt:item name="scotsblogger" param="amp" />
<mvt:item name="scotsblogger" param="feed" />
The amp-discover parameter is used in scotsblogger_template to make AMP versions of the pages discoverable.
<mvt:item name="scotsblogger" param="amp-discover" />
Articles/Posts
Load current article info into a structure: l.settings:scotsblogger:currentpost
<mvt:item name="scotsblogger" param="current post" />
Load the default number of recent posts (as set in the configuration) into an array: l.settings:scotsblogger:posts
<mvt:item name="scotsblogger" param="recent posts" />
Load specific number of recent posts, overriding configuration setting.
The following page item loads 10 most recent posts into the array: l.settings:scotsblogger:posts
<mvt:item name="scotsblogger" param="10 recent posts" />
Load default number of posts that are not in the current category (g.scotsblogger_category_code) into array: l.settings:scotsblogger:posts
<mvt:item name="scotsblogger" param="recent posts exclude category" />
<mvt:item name="scotsblogger" param="15 recent posts exclude category"></mvt:item>
Use the post slug to set g.scotsblogger_slug and g.scotsblogger_postid
This will load current post data to a structure: l.settings:scotsblogger:currentpost
<mvt:item name="scotsblogger" param="post some-post-slug" />
Display one or more posts via their code. Posts can share codes for another way to group similar posts together. If there is more than one post with the same code, multiple calls to the page item will bring up the posts one at a time. You can also set a start point, say, if you want to start on the 2nd post.
<mvt:item name="scotsblogger" param="display content_code" />
<mvt:item name="scotsblogger" param="display content_code 2" />
If g.scotsblogger_postid contains a valid post id, this will load the post data into l.settings:scotsblogger:currentpost
<mvt:item name="scotsblogger" param="load_postid" />
Categories (and posts)
Set g.scotsblogger_catslug and g.scotsblogger_category_code based on a category slug.
<mvt:item name="scotsblogger" param="cat some-cat-slug" />
Load the category list info into an array: l.settings:scotsblogger:categories
Also loads the default number of recent posts information (no rendered) into an array: l.settings:scotsblogger:posts
If g.scotsblogger_category_code is set (if we're in a category) it will load the posts in that category (without rendering) to an array:
l.settings:scotsblogger:catposts (this page code is somewhat obsolete)
<mvt:item name="scotsblogger" param="sidebar" />
Load top level category array into l.settings:scotsblogger:categories
and current category (g.scotsblogger_category_code) into a structure: l.settings:scotsblogger:currentcategory
<mvt:item name="scotsblogger" param="categories" />
Load posts and other information from current category (g.scotsblogger_category_code).
- array:
l.settings:scotsblogger:categories - structure:
l.settings:scotsblogger:currentcategory - array:
l.settings:scotsblogger:categoryposts (not rendered)
<mvt:item name="scotsblogger" param="category posts" />
loads all posts (not rendered) in category into an array: l.settings:scotsblogger:categoryposts
<mvt:item name="scotsblogger" param="category posts all" />
loads default number of articles with rendered content into an array: l.settings:scotsblogger:categoryposts
<mvt:item name="scotsblogger" param="category posts rendered" />
loads all articles in category with rendered content into an array: l.settings:scotsblogger:categoryposts
<mvt:item name="scotsblogger" param="category posts all rendered" />
Display a nested category tree with articles using UL's and LI's - mainly for use with various jquery menu systems (like the one to the left.) First parameter is treelist, second is the category to start the tree with (or :top: to start with the top level categories). The tree defaults to published articles only, but you can include a third parameter, either all or d for all articles or drafts only.
<mvt:item name="scotsblogger" param="treelist" /> (loads all cats and published articles)
<mvt:item name="scotsblogger" param="treelist some_cat_code" /> (starts tree at some_cat_code)
<mvt:item name="scotsblogger" param="treelist :top: all" /> (loads all cats and all articles, published and draft)
Load a category information from it's slug into g.scotsblogger_catslug and g.scotsblogger_category_code
<mvt:item name="scotsblogger" param="cat some-post-slug" />
Organizers - basically a custom built category system
Load the contents of an organizer by it's code:
<mvt:item name="scotsblogger" param="organizer_load [code]" />
Contact support for more information on organizers (we simply haven't written full docs for organizers yet.)
Miscellaneous
Load all posts associated with the current product, page, or category code.
<mvt:item name="scotsblogger" param="product" /> (l.settings:scotsblogger:product:posts)
<mvt:item name="scotsblogger" param="page" /> (l.settings:scotsblogger:page:posts)
<mvt:item name="scotsblogger" param="category" /> (l.settings:scotsblogger:category:posts)
<mvt:item name="scotsblogger" param="category cat_code"> - loads posts in category "cat_code"