COF - Content on First (page)
Show a document field, a chunk or a Tv only on first paginate page
Content on First (page)
Show a document field, a chunk or a Tv only on first page of pagination
This snippet for Evolution CMS is designed to work with the pagination of the DocLister snippet, displaying a specific field, chunk, or TV only on the first page
How it works
"COF" checks if the pagination parameter is present in the page URL (e.g., ?page=2). If the parameter is present, the field/chunk/TV will be hidden.
Of course, the main DocLister call should not be placed within the field that will be hidden by the snippet.
This snippet can be used in various scenarios, such as:
News/Articles List: Displaying a long introductory text before the DocLister news list, but only on the first page.
Featured News/Products: Showing a box with top news or highlighted products exclusively on the first page.
Snippet Parameters
- &paginate : the pagination parameter in the URL (e.g. page or start)
- &field : documentObject Field to return
- &chunk : chunk to return
- &Tv : Template Variable (TV) to return
- &RenderTv : Defines whether to render the TV
- &Message : Optional message or chunk for pages with pagination parameter
Snippet Usage
Show a document field only on first page
[[Cof? &paginate=`page` &field=`content` &Message=`@TPL:GoBack`]]
Show a chunk only on first page
[[Cof? &paginate=`page` &chunk=`TopNews` &Message=`@TPL:GoBack`]]
Show a Template Vartiable only on first page
[[Cof? &paginate=`page` &Tv=`MyTv`]]
Show and Render a Template Vartiable only on first page
[[Cof? &paginate=`page` &Tv=`MyTv` &RenderTv=`1`]]