Table of contents

Permalink
Is there a standard way to build a table of contents of the blocks shown within an area?

 
cannonf700 replied on at Permalink Reply
cannonf700
Not exactly sure what you mean...

maybe take a look at:
http://www.concrete5.org/marketplace/addons/example-faq/...
jordanlev replied on at Permalink Reply
jordanlev
No, there is no standard way to do this. It's not too difficult to get a list of all the blocks in an area with code like this:
<?php
$blocks = Page::getCurrentPage()->getBlocks('Main'); //<--replace 'Main' with the name of the area you want
foreach ($blocks as $b) {
  //do something... but what?
}
?>


The real problem is: what do you want the table of contents to show exactly? Blocks don't have names, so how would you decide what exactly to list in the table of contents?
rubylibre replied on at Permalink Reply
You are right. But thanks, I can think of something from here..