From Pages to Listpages

Background

The official doc says that the module Pages has been deprecated. For obvious reasons: the control over the output with module Pages was rather limited while ListPages is really powerful. However, it was fully satisfactory for the absolute beginner, who will find here some hints on how to ensure the transition from Pages to ListPages, as regards details and preview to be displayed.

Details

with Pages

The details shown were: title with link, last editor, number of revisions, last update, even if the sorting order was dateCreatedAsc.

[[module Pages  details="true" limit="2" order="dateCreatedAsc"]]

… gives
Manage-Site Helmut_pdorfHelmut_pdorf rev. 5 15 Sep 2012 06:51
Site Members Steven HeynderickxSteven Heynderickx rev. 17 02 May 2013 05:35

with ListPages simple

The table must be built either with simple || or with [[table]] but a little bit more complicated.

[[module ListPages category="*" limit="2" order="created_at" separate="no" ]]
|| %%title_linked%% || %%updated_by%% || %%revisions%% || %%updated_at%% ||
[[/module]]

… gives
Manage-Site Helmut_pdorf 5 15 Sep 2012 06:51
Site Members Steven Heynderickx 17 02 May 2013 05:35

with ListPages with additional formatting

Note that I used a CSS trick to remove the avatar and the table borders …

[[module ListPages category="*" limit="2" order="created_at" separate="no" ]]
|| %%title_linked%% || %%updated_by_linked%%|| (rev. %%revisions%%) || %%updated_at|%e %b %Y - %H:%M|agohover%% ||
[[/module]]

… gives
Manage-Site Helmut_pdorfHelmut_pdorf (rev. 5) 15 Sep 2012 06:51
Site Members Steven HeynderickxSteven Heynderickx (rev. 17) 02 May 2013 05:35

Preview

with Pages

The preview was just raw text, carriage returns were just deleted.

[[module Pages  preview="true" limit="2" order="dateCreatedAsc"]]

… gives

with ListPages

Well, it is not that easy to choose between %%preview%%, %%preview(n)%%, %%summary%%,
%%first_paragraph%% … not to forget %%content{1}%%.

[[module ListPages category="*" limit="2" order="created_at" separate="no" ]]
%%title_linked%%
[[span style="color:#666666; font-size:90%;"]]%%preview(100)%%[[/span]]
[[/module]]

… gives

Manage-Site

Site Members
Members: Members by Joining date: ( done with [[module Members order= joined showSince= yes ]] )...

Tip
If you want to control what will be previewed, either keep your first paragraph very short and use %%first_paragraph%% or add an additional section, prepended by "====" and use %%content{1}%% in the body of your _template and %%content{2}%% as your preview field.

Backlinks

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.