how can I use the same source on two different pages?

3 posts by 3 authors in: Forums > CMS Builder
Last Post: September 14, 2009   (RSS)

Re: [craighodges] how can I use the same source on two different pages?

By InHouse - September 13, 2009 - edited: September 15, 2009

Hi Craig,

I may not be fully grasping the situation but this sounds easy enough. What I often do with chunks that need to appear in several places is to create a display file (child page) with both the call to select the records and the display code all together. Be sure to remove all the <HTML>, <BODY> and <HEAD> tags since these will be provided by the parent files.

Then, wherever you want the display to happen on a parent page use a PHP include:

<?php include("path/filename.php"); ?>

Since the require path is relative from the root, it does not really matter what pages the child is pulled into.

Of course... I may have misunderstood your situation. If so, I do apologize.

Cheers,
J.

Re: [craighodges] how can I use the same source on two different pages?

By Donna - September 14, 2009

Hi Craig!

Definitely do-able -- the URL in the back end part simply automates a few things for you... but you can definitely do those parts manually.

For example, instead of using the _link option (ie, <a href="<?php echo $record['_link'] ?>">)

...you could instead do this:

<a href="newfilename.php?<?php echo $record['num'] ?>">

Since CMS Builder uses the number on the end of the record to figure out which record to pull in, you just need to make sure the record number is listed there.

Does that make sense? Let me know if you need more help with that. :)
Donna

--
support@interactivetools.com