Get content of page in PHP
Permalink
I'm writing a little snippet for C5. I need to pull the content from a specific page and a specific content area into a variable and do a regex on it.
Can anyone provide an example to get me started? I'm looking at the API right now, but it's not easy.
Thanks!
Can anyone provide an example to get me started? I'm looking at the API right now, but it's not easy.
Thanks!
Thanks, but that's more than I need. I'm still new to the C5 MVC and I'm trying to get the content of a page and avoid doing a direct query to the database.
The pop up block doesn't give me anything I need right now.
The pop up block doesn't give me anything I need right now.
$a = new Area('Main'); $c = Page::getByID(56); $regexMatchThis = $a->display($c);
so do your match on $regexMatchThis..
That didn't work as expected. When display is invoked, output is dumped to the browser regardless of the variable assignment. Also, I have an area called 'Main' on the page already and it doesn't display anything when I do this.
I would think that the Page object should have a method I need without using an Area.
Is that not so?
I would think that the Page object should have a method I need without using an Area.
Is that not so?
$fh = Loader::helper('file');
$nh = Loader::helper('navigation');
$content = $fh->getContents($nh->getCollectionURL($c));
?
that's from remo's cache package but that gives you the entire page's html
that's all i got ;)
$nh = Loader::helper('navigation');
$content = $fh->getContents($nh->getCollectionURL($c));
?
that's from remo's cache package but that gives you the entire page's html
that's all i got ;)
Thank, Scott! I'll see what I can do with it.
http://www.concrete5.org/marketplace/addons/popup/...
Does a great job!