Override C5 block handling?
Permalink
I have an HTML layout with something like this:
So, I updated it to make it "c5" with this:
C5's auto nav makes this:
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
<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
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.
Now every change you do to you local copy of view.php will be applied globally.
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?
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?
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.
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.
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.