Link to Block from within the Dashboard
Permalink
I wish to generate a link to a block from within the dashboard.
I am developing a block and a dashboard to manage it. From within the dashboard page I can retrieve a Block ID (bID) for any and all instances of my block but how do I create a link to the page (using the block ID) where a particular block is being used.
What I want to do is list in the dashboard all instances of my block and link to the pages where they are used. I can do everything except generate the link.
I am developing a block and a dashboard to manage it. From within the dashboard page I can retrieve a Block ID (bID) for any and all instances of my block but how do I create a link to the page (using the block ID) where a particular block is being used.
What I want to do is list in the dashboard all instances of my block and link to the pages where they are used. I can do everything except generate the link.
you will need to use the cID
easiest way is to set up a join through a few tables, probably a bID->cID relation through collection versions, haven't traced it, but that is the general idea to map a cID to a bID
so assuming you found a cID you pass that into the navigation helper using Page::getByID($mysqlcID); then $nh->getLinkToCollection($thatPage);
Thank you both for the answers...
This was my solution...
This was my solution...
$block = Block::getByID($data[bID]); if(isset($block)){ $col = $block->getBlockCollectionObject(); $parentPage = Page::getByID($col->cID); $linkURL = View::url( $parentPage->getCollectionPath() ); }