Page 1 of 4

Custom content block - How to create and position?

Posted: Tue 25. Jan 2005, 02:52
by marco
One question:

What do we need to do to create a custom content block and how do we position it in a layout?

Posted: Tue 25. Jan 2005, 05:54
by joransrb
ive tryed using

Code: Select all

{LEFT} / {RIGHT}
and in some strange way it works, sometimes, maybe...
havent figguerd it out yet, might not be finished developed or something...

try and see...

Posted: Tue 25. Jan 2005, 07:51
by Oliver Georgi
Check these screenshots:
http://www.phpwcms.de/forum/viewtopic.php?p=31241#31241

And using {LEFT}, {RIGHT}, {CUSTOMNAME} is the way it works.

This is NOT available in article listings as used when more than 1 article in category is displayed. I'm thinking about a better solution for this.

Oliver

Posted: Tue 25. Jan 2005, 07:54
by joransrb
tested some houres now and found out that the

Code: Select all

{CONTENT} / {LEFT} / {RIGHT} / {FOOTER} / {HEADER}
works great :) Nice work Oliver :)

Posted: Tue 25. Jan 2005, 08:17
by Oliver Georgi
yes: these 5 are the default blocks. But you can set custom names under pagelayout (see screenshot). If done you will get additional fields in the templates for which such pagelayout is choosen. There you can fill in wrapping content for the custom block.

See this:
http://www.iba-stadtumbau.de/cms/index.php?iba_staedte
each town has such {LEFT} block. But it's a mix from block and hidden structure articles included by empty template and {URL:...}

Oliver

Posted: Tue 25. Jan 2005, 09:17
by joransrb
nice...

will try that soon...

need some sleep now... :|

Posted: Wed 9. Feb 2005, 12:31
by cyrano
hi to all, hi oliver,

i tried to use the content anywhere function.

I have a few minor problems i think.

i made a new layout template and added 3 content blocks more
{CONTENT_LEFT}, {CONTENT_MIDDLE} and {CONTENT_RIGHT}.

Then i added 3 new classes in frontend.css

content_left {
float: left;
padding-top: 5px;
padding-right-value: 5px;
padding-bottom: 5px;
padding-left-value: 5px;
padding-left-ltr-source: physical;
padding-left-rtl-source: physical;
padding-right-ltr-source: physical;
padding-right-rtl-source: physical;
width: 212px;
}

also for middle and right (i get inspired by gnolens website) and want to use this classes for testing first.

Then i set the structure levle with this new layout.

I go to the templates and have 3 more input fields, named as my defined block are.

OK, i put there in:
for {CONTENT_LEFT}:
<div class="content_left">{CONTENT_LEFT}</div>

also the same for middle nad right.

Then i go to the article set an image and place it to CONTENT_LEFT and some text in CONTENT_MIDDLE.

I save this and see nothing.

What i'am doing wrong?

Thank you for any hints.

Posted: Wed 9. Feb 2005, 12:53
by Oliver Georgi
1. Works only when there is content for that block (seems that is in your case).
2. You need a {CUSTOM_BLOCK} in main layout too.

Oliver

Posted: Wed 9. Feb 2005, 13:00
by cyrano
hi oliver,

thank you, i have content defined, but need the custom block.

di i add this in layout by type this one like {CUSTOM_BLOCK} and define a class too?

I think where i have to define the whole width and height wherein the other 3 content blocks will be displayed, right?

i had also my standard blocks in my template like left, right, main.

Posted: Wed 9. Feb 2005, 14:41
by Oliver Georgi
you have to put the replacement code for your custom block in your main layout sections like the {CONTENT}

If the custom block wrap should be visible always you have to place it in main content template sections otherwise it has to be located in custom block template field.

Try and you will understand how it works.

Oliver

Posted: Wed 9. Feb 2005, 15:09
by cyrano
Hello Oliver,

thank you for reply - i decide to make screenshots, this works for me faster and better..

1. Layout settings:
Image

2. Template settings:
Image

3. article:
Image

the additional settings in frontend.css:

Code: Select all

custom_block {
	position: relative; 
	left: 0px; top: 0px;
	width:650px;
}

content_left { 
         float: left; 
         padding-top: 5px;
         padding-right-value: 5px;
         padding-bottom: 5px; 
         padding-left-value: 5px;
         padding-left-ltr-source: physical;
         padding-left-rtl-source: physical;
         padding-right-ltr-source: physical;
         padding-right-rtl-source: physical;
         width: 212px;
}

content_middle { 
         float: left; 
         padding-top: 5px;
         padding-right-value: 5px;
         padding-bottom: 5px; 
         padding-left-value: 5px;
         padding-left-ltr-source: physical;
         padding-left-rtl-source: physical;
         padding-right-ltr-source: physical;
         padding-right-rtl-source: physical;
         width: 212px;
}

content_right { 
         float: left; 
         padding-top: 5px;
         padding-right-value: 5px;
         padding-bottom: 5px; 
         padding-left-value: 5px;
         padding-left-ltr-source: physical;
         padding-left-rtl-source: physical;
         padding-right-ltr-source: physical;
         padding-right-rtl-source: physical;
         width: 212px;
}
Where do i have a misunderstanding of using this function?

Would be nice if you can fix my thinking :-)

Thank you.

Posted: Wed 9. Feb 2005, 15:22
by Oliver Georgi
In the case of just having the blocks CONTENT_MIDDLE and CONTENT_RIGHT you will not see any of your custom blocks. If should be visible always you have to place the wrapping div in the main field (in your case).

And try this ;-) see the point in front of every class name.

Code: Select all

.custom_block { 
   position: relative; 
   left: 0px; top: 0px; 
   width:650px; 
} 

.content_left { 
         float: left; 
         padding-top: 5px; 
         padding-right-value: 5px; 
         padding-bottom: 5px; 
         padding-left-value: 5px; 
         padding-left-ltr-source: physical; 
         padding-left-rtl-source: physical; 
         padding-right-ltr-source: physical; 
         padding-right-rtl-source: physical; 
         width: 212px; 
} 

.content_middle { 
         float: left; 
         padding-top: 5px; 
         padding-right-value: 5px; 
         padding-bottom: 5px; 
         padding-left-value: 5px; 
         padding-left-ltr-source: physical; 
         padding-left-rtl-source: physical; 
         padding-right-ltr-source: physical; 
         padding-right-rtl-source: physical; 
         width: 212px; 
} 

.content_right { 
         float: left; 
         padding-top: 5px; 
         padding-right-value: 5px; 
         padding-bottom: 5px; 
         padding-left-value: 5px; 
         padding-left-ltr-source: physical; 
         padding-left-rtl-source: physical; 
         padding-right-ltr-source: physical; 
         padding-right-rtl-source: physical; 
         width: 212px; 
}
Oliver

Posted: Wed 9. Feb 2005, 15:24
by cyrano
thank you oliver i'll try this.

Thank you for fast reply.

aaaahhhhh now i see something :-) fine fine :-) :D

Posted: Thu 3. Mar 2005, 15:28
by shocktone
I have got a big problem with this one.

1) I created my own block in the layout page
2) i can see the new block in the "Vorlagen" section
3) But when I create a new article I can just choose content, left, right, header, footer. i cannot choose the new custom block.

What am I doing wrong ?? 1.21 dev version

Greetings Jens.

Posted: Thu 3. Mar 2005, 15:39
by shocktone
Found the solution myself. Thanks anyway.