1
votes

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.

2
I'm not 100% sure I grasp your question - you are not talking about nested areas, but just multiple ones per page, correct? What you show in your HTML is definitely possible, but what you say you want in your text is notPekka
Sorry Pekka, I have edited my example to (hopefully) be clearer.Chris

2 Answers

2
votes

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/

2
votes

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>