CUSTOM_BLOCKS

Basics

CUSTOM_BLOCKS are one of the most versatile neat LITTLE things within the system of phpwcms. Used in an appropriate manner they'll give you almost indefinite possibilities to set up and style your content.
For example you can throw in some Content Part HTML with two columns if needed and target these two columns with other contentparts. This is really cool and we are going to provide you with the basics and some nice code snippets to pick up ….
FIXME

Set 'em up!

To have a working set of CUSTOM_BLOCKS at first you should sit down, lean back and do some little sketches how they would fit best and do some consideration about their naming convention.
Well, you could do so, but you can jump into it right now:

They are in "Page Layout"!

Go ahead and open (well, we are working with the back end ;-) ) admin » page layout » your special_page_layout (or the default if you have never done that before). Here you will find a field labeled “custom”. Fill in some blocks:

ABOVE_CONTENT, COL1, COL2

Save your page layout!
FIXME

They are in "templates" too!

Now you'll like to navigate to admin » templates to select a template. If you have done that never before there will be a default template still to be opened. Here you can assign your previously changed page layout.
After saving it you will find your CUSTOM_BLOCKS below.
FIXME

Populate 'em!

Look for that field labeled “ABOVE_CONTENT” and fill in something like

<div class="splash">
<div class="splash-inner">
<div class="splash-innerpadding clearfix">{ABOVE_CONTENT}</div>
</div>
</div>

and save again. Nothing has happened, nothing did hurt? Fine!
FIXME

Treat your page layout

Assuming that you are setting up your page by rendering it custom (from template's main block) you now can place your CUSTOM_BLOCK right above your content like so:

<!--other stuff before-->
{ABOVE_CONTENT}
{CONTENT}
<!--other stuff after-->

FIXME <note important>Every time you are adding or deleting a CUSTOM_BLOCK you should edit and save all of your page templates thusly enabling the system to reflect the changes. Otherwise you will not be able to choose the output position “CUSTOM_BLOCK” when editing articles!</note>.

Targeting your new blocks

Peeew! That's done! LOL
Come on - we are quite there!

Edit your article

When opening your article and editing / adding a new Content Part you will find your newly created blocks by pulling down that pull down menu labeled “display”. Here you will define the output location. Since your main article (the headline, sub headline and teaser text) is always displayed within {CONTENT} you are able to place a Content Part right above of it by choosing “ABOVE_CONTENT” as it's output location. This is pretty cute / neat / tricky whatever ;-)
And because of the order of your three new blocks you even can nest them so that COL1 and COL2 can reside within ABOVE_CONTENT (in case you'd like to do so ;-)
But this is a completely different story
FIXME

Many ways to Rome

FIXME

english/phpwcms-system/admin/template/custom_blocks.txt · Last modified: 2018/06/03 18:09 (external edit)
www.planmatrix.de www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0