Repeat multiple blocks in a specific layout?
Permalink
I am creating a custom template for a page using Concrete5. I have three blocks, wrapped in a div class, that I want to repeat throughout one page. For example:
And the CSS for would be something like this:
What I want is to be able to repeat the block-wrapper with the 3 editable blocks inside. For example, the generated page would look like:
...and so forth. I hope I am being clear enough. Is this possible? What are my options? Ideally, I'd have as much freedom to style the blocks and block-wrapper as possible.
You can also answer my question at StackOverflow:http://stackoverflow.com/questions/23789008/concrete5-possible-to-r...
<div class="block-wrapper"> <div class="title"><?php $a = new Area('Title'); $a->display($c);?></div> <div class="description"><?php $a = new Area('Description'); $a->display($c);?></div> <div class="autonav"><?php $a = new Area('Autonav'); $a->display($c);?></div> </div>
And the CSS for would be something like this:
.block-wrapper { padding: 20px 5px 20px 5px; border: 1px solid #e8e8e8; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); } .title { float: left; } .description { float: right; }
What I want is to be able to repeat the block-wrapper with the 3 editable blocks inside. For example, the generated page would look like:
<div class="block-wrapper"> <div class="title">Steve</div> <div class="description">Engineer</div> <div class="autonav">Link A | Link B | Link C</div> </div> <div class="block-wrapper"> <div class="title">Betty</div> <div class="description">Designer</div> <div class="autonav">Link D | Link E | Link F</div> </div>
...and so forth. I hope I am being clear enough. Is this possible? What are my options? Ideally, I'd have as much freedom to style the blocks and block-wrapper as possible.
You can also answer my question at StackOverflow:http://stackoverflow.com/questions/23789008/concrete5-possible-to-r...
Hi John,
Thanks for your help, I will take a look into your apps.
I wanted to use blocks because I don't want to call any data or have any data repeated. I just want a 3-block layout that users can add whatever block they want and edit. Otherwise I just would have used stacks as you recommended. It seems quite impossible, though.
The Designer Content app (http://www.concrete5.org/marketplace/addons/designer-content/) actually seems the closest to what I am trying to do...but looking at it right now, I'm not sure it's as powerful as I need to be. I will post back if I find a solution.
Thanks again.
Thanks for your help, I will take a look into your apps.
I wanted to use blocks because I don't want to call any data or have any data repeated. I just want a 3-block layout that users can add whatever block they want and edit. Otherwise I just would have used stacks as you recommended. It seems quite impossible, though.
The Designer Content app (http://www.concrete5.org/marketplace/addons/designer-content/) actually seems the closest to what I am trying to do...but looking at it right now, I'm not sure it's as powerful as I need to be. I will post back if I find a solution.
Thanks again.
If you have relatively un-skilled editors adding blocks, then creating a custom block that contains fields for entering your required data is the best solution.
It not unusual to use Designer Content to get most of the way there and then edit the resulting php and css for the final adjustments.
It not unusual to use Designer Content to get most of the way there and then edit the resulting php and css for the final adjustments.
1. Uber List and Magic Data to repeat the stack by listing whatever is being repeated and fill in the variable data.
2. Universal Content Puller and Magic Data to explicitly show the stack and set the variables for each use and fill in the variable data.
Both can use any content block template as an overall wrapper, so its easy to set up overall formatting as well as individual block formatting.
I am not sure your original thoughts on using areas for this will work because you will end up with a variable number of areas that you will not be able to manage through the page/block edit interface.