Customizing block to add a container around it
Permalink
I'm new to Concrete5, and trying to create new theme
Basically I want to add a DIV around all the blocks, in the content area.
If I add this code, this is adding the DIV only for the first page, this particular code is not working for other pages
Can anyone please correct me, if I'm doing anything wrong.
Basically I want to add a DIV around all the blocks, in the content area.
$start = '<div class="block_cont">'; $end = '</div>'; $d = new Area('Main'); $d->setBlockWrapperStart($start); $d->setBlockWrapperEnd($end); $d->display($c);
If I add this code, this is adding the DIV only for the first page, this particular code is not working for other pages
Can anyone please correct me, if I'm doing anything wrong.
When you say it's only adding it to the first page, do you mean that your home page is getting the proper wrapper but other pages in your site are not? If that's the case, it's probably because you have a different template file for your home page than other pages. Themes usually have more than one "page type" (layout templates), and you'll need to make this change to all of them. I'm not sure what they might be called in your particular theme, but in general these different "page type" templates are called "default.php", "left_sidebar.php", "right_sidebar.php", "full.php", "view.php", etc. -- but again this may be different for your theme. Basically every file ending in ".php" in your theme directory.
And this is totally off-topic, but if you're a designer, you might find this free addon useful for creating blocks with very custom styles and html tags around them:
http://concrete5.org/marketplace/addons/designer-content...
And this is totally off-topic, but if you're a designer, you might find this free addon useful for creating blocks with very custom styles and html tags around them:
http://concrete5.org/marketplace/addons/designer-content...
Thx beebs and Jordanlev
Actually my requirement is, I want a DIV around each and every block in all the pages.
Currently I have main.php, full.php and view.php in my theme.
I have added the wrapper code in both of main.php and full.php
So as Jordan said, I'm getting the correct code only in my home page, for all other pages, I'm not getting this.
Do we need to have any other PHP files apart from this.
I tried adding the leftsidebar and rightsidebar php files, but I want only within Inner Container (ie) Content area.
Actually my requirement is, I want a DIV around each and every block in all the pages.
Currently I have main.php, full.php and view.php in my theme.
I have added the wrapper code in both of main.php and full.php
So as Jordan said, I'm getting the correct code only in my home page, for all other pages, I'm not getting this.
Do we need to have any other PHP files apart from this.
I tried adding the leftsidebar and rightsidebar php files, but I want only within Inner Container (ie) Content area.
There should be a default.php file -- it's a requirement that every theme has one (if you don't, that's very surprising because I thought the system wouldn't allow you to even install a theme without one). That's probably what all of your other pages are using.
sorry, the main I'm taking about is default.php only, I have added the stuff in that file only
Then try adding the stuff in all the other files too.
Also, see if clearing the C5 cache helps (Dashboard -> Sitewide Settings, click "Clear Cache" button).
Also, see if clearing the C5 cache helps (Dashboard -> Sitewide Settings, click "Clear Cache" button).
As you noticed, the setBlockWrapperStart/End methods wrap every block in said area; not a single one around the entire group.