including a page

Feed 3 posts, 3 voices

Avatar
1 posts

Hi all,

I’ve ran into a embracing problem, I can’t for the life of me figure out the right syntax to include the content of 1 new page (child of ‘homepage’) into another page/snippet.

I’ve tried stuff like <?php echo $this->content(); ?> or <?php include '404.php' ?> to test. Both things kinda work, but i only want to include an “about us” page in the header not all pages on the site, however something like <?php echo $this->content('/About_us'); ?> ain’t the solution.

Any help would be greatly appreciated! Thanks in advance.

 
Avatar
11 posts

Hi Stephan

try this:

<?php echo $this->find('about_us')->content(); ?>

You need to use the value of the slug for $this->find().

 
Avatar
1 posts

Sorry for the late reply, but this worked perfectly! So thanks again, this way i can make small hidden pages “nontech” people can edit and include them on places on the site (this time the header subtitle).

 
Avatar
4 posts

Hello,

If I want to include a page [template] to which I’ll give a lot of long parameters (let’s say a picture URL, some date, a description, etc.), what syntax should I use?