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

inetis
inetis

To practice october, I try to reproduce this simple one page website: http://pepinierecreative.ch

I have a page with blocks. Into this blocks, I can have snippet like Googlemap, youtube etc I created a parent page with subpages in the Page plugin. http://take.ms/tW0gB A user can add/order easely blocks

How can I render the content of subpages in my partial ? https://gist.github.com/pvullioud/a8a6212f93da75a9d1d4

Thanks for your help

FelixINX
FelixINX

Bonjour,

J'ai vu que votre site est en français, alors j'ose imaginer que vous parlez le français.

Avez-vous essayé le tag {% content '/content/static-pages/nomdufichier.htm' %}? Je suis pas sur du répertoire, mais c'est quelque chose du genre. Soyez sûr que vos pages sont avec le plugin Rainlab.Pages.


Hi,

Have you tried the tag {% content '/content/static-pages/nameofthefile.htm' %}. Be sure that your page/sub-page are with the Rainlab.Pages plugin.

inetis
inetis

Bonjour, Merci pour ton aide. J'ai essayé cette methode. le contenu est affiché mais les composants ne sont pas transformés. Les pages ont bien été créée avec Rainlab.Pages

// in english Thanks, I tried this but the render of component like :

are not done. Sub pages have been done with Rainlab.Pages

Merci / Thanks

alxy
alxy

Hi, the function you are probably looking for is https://github.com/rainlab/pages-plugin/blob/master/classes/Page.php#L449-L462. I think, this function will replace the snippets with the actual markup. However, this is not they way the plugin should be used.

If you want to build complex SPAs, you can have a look at this plugin: https://github.com/responsiv/angular-plugin . But this is definetly not sth you want to hand to your clients ;)

inetis
inetis

Hi Alxy, Thanks for the function. I'll try it. If you look at the example http://pepinierecreative.ch it's not an app but a single page with different blocks. I would like to manage this blocks with Rainlab.Pages

PS: I love angular too :)

lp5
lp5

Bonjour Inetis,

Je suis confronté au même problème. As-tu réussi à insérer des sous-pages dans un layout de Page ?

Pour l'instant, la seule que j'arrive à faire est de récupérer la liste des sous-pages et leur titre, mais le contenu n'est pas traité.



function onEnd()
{
    $router = new Router(Theme::getActiveTheme());
    $this->pageObject = $router->findByUrl($this->page->url);

    $childs = $this->pageObject->getChildren();
    $pageChilds = [];
    foreach ($childs as $child)
    {
        $pageChilds[] = array(
            "title" => $child->title,
            "url" => $child->url,
            "content" => $child->getProcessedMarkup()
        );
    }

    $this['childs'] = $pageChilds;
}


Merci

Last updated

inetis
inetis

Voici une solution avec un plugin/ solution with a plugin https://octobercms.com/plugin/jwilson8767-subpages

ou une autre solution avec du code / solution with some code

use RainLab\Pages\Classes\Page;

function onStart()
{
    $file = 'accueil-1.htm';
    $page = Page::find($file);
    $this['home1Title'] = $page->title;    
    $this['home1'] = $page->getProcessedMarkup();  
}
<div class="container">
            <h2>{{ home1Title }}</h2>
            {{ home1 |raw }}
</div>

Last updated

1-7 of 7

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