Ajax .load sub pages
Permalink
Hi,
I have built a theme which I want to do the following :
Loads in a page, and then inserts the first child page into a div in that page using AJAX .load call
this is working when I build it in HTML, but when I try to do this with concrete5 the child page I ma loading in inherits the parents page type. It is very important that the child page uses the page type I have assigned to it in the dashboard.
Does anyone have any thoughts on how I might get this to work?
----------------- relevant code -------------------
//get child page
$thisPage = $c->getCollectionID();
$oPage = Page::getById($thisPage);
$thatPage = $oPage->getCollectionChildrenArray(1);
$thatPageID = $thatPage[0];
//echo($thisPage);
echo("index.php?cID=". $thatPageID);
?>
<script type="text/javascript">
$(document).ready(function() {
//load gallery
$('#gallery').load("index.php?cID=<?$thatPageID;?>");
-------------------------------------------
when i load thatPageID is uses the parents template instead of the custom one built for this content.
I have built a theme which I want to do the following :
Loads in a page, and then inserts the first child page into a div in that page using AJAX .load call
this is working when I build it in HTML, but when I try to do this with concrete5 the child page I ma loading in inherits the parents page type. It is very important that the child page uses the page type I have assigned to it in the dashboard.
Does anyone have any thoughts on how I might get this to work?
----------------- relevant code -------------------
//get child page
$thisPage = $c->getCollectionID();
$oPage = Page::getById($thisPage);
$thatPage = $oPage->getCollectionChildrenArray(1);
$thatPageID = $thatPage[0];
//echo($thisPage);
echo("index.php?cID=". $thatPageID);
?>
<script type="text/javascript">
$(document).ready(function() {
//load gallery
$('#gallery').load("index.php?cID=<?$thatPageID;?>");
-------------------------------------------
when i load thatPageID is uses the parents template instead of the custom one built for this content.