how to insert page content from one page into another
4 posts by 3 authors in: Forums > CMS Builder
Last Post: March 23, 2011 (RSS)
By csdesign - March 21, 2011
Every page on the site has a sidebar. I have created a multi record sidebar and it's working on the testpage.
This is the testpage:
http://www.nwsc5872139.myutilitydomain.com/boxList.php
I would like to be able to pull that page into the sidebar of all other pages.
I've added this to both the boxList page and the news.php page - and it pulls the info if I repeat all the fields, but I was hoping to just "get" the page (boxList.php) instead.
// load records
list($boxRecords, $boxMetaData) = getRecords(array(
'tableName' => 'box',
'limit' => '3',
'orderBy' => 'RAND()',
));
I know this is the part I'm messing up: (in the news.php page - sidebar)
<?php foreach ($boxRecords as $record): ?>
<?php echo $record['list'] ?>
<?php endforeach ?>
<?php if (!$boxRecords): ?>
No records were found!<br/><br/>
<?php endif ?>
both boxList.php & new.php are attached. Thanks so much for your help!!
Re: [csdesign] how to insert page content from one page into another
By Toledoh - March 21, 2011
Tim (toledoh.com.au)
Re: [csdesign] how to insert page content from one page into another
By robin - March 22, 2011
I agree with Toledoh. You should just be able to use
<?php include "boxList.php"; ?>
instead of repeating the load records code for boxRecords in news.php.
Hope it works out for you,
Robin
Programmer
interactivetools.com
Re: [robin] how to insert page content from one page into another
By csdesign - March 23, 2011