Achja, das hab ich noch vergessen: Man muss die Thumbnails für die Anzeige nicht nur im typoscript richtig angeben, sondern muss auch die entsprechenden dateien beim template als 'Resource' hinzufügen.
Sonst funktionierts nur mit dem Dropdown!
rlmp_tmplselector über TypoScript (templateMode = ts)
Hi BastianBalthasarBux,
vielen Dank! Mit Deinem Template hat es sofort funktioniert und ich habe es auch schon an meine Bedürfnisse angepasst.
Eine Sache mit der ich aber leben könnte fällt mir nur negativ auf: Im Seitenheader-Config Bereich gibt es neben meinen beiden Templates auch noch das Template "Standard". Kann man diesen Eintrag entfernen? Oder kann man alternativ den Titel und das Bild von diesem Eintrag ebenfalls anpassen?
Vielen Dank!
Das weiss ich leider nicht, aber normalerweise gibst du ein template als 'standard' an, das wir dann automatisch genommen.
Ich glaub da müsste man schon ein bisschen mit dem source code spielen (tca.php oder tables.php wären da mal mein tipp 😉 )
das bild könntest du evt. einfach überspielen. -> das liegt im extension verzeichnis vom template selector.
lg bbb
Hallo BastianBalthasarBux,
ich habe dein TS für den Template Selector im TS-Modus genommen und es funktioniert prima. Das einzige, was ich nicht hinbekomme ist die Auswahl alternativer Sub Templates in den Seiteneigenschaften.
Ich habe es einmal so probiert:
## 1. Alternative für Sub Template
temp.TS_template_temp.news_from_our_speakers_THIS_PAGE_01 = TEMPLATE
...
template.10 < styles.content.get
}
## 2. Alternative für Sub Template
temp.TS_template_temp.news_from_our_speakers_THIS_PAGE_02 = TEMPLATE
...
template.10 < styles.content.getRight
}
plugin.tx_rlmptmplselector_pi1 {
# in den Template Selector
templateObjects.sub {
HALLO_01 < temp.TS_template_temp.news_from_our_speakers_THIS_PAGE_01
HALLO_02 < temp.TS_template_temp.news_from_our_speakers_THIS_PAGE_02
}
# 2 alternative Sub Templates einem Haupttemplate zuweisen
templateObjects.main.40.marks {
HALLO < plugin.tx_rlmptmplselector_pi1.templateObjects.sub.HALLO_01
HALLO < plugin.tx_rlmptmplselector_pi1.templateObjects.sub.HALLO_02
}
}
Die beiden alternativen Sub Templates:
news_from_our_speakers_THIS_PAGE_01
news_from_our_speakers_THIS_PAGE_02
werden mir dann natürlich in den Seiteneigenschaften im Dropdown der Sub Templates angezeigt. Welches der beiden Templates dort aber gewählt wird, hat keinen Einfluß darauf, welches letztlich im Haupttemplate den ###HALLO### Marker ersetzt.
Was kann ich da tun?
Gruß Renè
Du musst die templates natürlich irgendwie verschachteln.
Ich habs mit einem kleinen if zum laufen gebracht, hier der code:
// das hier wird dann als 'Hauptvorlage' in rlmp_tmplsel eingerichtet
temp.mainStart = TEMPLATE
temp.mainStart {
template = FILE
template.file=fileadmin/startMain.tmpl
workOnSubpart = CR_DOCUMENT
marks.CR_NEWS_MATRIX = CASE
marks.CR_NEWS_MATRIX {
key.field=tx_rlmptmplselector_ca_tmpl
// hier kommt das subtemplate template 1
10 < temp.subStart1
// hier kommt das subtemplate 2, etc.....
20 < temp.subStart2
30 < temp.subStart3
default < temp.subStart1
}
}
Sorry, dass es etwas länger gedauert hat, aber leider hatte ich viel zu tun!
greetz from T3CON06,
clemens
Hallo BastianBalthasarBux !!
Habe seit 2 Tagen versucht deinen Vorschlag bezüglich der rlmp_tmplselector Extension ein eigenes HTML Template bzw. 2 HTML Templates auf verschiedenen Seiten einzubinden.
Also um mich klar auszudrücken, ich habe auf einigen Seiten meines Projektes ein 3 spaltiges Layout und auf einigen anderen ein 2 spaltiges Layout. Ich habe anfangs zuerst auf der ersten Startseite ganz normal ein PAGE Objekt erstellt und dann auf den gewünschen Seiten einfach dieses PAGE Objekt rüberkopiert und angepasst. Nun habe gelesen, dass dies wohl Probleme mit RealURL geben kann ?
Dann auf die Suche und auch gefunden : Lösung -> rlmp_tmplselector !! Nach weiterer Suche habe ich dann ein TUTORIAL gefunden und deine Anleitung und auch noch andere. Aber anscheinend bin ich zu blöd für diese Welt. Darf gar nicht sagen, seit wann ich daran arbeite. Als Webdesigner wäre ich arbeitslos !!! Glück muss ich nicht davon leben. Aber nun zum Thema ich hoffe du erbarmst dich meiner, da du anscheinend weisst was du machst. Falls du mir helfen könntest, würde ich dir gern auch entgegenkommen !!
Hier mein Typoscript der Startseite :
##legt den Pfad zu den Main-Template Dateien fest
plugin.tx_rlmptmplselector_pi1.templatePathMain = fileadmin/templates/main/
##legt den Pfad zu den Main-Template Dateien fest
plugin.tx_rlmptmplselector_pi1.templatePathSub = fileadmin/templates/sub/
plugin.tx_rlmptmplselector_pi1.inheritMainTemplates = 1
plugin.tx_rlmptmplselector_pi1.inheritSubTemplates = 1
##legt die Standard Main-Template Dati fest, die geladen werden soll insofern kein anderes Template ausgewählt wurde
plugin.tx_rlmptmplselector_pi1.defaultTemplateFileNameMain = template3col.html
##legt die Standard Sub-Template Dati fest, die geladen werden soll insofern kein anderes Template ausgewählt wurde
plugin.tx_rlmptmplselector_pi1.defaultTemplateFileNameSub = template2col.html
page = PAGE
page.typeNum = 0
page.10 = TEMPLATE
page.10 {
template = FILE
template.file = fileadmin/templates/template3col.html
workOnSubpart = DOCUMENT_BODY
subparts.HAUPT_NAVI < tmp.HAUPTNAVIGATION
subparts.ZUSATZ_NAVI < tmp.ZUSATZNAVIGATION
subparts.INHALT_MITTE < styles.content.get
subparts.MENU_RECHTS < styles.content.getRight
}
temp.rcontent < styles.content.getRight
temp.rcontent.stdWrap {
wrap = <div id="rcontent"> | </div>
if.isTrue.numRows < styles.content.getRight
}
temp.lcontent < styles.content.getLeft
temp.lcontent.stdWrap {
wrap = <div id="lcontent"> | </div>
if.isTrue.numRows < styles.content.getLeft
}
page.includeCSS.file1 = fileadmin/templates/css/main3col.css
page.includeCSS.file1.media = all
page.includeCSS.file2 = fileadmin/menu/horizontal.css
page.includeCSS.file3 = fileadmin/menu/vertikal.css
page.headerData.20 = TEXT
page.headerData.20.value (
<!--[if lt IE 8]>
<style type="text/css" media="screen, projection">
@import "fileadmin/menu/ie.css";
</style>
<![endif]-->
)
page.headerData.30 = TEXT
page.headerData.30.value (
<script type="text/javascript">
//<![CDATA[
function show(element){
element.className += "hover";
}
function hide(element){
element.className = element.className = "";
}
//]]>
</script>
)
Dann habe ich noch ein Typoscript Template das gleich ist ausgelagert, weiss aber nicht genau ob ich dies überhaupt brauche, denn eigentlich sollte man doch dann über dieses Dropdown Menü auf den Seiteneigenschaften auswählen können und gut ist ?
Und wenn das so ist wie binde ich dann die CSS für diese angepasste Seite ein ?
Ich hoffe du nimmst dich meiner an. Bin kurz vor dem Selbstmord !! He, he, he, schon nicht ganz, aber bald, hi, hi, hi, siehst du ich kann immer noch darüber lachen oder über mich ?
Gruss Marijo
Sieht ja schon mal nicht schlecht aus.
Ich persönlich arbeite allerdings lieber mit markern als mit subparts.
Ist denn auch die Extension rlmp_templsel (oder wie sie heißt) auf 'ts' eingestellt?
via Extension manager kann man das erledigen.
Standardmässig ist die Extension auf file eingestellt.
verwende ich aber nie.
ich mach das immer mit ts.
was ich auch komisch finde ist tmp.
afaik gibt es:
lib und temp.
wobei temp für solche sachen resourcenschonender ist.
natürlich geht auch tmp. ist aber halt dann irgendein keyword, und kein typoscript-objekt.
hier ein post zu dem thema:
#63297
ps: wegen der antwort hier ignoriere ich jetzt einfach die pm 😉
Hi BastianBalthasarBux!
Ich kämpfe leider auch mit dem templateselector.
ich habe mich an deinen oben angegebenen Code gehalten, habe ihn angepasst, kann auch die Templates auswählen - aber ich bekomme eine leere Seite. Nada, nix, weiß 🙁
Ich poste jetzt mal meinen Code und dann hab ich noch zwei Fragen. Vieleicht kannst Du mir helfen, weil ich schon ziemlich am Zahnfleisch bin.
[TS
lib {
logo = IMAGE
logo {
wrap = <a href="/" alt="HPC dual" title="HPC dual">|</a>
file = fileadmin/img/logo.gif
altText.field = description // subtitle // nav_title // title
titleText.field = description // subtitle // nav_title // title
}
langselect = TEXT
langselect.value = <div id="langpack"><a href="index.php?id=1"><div class="ger"> </div><a href="index.php?id=14"><div class="eng"> </div></a></div>
}
### Example by Riccabona eSolutions, no warranty
### Default content template
temp.objPageMainContent = TEMPLATE
temp.objPageMainContent {
template = FILE
template.file = fileadmin/templates/template_std.html
workOnSubpart = DOKUMENT
workOnSubpart = SUBCONTENT
marks.CONTENT_MAIN < styles.content.get
}
### Content with infobox
temp.objMainInfoBox = TEMPLATE
temp.objMainInfoBox {
template = FILE
template.file = fileadmin/templates/template_info.html
workOnSubpart = DOKUMENT
workOnSubpart = SUBCONTENT
marks {
CLEFT = CONTENT
CLEFT {
table = tt_content
select.orderBy = sorting
select.begin = 0
select.max = 1
}
CIHEAD = CONTENT
CIHEAD {
table = tt_content
select.orderBy = sorting
select.begin = 1
select.max = 1
}
CITXT = CONTENT
CITXT {
table = tt_content
select.orderBy = sorting
select.begin = 2
select.max = 1
}
}
}
### The Startpage
### temp.objPageMainStart = TEMPLATE
### temp.objPageMainStart {
### template = FILE
### template.file = fileadmin/tmpl/start.tmpl
### workOnSubpart = ...
### .
### .
### .
### }
### Configurating the Template Selector
temp.objMainContent = TEMPLATE
temp.objMainContent {
tx_rlmptmplselector.title = Vorlage - 1 spaltiger Inhalt
#tx_rlmptmplselector.imagefile = fileadmin/img/pageContentMain.gif
template = COA
template.10 < temp.objPageMainContent
}
temp.objMainContentInfo = TEMPLATE
temp.objMainContentInfo {
tx_rlmptmplselector.title = Vorlage - mit seitlicher Infobox
#tx_rlmptmplselector.imagefile = fileadmin/img/pageContentMain2Cols.gif
template = COA
template.10 < temp.objMainInfoBox
}
#temp.objMainStart = TEMPLATE
#temp.objMainStart {
# tx_rlmptmplselector.title = Hauptvorlage - Startseite
# tx_rlmptmplselector.imagefile = fileadmin/img/page_main_start.gif
# template = COA
# template.10 < temp.objPageMainStart
#}
### Templateselector Core Definitions
plugin.tx_rlmptmplselector_pi1 {
templateObjects.main {
10 < temp.objMainContent
20 < temp.objMainContentInfo
#30 < temp.objMainStart
}
templateObjects.sub {
}
defaultTemplateObjectMain = 10
defaultTemplateObjectSub = 10
inheritMainTemplates = 0
inheritSubTemplates = 0
}
]
Was nicht hier herinnen ist, ist der Aufbau des Menüs. Ich hab meine seite so aufgebaut, dass ich lib, header, config und dann das rootTemplate habe.
Und beim RootTemplate liegt wahrscheinlich auch mein Fehler. Aber hier mal der Code:
[/TS
page.10 = TEMPLATE
page.10 {
template = plugin.tx_rlmp_templateselector_pi1
workOnSubpart = DOCUMENT
marks.LOGO < lib.logo
marks.LANG < lib.langselect
marks.M1 = HMENU
marks.M1.special = directory
marks.M1.special.value = 1
marks.M1.1 = TMENU
marks.M1.1.noBlur = 1
marks.M1.1 {
wrap = <div id="navcontainer"><ul id="navlist">|</ul></div>
expAll = 1
NO.ATagParams = onFocus="if (this.blur) this.blur()"
NO.wrapItemAndSub = <li>|</li>
ACT < .NO
ACT = 1
ACT.ATagParams = class="menu_active"
}
marks.CONTENT_MAIN < styles.content.get
}
]
Meine Frage und Überlegung ist, dass das Menü hier wahrscheinlich falsch liegt. Wenn ja wo leg ich es an und wie geht das mit Untermenüs.
Aber am wichigsten ist, das ich mal keine weiße Seite sehe.
Kannst du mir da helfen?
lg
rat_pack
template = plugin.tx_rlmp_templateselector_pi1
Hä?? was soll denn das heissen?
Also templateselector TS mode:
Benötigt:
3 subparts:
1. das grundgerüst mit marker an dessen stelle dann der templateselector eingefügt wird.
2. mindestens 2 Templates für den 'innenteil' die dann der templateselector verwenden soll. (es geht auch nur mit einem template, ist nur wenig sinnvoll 😉)
Einfügen tut man den dann so tun, den templateselector:
page = PAGE
....
all der übliche page und template code
....
und dann:
marks.MEIN_AUSWAEHLBARER_TEMPLATE_SELECTOR_BEREICH < plugin.tx_rlmptmplselector_pi1
Bitte nicht vergessen, dass die Konfiguration des templateselectors (und der einzelnen main und sub templates) VORHER bekanntgegeben werden muss. zumindest wenn man es mit temp macht. bei lib könnte es sein, dass es keine rolle spielt.
Das ganze funktioniert dann so:
Globale (in allen templates gleich) Dinge stehen ganz normal im standard template, und werden mit page.10.marks angesprochen.
Als Subpart braucht man natürlich da einen extra breich.
innerhalb dieses subparts kann man dann beliebig main und sub des templateselectors kombinieren.
Wobei ich nahzu ausschliesslich den 'aussenrum' bereich in klassischer form benutze, und innen dann so gut wie immer nur main benötige.
die quasi dritte template ebene (sub) brauch ich nur ganz selten bei ausgefuchsten projekten. 😉
Hi BBB!
#angry#
Vielen Dank für deine ausfürliche Antwort. Ich weiß nicht ob ich alles verstanden habe, aber ich ich glaub, dass ich wahrscheinlich zu blöd für den slector bin!
Also ich habe jetzt meine lib angepasst und mehrere Templates angegeben.
jetzt sehe ich zwar das Menü, Logo und die allgemeinen dinge. Aber Content kommt immer noch keiner daher.
Was kommt für ein TS bei den einzelnen Seiten? Woher wissen die jetzt was dir tun sollen? Durch die Auswahl den Templates selbst, oer muss da noch TS-Code dazu?
lib {
logo = IMAGE
logo {
wrap = <a href="/" alt="HPC dual" title="HPC dual">|</a>
file = fileadmin/img/logo.gif
altText.field = description // subtitle // nav_title // title
titleText.field = description // subtitle // nav_title // title
}
motto = IMAGE
motto {
wrap = <a href="/" id ="motto" alt="Motto" title="Motto">|</a>
file = fileadmin/img/motto.gif
altText.field = description // subtitle // nav_title // title
titleText.field = description // subtitle // nav_title // title
}
beratung = IMAGE
beratung {
wrap = <a href="/" alt="Beratung" title="Beratung">|</a>
file = fileadmin/img/beratung.gif
altText.field = description // subtitle // nav_title // title
titleText.field = description // subtitle // nav_title // title
}
langselect = TEXT
langselect.value = <div id="langpack"><a href="index.php?id=1"><div class="ger"> </div><a href="index.php?id=14"><div class="eng"> </div></a></div>
}
### Example by Riccabona eSolutions, no warranty
### Default content template
temp.objPageMainContent = TEMPLATE
temp.objPageMainContent {
template = FILE
template.file = fileadmin/templates/template_stdall.html
#workOnSubpart = DOKUMENT
workOnSubpart = SUBCONTENT
marks.CONTENT_MAIN < styles.content.get
}
### Content with infobox
temp.objMainInfoBox = TEMPLATE
temp.objMainInfoBox {
template = FILE
template.file = fileadmin/templates/template_info.html
workOnSubpart = SUBCONTENT
marks {
CLEFT = CONTENT
CLEFT {
table = tt_content
select.orderBy = sorting
select.begin = 0
select.max = 1
}
CIHEAD = CONTENT
CIHEAD {
table = tt_content
select.orderBy = sorting
select.begin = 1
select.max = 1
}
CITXT = CONTENT
CITXT {
table = tt_content
select.orderBy = sorting
select.begin = 2
select.max = 1
}
}
}
### Content with a pic instead infobox
temp.objMainPic = TEMPLATE
temp.objMainPic {
template = FILE
template.file = fileadmin/templates/template_pic.html
workOnSubpart = SUBCONTENT
marks {
CHEAD = CONTENT
CHEAD {
table = tt_content
select.orderBy = sorting
select.begin = 0
select.max = 1
}
CLEFT = CONTENT
CLEFT {
table = tt_content
select.orderBy = sorting
select.begin = 1
select.max = 1
}
CPIC = CONTENT
CPIC {
table = tt_content
select.orderBy = sorting
select.begin = 2
select.max = 1
}
}
}
### Content with infobox
temp.objMainHome = TEMPLATE
temp.objMainHome {
template = FILE
template.file = fileadmin/templates/template_info.html
workOnSubpart = SUBCONTENT
marks {
CLEFTPIC = CONTENT
CLEFTPIC {
table = tt_content
select.orderBy = sorting
select.begin = 0
select.max = 1
}
CLEFTDOWNPIC = CONTENT
CLEFTDOWNPIC {
table = tt_content
select.orderBy = sorting
select.begin = 1
select.max = 1
}
HCRIGHT = CONTENT
HCRIGHT {
table = tt_content
select.orderBy = sorting
select.begin = 2
select.max = 1
}
HCINFOHEAD = CONTENT
HCINFOHEAD {
table = tt_content
select.orderBy = sorting
select.begin = 3
select.max = 1
}
HCINFOTXT = CONTENT
HCINFOTXT {
table = tt_content
select.orderBy = sorting
select.begin = 4
select.max = 1
}
HCRIGHTPIC = CONTENT
HCRIGHTPIC {
table = tt_content
select.orderBy = sorting
select.begin = 5
select.max = 1
}
}
}
### The Startpage
temp.objPageMainStart = TEMPLATE
temp.objPageMainStart {
template = FILE
template.file = fileadmin/templates/template_main.html
workOnSubpart = DOKUMENT
}
### Configurating the Template Selector
temp.objMainContent = TEMPLATE
temp.objMainContent {
tx_rlmptmplselector.title = Vorlage - 1 spaltiger Inhalt
#tx_rlmptmplselector.imagefile = fileadmin/img/pageContentMain.gif
template = COA
template.10 < temp.objPageMainContent
}
temp.objMainContentPic = TEMPLATE
temp.objMainContentPic {
tx_rlmptmplselector.title = Vorlage - mit seitlicher Infobox
#tx_rlmptmplselector.imagefile = fileadmin/img/pageContentMain2Cols.gif
template = COA
template.10 < temp.objMainPic
}
temp.objMainContentInfo = TEMPLATE
temp.objMainContentInfo {
tx_rlmptmplselector.title = Vorlage - mit seitlichem Bild
#tx_rlmptmplselector.imagefile = fileadmin/img/pageContentMain2Cols.gif
template = COA
template.10 < temp.objMainInfoBox
}
temp.objMainHome = TEMPLATE
temp.objMainHome {
tx_rlmptmplselector.title = Vorlage - Homeseite
#tx_rlmptmplselector.imagefile = fileadmin/img/pageContentMain2Cols.gif
template = COA
template.10 < temp.objMainHome
}
temp.objMainStart = TEMPLATE
temp.objMainStart {
tx_rlmptmplselector.title = Hauptvorlage
# tx_rlmptmplselector.imagefile = fileadmin/img/page_main_start.gif
template = COA
template.10 < temp.objPageMainStart
}
### Templateselector Core Definitions
plugin.tx_rlmptmplselector_pi1 {
// Define the paths leading to our HTML template files
templatePathMain = fileadmin/templates/
templatePathSub = fileadmin/templates/sub/
templateObjects.main {
10 < temp.objMainContent
20 < temp.objMainContentInfo
30 < temp.objMainContentPic
40 < temp.objMainHome
50 < temp.objMainStart
}
templateObjects.sub {
}
defaultTemplateObjectMain = 10
defaultTemplateObjectSub = 10
inheritMainTemplates = 0
inheritSubTemplates = 0
}
Mein Setup schaut jetzt so aus:
page.10 = TEMPLATE
page.10 {
template = FILE
template.file = fileadmin/templates/template_main.html
#template < plugin.tx_rlmptmplselector_pi1
#template = FILE
# template.file = fileadmin/templates/template_std.html
workOnSubpart = DOKUMENT
marks.LOGO < lib.logo
marks.MOTTO < lib.motto
marks.BERAT < lib.beratung
marks.LANG < lib.langselect
marks.M1 = HMENU
marks.M1.special = directory
marks.M1.special.value = 67
marks.M1.1 = TMENU
marks.M1.1.noBlur = 1
marks.M1.1 {
wrap = <div id="navcontainer"><ul id="navlist">|</ul></div>
expAll = 1
NO.ATagParams = onFocus="if (this.blur) this.blur()"
NO.wrapItemAndSub = <li>|</li>
ACT < .NO
ACT = 1
ACT.ATagParams = class="menu_active"
}
marks.M2 = COA
marks.M3 = COA
marks.CONTENT_MAIN < plugin.tx_rlmptmplselector_pi1
}
bei zwei Seiten hab ich jetzt ein Template ausgewählt, aber der Inhalt wird nicht sichtbar.
Die Vorlagen haben bis auf das template_main.html nur <!-- ###SUBCONTENT### --> drinnen (gleich nach <body>) und darunter die marks (die hab ich in der Lib angesprochen). Brauch ich da jetzt noch TS für die Seite?
Du hast noch geschrieben, dass man main unc sub VORHER bekannt geben muss. Was meinst du damit genau?
Im Object_browser wird kein Fehler angezeigt.
Sorry, dass ich nerv, aber ich steh da ziemlich auf der Leitung!
lg
rat_pack
sieht auf den ersten Blick gut aus.
hast du nen link?
den marker 'content_main' gibt es?