17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1197 Views |
-
How do I have "special" pages were the content is generated by a PHP script?

3 June 2008 at 2:39am
Hi,
Might sound a bit strange, but I'm wondering how I can have pages on a site that are kind of managed by the CMS as in they appear in the navigation etc, but the content of the page is generated by a custom PHP script.
For example I have a script that generates a telephone directory and displays it, how would this integrate into the CMS?
Cheers
-
Re: How do I have "special" pages were the content is generated by a PHP script?

3 June 2008 at 8:27pm
just create a page type MyPage.php then create one of these in the CMS. Then in the MyPage_Controller you can overload a method called Content to set the content from your PHP Script instead of the Content from the CMS or use a MyPage template to send custom content
-
Re: How do I have "special" pages were the content is generated by a PHP script?

3 June 2008 at 9:02pm
OK, sound sensible. How do I create a custom page type?
-
Re: How do I have "special" pages were the content is generated by a PHP script?

3 June 2008 at 9:14pm
Read the second tutorial so you have the understanding behind this but create a file named whatever for this example ill call it DirectoryPage.php. Create this in the mysite/code folder
<?php
class DirectoryPage extends Page {
static $db = array();
}
class DirectoryPage_Controller extends Page_Controller {function Content() {
// your php function
return $SomeText;
}}
Then visit http://www.yoursite.com/db/build?flush=1. Next in the CMS you need to create a new page of type - DirectoryPage and you should have a custom page. Read tthe tutorials for a bigger overview
-
Re: How do I have "special" pages were the content is generated by a PHP script?

3 June 2008 at 9:27pm
Ah, that's great. OK, i'll read the tutorial for more details. Cheers.
| 1197 Views | ||
|
Page:
1
|
Go to Top |


