Reputation: 929
I'm using Concrete5 CMS for a client project of mine but have the problem that (ideally) I'd like to be able to nest HTML structures in such a way that the content editor will be able to edit the site without having to know or write any HTML. An example structure is...
<header class="page-header"><!-- Defined as a GlobalArea -->
<div class="site-meta"><!-- Defined as a Block Group (Stack?) -->
<p class="contact-info"><!-- Defined as a Block -->
<!-- User editable content -->
</p>
....other content...
</div>
<div class="branding"><!-- Defined as a Block group -->
<div class="logo"><!-- Defined as a Block -->
<!-- User editable content -->
</div>
<hgroup><!-- Custom wrapper of sub-blocks -->
<h1 class="brandname"><!-- Defined as a Block -->
<!-- User editable content -->
</h1>
<h2 class="tagline"><!-- Defined as a Block -->
<!-- User editable content -->
</h2>
</hgroup>
</div>
<p class="description"><!-- Defined as a Block -->
<!-- User editable content -->
</p>
</header>
As you can see I need separate user editable content "Blocks" grouped in to larger 'meta' blocks within a defined content "Area" (or grouped areas). Although it's my understanding that Concrete5 is not capable of functioning in this way -- i.e. Areas cannot contain other Areas and Blocks cannot contain other Blocks.
In which case I was wondering how it would be possible to manually load a specific content Block from the database using just the raw php code. This way I hope to be able to pre-define the content blocks for a given area and hopefully forcibly insert a block within a specific structure of HTML.
Thanks for any and all help people can offer me.
Upvotes: 1
Views: 777
Reputation: 301
Is there really a business need for the upper level area groups with nested areas? This is typically handled by the template. For example:
<header class="page-header">
<div class="site-meta">
<p class="contact-info">
<?php
$a = new Area('Contact Info');
$a->display($c);
?>
</p>
<!-- ....other content... -->
</div>
<div class="branding">
<div class="logo">
<?php
$a = new Area('Logo');
$a->display($c);
?>
</div>
<hgroup>
<h1 class="brandname">
<?php
$a = new Area('Brand Name');
$a->display($c);
?>
</h1>
<h2 class="tagline">
<?php
$a = new Area('Tag Line');
$a->display($c);
?>
</h2>
</hgroup>
</div>
<p class="description">
<?php
$a = new Area('Description');
$a->display($c);
?>
</p>
</header>
Upvotes: 2
Reputation: 106
Take a look at the free Designer Content add-on... you can create custom blocks that have markup embedded in it. This will get you most of the way to the markup you are looking to create. If necessary, you can use the block code it creates and customize your custom block more precisely.
http://www.concrete5.org/marketplace/addons/designer-content/
Upvotes: 2