blog.Resource

Archive:

News-Feeds:


RSS 2.0
RSS 0.91
RDF
ATOM 0.3
November 24, 2009

The "New Content Element Wizard" in version 4.3

Category: Steffen Kamper, Core

There is a big change in version 4.3 with the "New Content Element Wizard", it is now configured by pageTS. This allows to have specifiv page-per-page-configurations. This article shows you the technique behind.

If you call the wizard you may notice no difference compare to the wizard in 4.2, but this is because the configuration is the same.

Optically there is one new option which render the wizard in tabs. Simply use this pageTS:

mod.wizards.newContentElement.renderMode = tabs

Each header /tab, i will call them section, has his own configuration. Let's have a look to the first section
"Typical page content". Key of this section is "common". The elements of this section are configured in

mod.wizards.newContentElement.wizardItems.common 

Lets have a closer look to one element, the "header" (Header only). It's not integrated, so you can add it to your pageTS:

mod.wizards.newContentElement.wizardItems.common.elements.header {
icon = gfx/c_wiz/regular_text.gif
title = Header
description = Adds a header element only
tt_content_defValues {
CType = header
}
}

You see 4 parameters which are self-descripting. Interesting is the tt_content_defValues-parameter which allows you to set values of the tt_content record as default. It's an array where key is the fieldname and value the value. To add this element to the wizard you have to add it to the show-list which is currently

mod.wizards.newContentElement.wizardItems.common.show = text,textpic,image,bullets,table

You can use the syntax addToList:

mod.wizards.newContentElement.wizardItems.common.show := addToList(header)

Cool, isn't it?

Now let's make our own group with an own content element (Text with predefined content).
Group key will be "myGroup" and each group needs 3 settings:

mod.wizards.newContentElement.wizardItems {
header = [Title, string]
elements { Content Elements array}
show = [comma seperated list of elements to show in this group and in this defined order]
}

Ok, lets do it now:

mod.wizards.newContentElement.wizardItems.myGroup {
header = My Company Special Items
elements.customText {
icon = gfx/c_wiz/regular_text.gif
title = Introtext for national startpage
description = use this element for all national startpages
tt_content_defValues {
CType = text
bodytext (
<h2>Section Header</h2>
<p class="bodytext">Lorem ipsum dolor sit amet, consectetur, sadipisci velit ...</p>
)
header = Section Header
header_layout = 100
}
}
}
mod.wizards.newContentElement.wizardItems.myGroup.show = customText

That's all. Now you can define your own group, reuse existing elements in new groups and order, own show-lists for specific pages a.s.o.

Have fun!


comments

comment #1
Gravatar: Roger Roger November 24, 2009 12:01
This looks like a real treat, makes for a splendid content authors' UX. Thanks for TS pointers!

comment #2
Gravatar: Sven Sven November 24, 2009 14:12
Does this work in TYPO3 4.3.0RC1 already? I tried it, but nothing changed! Still no tabs!

CU...Sen

comment #3
Gravatar: Steffen Kamper Steffen Kamper November 24, 2009 14:28
sure, it works since beat1. Be sure you put it in pageTS (eg tsconfig of first page-properties)

comment #4
Gravatar: Mathieu Mathieu November 27, 2009 09:18
Because it does not work with the page module of TemplaVoilà. Enable the classic page module to see it.

comment #5
Gravatar: Pim Broens Pim Broens November 27, 2009 10:23
This is a great feature for our clients. We can provide them with clean and easy-to-use layouts. Thanks! great work guys.

comment #6
Gravatar: Marco Malagoli Marco Malagoli November 27, 2009 10:43
For templavoila use "templavoila.wizards.newContentElement"
Thank you for all your work. This is a great feature.

comment #7
Gravatar: Petur Z Petur Z November 27, 2009 23:34
Spennandi hentleiki. Nú vita vit hvussu tað sær út !

comment #8
Gravatar: ben van \'t ende ben van \'t ende November 28, 2009 13:17
Great feature Steffen. tHNx Ben

comment #9
Gravatar: Ric van Westhreenen Ric van Westhreenen November 28, 2009 14:52
This is indeed a very nice addition. Thanks Steffen. Ric

comment #10
Gravatar: Thasmo Thasmo December 3, 2009 23:23
Thanks for sharing this, very neat feature! =o)

comment #11
Gravatar: Gry online Gry online December 4, 2009 12:29
finally :) it's really cool

Sorry, comments are closed for this post.