Custom content block - How to create and position?

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
marco

Custom content block - How to create and position?

Post 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?
joransrb
Posts: 53
Joined: Mon 10. Jan 2005, 21:03

Post 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...
User avatar
Oliver Georgi
Site Admin
Posts: 9888
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post 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
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
joransrb
Posts: 53
Joined: Mon 10. Jan 2005, 21:03

Post by joransrb »

tested some houres now and found out that the

Code: Select all

{CONTENT} / {LEFT} / {RIGHT} / {FOOTER} / {HEADER}
works great :) Nice work Oliver :)
User avatar
Oliver Georgi
Site Admin
Posts: 9888
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post 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
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
joransrb
Posts: 53
Joined: Mon 10. Jan 2005, 21:03

Post by joransrb »

nice...

will try that soon...

need some sleep now... :|
cyrano
Posts: 1598
Joined: Sat 31. Jan 2004, 18:33
Location: Stuttgart
Contact:

Post 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.
Gruß/ regards cyrano
--------------------------------------------------------
templates -> http://www.128.weitzelmedia.de
planepix -> http://www.planepix.de
XING -> https://www.xing.com/profile/Thomas_Weitzel3
User avatar
Oliver Georgi
Site Admin
Posts: 9888
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post 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
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
cyrano
Posts: 1598
Joined: Sat 31. Jan 2004, 18:33
Location: Stuttgart
Contact:

Post 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.
Gruß/ regards cyrano
--------------------------------------------------------
templates -> http://www.128.weitzelmedia.de
planepix -> http://www.planepix.de
XING -> https://www.xing.com/profile/Thomas_Weitzel3
User avatar
Oliver Georgi
Site Admin
Posts: 9888
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post 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
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
cyrano
Posts: 1598
Joined: Sat 31. Jan 2004, 18:33
Location: Stuttgart
Contact:

Post 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.
Gruß/ regards cyrano
--------------------------------------------------------
templates -> http://www.128.weitzelmedia.de
planepix -> http://www.planepix.de
XING -> https://www.xing.com/profile/Thomas_Weitzel3
User avatar
Oliver Georgi
Site Admin
Posts: 9888
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post 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
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
cyrano
Posts: 1598
Joined: Sat 31. Jan 2004, 18:33
Location: Stuttgart
Contact:

Post by cyrano »

thank you oliver i'll try this.

Thank you for fast reply.

aaaahhhhh now i see something :-) fine fine :-) :D
Gruß/ regards cyrano
--------------------------------------------------------
templates -> http://www.128.weitzelmedia.de
planepix -> http://www.planepix.de
XING -> https://www.xing.com/profile/Thomas_Weitzel3
shocktone
Posts: 74
Joined: Thu 19. Aug 2004, 17:33
Location: Duesseldorf. Germany

Post 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.
shocktone
Posts: 74
Joined: Thu 19. Aug 2004, 17:33
Location: Duesseldorf. Germany

Post by shocktone »

Found the solution myself. Thanks anyway.
Post Reply