Discussion:
[TYPO3-english] Add page layout in bootstrap package typo3 6.2
Gunnar Jonsson
2014-04-28 12:29:44 UTC
Permalink
I want a page layout with 3 grids for left margin and 9 grids for normal. Are there any tutorial how to add a new page layout in bootstrap package?

I have copied one of the HTML files and renamed it Default2VColumns.html, so it looks like:
<f:layout name="Default" /> <f:section name="Main"> <div class="container"> <div class="row"> <div class="col-md-3"> <f:cObject typoscriptObjectPath="lib.dynamicContent" data="1" /> </div> <div class="col-md-9" role="main"> <f:cObject typoscriptObjectPath="lib.dynamicContent" data="0" /> </div> </div> </div> </f:section>

And I also inserted the following in the root template:
page.10.file.stdWrap.cObject.bootstrap_package__default_2_V_columns = TEXT
page.10.file.stdWrap.cObject.bootstrap_package__default_2_V_columns.value = EXT:bootstrap_package/Resources/Private/Templates/Page/Default2VColumns.html
page.10.file.stdWrap.cObject.bootstrap_package__default_2_V_columns.insertData = 1

It seems like this is not enough in order to use it for page layout. Someone who knows what more is needed? I also wonder what "role="main" is used for.

Regards,
Gunnar Jonsson
Gunnar Jonsson
2014-05-01 20:15:25 UTC
Permalink
I got a step further and found out that I also had to insert the following in the file: bootstrap_package/Resources/Private/Language/Backend.xml
<trans-unit id="backend_layout.default_2_V_columns">
<source>Bootstrap Package: Left & normal, 2 Columns</source>
</trans-unit>


And futhermore I had to insert the following in the file:
bootstrap_package/Classes/Hooks/Options/BackendLayoutDataProvider.php
'default_2_V_columns' => array(
'title' => 'LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:backend_layout.default_2_V_columns',
'config' => '
backend_layout {
colCount = 6
rowCount = 2
rows {
1 {
columns {
1 {
name = LLL:EXT:cms/locallang_ttc.xlf:colPos.I.0
colPos = 1
colspan = 2
}
2 {
name = LLL:EXT:cms/locallang_ttc.xlf:colPos.I.1
colPos = 0
colspan = 4
}
}
}
2 {
columns {
1 {
name = LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:backend_layout.column.footer1
colPos = 10
colspan = 2
}
2 {
name = LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:backend_layout.column.footer2
colPos = 11
colspan = 2
}
3 {
name = LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:backend_layout.column.footer3
colPos = 12
colspan = 2
}
}
}
}
}
',
'icon' => 'EXT:bootstrap_package/Resources/Public/Images/BackendLayouts/default_2_V_columns.gif'
),

Most things seems now to be in order, except for the naming of the page layout in the backend. I get a blank line instead of the text "Bootstrap Package: Left & normal, 2 Columns" when choosing page layout in Edit page.
Regards,
Gunnar Jonsson
Gunnar Jonsson
2014-05-30 18:42:25 UTC
Permalink
The solution was found: When removing the ampersand in the following lines, the name of the backend layout appeared in the list in BE.

<trans-unit id="backend_layout.default_2_V_columns">
<source>Bootstrap Package: Left & normal, 2 Columns</source>
</trans-unit>

Regards,
Gunnar Jonsson
Xavier Perseguers
2014-05-31 08:26:36 UTC
Permalink
Hi,
Post by Gunnar Jonsson
The solution was found: When removing the ampersand in the following
lines, the name of the backend layout appeared in the list in BE.
<trans-unit id="backend_layout.default_2_V_columns">
<source>Bootstrap Package: Left & normal, 2 Columns</source>
Again, change that to "... Left &amp; normal, ..." and it will work.
Another solution is using CDATA:

<source><![CDATA[
Bootstrap Package: Left & normal, 2 Columns
]]></source>

Regards
--
Xavier Perseguers
TYPO3 CMS Team Member

TYPO3 .... inspiring people to share!
Get involved: http://typo3.org
Loading...