This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

grigkar
grigkar

Hi. I have page with several subpages. All pages created in Rainlab Static Page plugin and each of them has variable: {variable name="thumb1" label="Thumbnail 1" tab="Image" type="mediafinder" mode="image"}{/variable}

I need on home page for each page list the images. Do you know how to do it?

Structure: Homepage Projects

  • Project name 1
  • Project name 2
  • ...
  • Project name N

Thanks

Last updated

mjauvin
mjauvin

Read this forum post:

https://octobercms.com/forum/post/list-of-static-pages-for-templating

And check the RainLab Pages PageList class

grigkar
grigkar

mjauvin said:

Read this forum post:

https://octobercms.com/forum/post/list-of-static-pages-for-templating

And check the RainLab Pages PageList class

Thanks for quick reply. As I know, this class I can use only for listing page titles and urls? Am I able to list variable of page? If yes, how?

mjauvin
mjauvin

Yes, just use the field name on the page object as below:

title = "Home"
url = "/"
layout = "staticLayout"
==
function onInit()
{
    $theme = \Cms\Classes\Theme::getActiveTheme();
    $this['pages'] = \RainLab\Pages\Classes\Page::listInTheme($theme, true);
}
==
{% for page in pages %}
    {{ page.mySyntaxField }}
{% endfor %}
grigkar
grigkar

Thank you! It works!

anthillhole56564
anthillhole56564

grigkar said:cookie clicker

mjauvin said:

Read this forum post:

https://octobercms.com/forum/post/list-of-static-pages-for-templating

And check the RainLab Pages PageList class

Thanks for quick reply. As I know, this class I can use only for listing page titles and urls? Am I able to list variable of page? If yes, how? Your can able to list variable of page

matthiasujunker62015
matthiasujunker62015

mjauvin said: https://bubbleshooterfun.de

Read this forum post:

https://octobercms.com/forum/post/list-of-static-pages-for-templating

And check the RainLab Pages PageList class

Thank you for sharing this article with us.

chinwoo98762655
chinwoo98762655

thank for your posst

Last updated

1-8 of 8

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.