how to get $cobj from a php file inside the block's tools folder on page-list block
PermalinkI have a page-list block on a page with a custom template. In the template, I changed the page links in order to open dialog and show the page attributes of that particular page.
So, I have listingdetails.php inside the block's tools folder. Now, I don't know how to get that one particular page object?
I knew that it was not going to work, however I tried this;
echo $propertytype = $cobj->getAttribute('propertytype');
But it doesn't work. Should I need to include and helper or loader to that listingdetails.php file?
I think I need to send that information from the template to that php file inside the tools via ajax. But I need help for that. Can someone please help me out?
Thanks in advance.
Page-list custom template:
http://justpaste.it/bxb
If I am not wrong, we need to look at here;
<h3 class="ccm-page-list-title"> <?php $th = Loader::helper('concrete/urls'); $bt = $b->getBlockTypeObject(); ?> <a id="<?php echo $cobj->getCollectionID()?>" class="button eachlistinglink hastipsy" target="_blank" title="<?php echo t('All Details')?>" href="<?php echo $th->getBlockTypeToolsURL($bt)?>/listingdetails?cID=<?php echo $cobj->getCollectionID()?>"><?php echo $title;?></a> </h3>
but these are what I want to show in that dialog.
<?php defined('C5_EXECUTE') or die("Access Denied."); $cID = empty($_GET['cID']) ? 0 : $_GET['cID']; if (!empty($cID) && intval($cID) == $cID) { $cobj = Page::getByID($cID); echo $cobj->getAttribute('propertytype'); echo $cobj->getAttribute('pricerange'); echo $cobj->getAttribute('bedrooms'); echo $cobj->getAttribute('bathrooms'); } exit;
So, now I need to get the page which the link will go, to a variable with javascript. and use that variable in the php file inside the tools folder.
Please help.