17488 Posts in 4473 Topics by 1978 members
| Go to End | ||
| Author | Topic: | 3009 Views |
-
Re: including php in pages

26 June 2008 at 4:27am Last edited: 26 June 2008 4:28am
It still doesn't make any sense.
Whatever I try I get :
XML Parsing Error: not well-formed
Location: http://yoog.co.uk/new-playlistpage/
Line Number 101, Column 4:Or something very similar.
-
Re: including php in pages

26 June 2008 at 4:41am
OK I have got what I needed now.
PlaylistPage.php:
<?php
/**
* Defines the Playlist page type
*/class PlayListPage extends Page {
static $db = array(
);
static $has_one = array(
);function getAList() { return "something returns but this is just a string for testing";}
function Content() { $content = $this->Content; $content = str_replace('[[aList]]', $this->getAList(), $content); return $content; }}
class PlayListPage_Controller extends Page_Controller {
}
?>Now I can put [[aList]] in the content box in the CMS and I get the test text comes back in the editor. This is what I needed. I have to think about my editors.
Thanks for your help guys.
-
Re: including php in pages

26 June 2008 at 1:53pm
XML Parsing Error: not well-formed
Location: http://yoog.co.uk/new-playlistpage/
Line Number 101, Column 4:Watch out for that. The default theme sends the html as pure xml which is picky. You can disable it (and avoid errors like this) http://doc.silverstripe.com/doku.php?id=contentnegotiator
-
Re: including php in pages

26 June 2008 at 7:27pm
It seems so simple once it's done. I suppose it's just getting used to a different way of doing things!
Thanks again.
| 3009 Views | ||
| Go to Top |


