da Blocks

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
User avatar
Jensensen
Posts: 2996
Joined: Tue 17. Oct 2006, 21:11
Location: auf der mlauer

da Blocks

Post by Jensensen »

x
Last edited by Jensensen on Fri 19. Sep 2008, 02:20, edited 2 times in total.
{so_much} | Knick-Knack. | GitHub
Umlaute im URL sind meistens immer Kacke.
User avatar
Heiko H.
Posts: 868
Joined: Thu 27. Oct 2005, 11:41
Location: Dresden
Contact:

Re: Nested Custom Content Blocks - really rocks!!! - Wow!!!

Post by Heiko H. »

Hi Jensensen,

really not the hottest news... 8)

http://forum.phpwcms.org/viewtopic.php?p=31241#31241
http://forum.phpwcms.org/viewtopic.php?p=32959#32959
...


This really is not meant badly.

Regards Heiko.
Not longer here - sorry...

Haubner-IT GbR Dresden
User avatar
update
Moderator
Posts: 6433
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Re: Nested Custom Content Blocks - really rocks!!! - Wow!!!

Post by update »

really not the hottest news... 8)
As far as I'm understanding it up to now this is something different. Before this we placed the tag {MYCOOLONEBLOCK} within the template...
But now we can place the {MYCOOLONEBLOCK} in a let's say CP html, place this anywhere (even in another custom block) and put content into it...
No need to fill the template with the replacement tags for custom blocks (you can do it still, anyway)
Am I getting the picture? If so - 8)
It's mostly all about maintaining two or three customer's sites Still supporter for the band Mykket Morton. Visit Mykket Morton on FB. Listen Mykket Morton and live videos on youtube.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
User avatar
marcus@localhorst
Posts: 815
Joined: Fri 28. May 2004, 11:31
Location: localhorst
Contact:

Re: Nested Custom Content Blocks - really rocks!!! - Wow!!!

Post by marcus@localhorst »

i think phpwcms has a lot of rarely documented features in vein of eastereggs ;-)
(apropos easteregg - impress your skype contacts when typeing (mooning) into the textchat ;-))
User avatar
Heiko H.
Posts: 868
Joined: Thu 27. Oct 2005, 11:41
Location: Dresden
Contact:

Re: Nested Custom Content Blocks - really rocks!!! - Wow!!!

Post by Heiko H. »

It seems as if claus/Jensensen were right. Sorry... :oops:

[OT]
marcus@localhorst wrote:(apropos easteregg - impress your skype contacts when typeing (mooning) into the textchat ;-))
Look here http://www.ice-blog.de/262-geheime-skyp ... -emoticons :wink:
[/OT]

Heiko...
Not longer here - sorry...

Haubner-IT GbR Dresden
User avatar
Jensensen
Posts: 2996
Joined: Tue 17. Oct 2006, 21:11
Location: auf der mlauer

Re: Nested Custom Content Blocks - really rocks!!! - Wow!!!

Post by Jensensen »

x
Last edited by Jensensen on Fri 19. Sep 2008, 01:49, edited 1 time in total.
{so_much} | Knick-Knack. | GitHub
Umlaute im URL sind meistens immer Kacke.
daniel.grant
Posts: 97
Joined: Thu 2. Nov 2006, 15:42
Location: London

Re: Nested Custom Content Blocks - really rocks!!! - Wow!!!

Post by daniel.grant »

Jensensen,

I bookmarked this a while ago and thought it may be of use later and yes, it does really rock!!


In the template:
<my markup> {ACCORDION} </my markup>

In the article
{ACCORDION} - CP HTML: <my markup inner> {AC1} {AC2} {AC3} etc...
{AC1} - CP WYSIWYG: my content....


Yes, really like this idea of nested content blocks, very useful to be organising and reducing number of messy templates.

Thanks.
pepe
Posts: 3954
Joined: Mon 19. Jan 2004, 13:46

Re: Nested Custom Content Blocks - really rocks!!! - Wow!!!

Post by pepe »

Hi freaks...

best way to "show" this beautifull and mighty feature of phpwcms, is NOT to describe it... BUT TO SHOW it on an example... :idea:

So a NewBee is able, to undestand, why that is a key-feature of our one and only phpWCMS !!!
User avatar
sustia
Posts: 651
Joined: Fri 2. Apr 2004, 22:29
Location: Lecce (Italy)
Contact:

Re: Nested Custom Content Blocks - really rocks!!! - Wow!!!

Post by sustia »

pepe wrote:Hi freaks...

best way to "show" this beautifull and mighty feature of phpwcms, is NOT to describe it... BUT TO SHOW it on an example... :idea:

So a NewBee is able, to undestand, why that is a key-feature of our one and only phpWCMS !!!
Exact pepe, I would like to learn too :)
Campeones del mundo!
Vegetables!
daniel.grant
Posts: 97
Joined: Thu 2. Nov 2006, 15:42
Location: London

Re: Nested Custom Content Blocks - really rocks!!! - Wow!!!

Post by daniel.grant »

I would consider myself a phpwcms noobie!! Anyway here's a quick example of how to use nested content blocks to facilitate the accordion effect.

For info about accordion check out Pepe's guide or the MooFx site which is where I took my Javascript and CSS from.

For info about content blocks visit this post


1. Create a page layout
Here you create the names of your custom content blocks

Image


2. Create a template
Be sure to select the moofx.css file that you already upload to your /inc_css/ folder and link to the mootools library found at /inc_js/mootools/mootools.js.
And most importantly add {ACCORDION} into your template where you want the Accordion to appear.

Image


3. Select the template in the category you want utilise the Accordion effect in

Image



4. Create a CP for the Accordion markup and JS
So once you've created an article in the correct category create a HTML CP (with the html and js that constructs the accordion) and choose Display: ACCORDION (so that the CP displays on your template where you put {ACCORDION})
Where you would normally put your bits of content you instead put a 'nested content block'. Here I use AC1, AC2 and AC3.

Image


5. Create your content
Now it is just a case of creating CPs that display in either {AC1} {AC2} or {AC3}
Here is I use a plain text CP.

Image

Image
User avatar
update
Moderator
Posts: 6433
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Re: Nested Custom Content Blocks - really rocks!!! - Wow!!!

Post by update »

This is real fun to work with - but take care that your nested nesting nests don't start overwhelming you and labyrinth-like hindering you to see the light of day again! :lol: :lol:
It's mostly all about maintaining two or three customer's sites Still supporter for the band Mykket Morton. Visit Mykket Morton on FB. Listen Mykket Morton and live videos on youtube.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
User avatar
Oliver Georgi
Site Admin
Posts: 9720
Joined: Fri 3. Oct 2003, 22:22
Location: Moscow, Russia
Contact:

Re: Nested Custom Content Blocks - really rocks!!! - Wow!!!

Post by Oliver Georgi »

NEVER!!!! put Mootools or any other JavaScript that might be called also from inside phpwcms into your template's head area.

Always use a frontend_render script that looks like this - the script filename (here: $block['custom_htmlhead']['...script...']) is always used as array index:

Code: Select all

<?php

	/* Load my special Mootools script */
	$block['custom_htmlhead']['mootools.js']	= '  <script src="'.TEMPLATE_PATH.'inc_js/mootools/mootools-release-1.11.js" type="text/javascript"></script>';

	/* Load Mootools in newer releases */
	initMootools();

	/* Load My custom JavaScript */
	$block['custom_htmlhead']['my.js']		= '  <script src="'.TEMPLATE_PATH.'inc_js/my.js" type="text/javascript"></script>';
	
	/* Load some other <head> positions */
	$block['custom_htmlhead']['favicon1']		= '  <link rel="icon" href="favicon.ico" type="image/x-icon" />';
	$block['custom_htmlhead']['favicon2']		= '  <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />';

	/* IE <=6 Style Hack */
	$block['custom_htmlhead']['IEhack']  = '  <!--[if lt IE 7]><style type="text/css"> #inner { height:300px; } </style><![endif]-->';		

	/* Hm I want to overwrite some default CSS */
	$block['custom_htmlhead']['mycss']  = '  <style type="text/css">' . LF . '  <!--' . LF;
	$block['custom_htmlhead']['mycss'] .= '	#header { ' . LF;
	$block['custom_htmlhead']['mycss'] .= '		background: #F9E931 url(template/img/mozilla.png) no-repeat left top !important;' . LF;
	$block['custom_htmlhead']['mycss'] .= '		background: #F9E931 url(template/img/ie.gif) no-repeat left top;' . LF;
	$block['custom_htmlhead']['mycss'] .= '	}';
	$block['custom_htmlhead']['mycss'] .= LF . '  //-->' . LF . '  </style>';
?>
Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
daniel.grant
Posts: 97
Joined: Thu 2. Nov 2006, 15:42
Location: London

Re: Nested Custom Content Blocks - really rocks!!! - Wow!!!

Post by daniel.grant »

why NEVER?

I mean I've done it quite a lot and it doesn't seemed to have caused any problems. But if there is a probably I should probably sort it out right?
User avatar
Oliver Georgi
Site Admin
Posts: 9720
Joined: Fri 3. Oct 2003, 22:22
Location: Moscow, Russia
Contact:

Re: Nested Custom Content Blocks - really rocks!!! - Wow!!!

Post by Oliver Georgi »

I like to cry ;-) - I saw people using extensive templates. It's simpler to handle it with a single frontend_render script. You get better control.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
User avatar
Jensensen
Posts: 2996
Joined: Tue 17. Oct 2006, 21:11
Location: auf der mlauer

Re: Nested Custom Content Blocks - really rocks!!! - Wow!!!

Post by Jensensen »

x
Last edited by Jensensen on Fri 19. Sep 2008, 01:52, edited 1 time in total.
{so_much} | Knick-Knack. | GitHub
Umlaute im URL sind meistens immer Kacke.
Post Reply