Override C5 block handling?

Permalink
I have an HTML layout with something like this:

<div id="top_nav">
  <ul class="top_class horizontal">
    <li><a href="blah blah">Link Name</a></li>
    <li><a href="blah blah">Link Name</a></li>
    <li><a href="blah blah">Link Name</a></li>
  </ul>
</div>


So, I updated it to make it "c5" with this:
<div id="top_nav"><?php 
  $top = new Area('Header Nav');
  $top->display($c);
?></div>


C5's auto nav makes this:
<div id="top_nav">
  <div id="blockStyles1" class="top_class horizontal ccm-block-styles">
    <ul class="nav">
      <li class="nav-selected nav-path-selected"><a class="nav-selected nav-path-selected" href="/">Home</a></li>
      <li><a href="/about/">About</a></li>
      <li><a href="/search/">Search</a></li>
    </ul>
  </div>
</div>


The extra DIV is making things act funny with the layout.

Aside from creating my own elements/blocks for every single block that I need - is there a way to override the defaults with a special file or something in the root (not the concrete folder) ?

TIA,
Jon

jtrelfa
 
jtrelfa replied on at Permalink Reply
jtrelfa
So it looks like the block_header_view.php and block_footer_view.php files in the concrete/elements folder was adding the DIV that I didn't want.

So, I created copies of those files and put them into the root elements/ folder; assuming that it would override the default behavior.

It did not override the behavior :( I'm still getting the extra DIV tag.
matogertel replied on at Permalink Reply
matogertel
Using the auto_nav as an example, there's a "blocks" folder in your root folder. Create a folder inside it called "auto_nav". Now copy the file view.php from YOUR_ROOT/concrete/blocks/auto_nav/view.php to YOUR_ROOT/blocks/auto_nav/view.php
Now every change you do to you local copy of view.php will be applied globally.
jtrelfa replied on at Permalink Reply
jtrelfa
I actually just created a /blocks/auto_nav/templates/my_special_view.php and selected that in edit mode - which (almost) worked.

I'm still getting the annoying extra DIV tag. The tag is being echoed from the /concrete/elements/block_header_view.php file. When I create my own /elements/block_header_view.php, C5 ignores it - and I would expect that my custom element would override it. Maybe it's a bug?
jaredquinn replied on at Permalink Reply
jaredquinn
Taking a look at concrete/libraries/block_view.php it seems to be missing the logic that appears regularly throughout the codebase that checks the root level directories before the concrete5 ones.

I'm not sure if this is an oversight or by design, I've just fixed it in my dev copy here and will see how it goes.