Hallo Zusammen,
für die Integration eines Coverflow-Plugins benötige ich die folgende HTML-Struktur:
<ul id="coverflowData" style="display: none;">
<ul data-cat="+ Category one">
<ul>
<li data-type="media" data-url="load/images/1.jpg"></li>
</ul>
<ul>
<li data-type="media" data-url="load/images/2.jpg"></li>
</ul>
<ul>
<li data-type="media" data-url="load/images/3.jpg"></li>
</ul>
</ul>
</ul>
Bisher habe ich unter Verwendung eines anderen Plugins das folgende Typoscript benutzt:
lib.images = CONTENT
lib.images {
table = tt_content
select {
pidInList.field = uid
where = colPos = 4
}
renderObj = COA
renderObj {
10 = FILES
10 {
references {
table = tt_content
uid.field = uid
fieldName = image
}
renderObj = IMAGE
renderObj {
file.import.data = file:current:publicUrl
file.maxW = 175
file.maxH = 265
wrap = <li >|</li>
}
}
}
}
Nun muss ich das Script so umbauen, dass die oben beschriebene Struktur dabei heraus kommt. Kann mir jemand dabei helfen? Ich verzweifle leider an den verschachtelten wraps und dem Auslesen des Bild-Pfades.
Vielen Dank im Voraus,
nahdor
was soll denn in dem <ul data-cat="+ Category one"> stehen? Also was ist dieses Category one ?
lib.images {
stdWrap.wrap = <ul id="coverflowData"><ul data-cat="+ Category one">|</ul></ul>
table = tt_content
select {
pidInList.field = uid
where = colPos = 4
}
renderObj = IMG_RESOURCE
renderObj {
file {
maxW = 175
maxH = 265
import.data = file:current:publicUrl
}
altText.field = title
titleText.field = title
stdWrap.wrap = <ul><li data-type="media" data-url="|"></li></ul>
}
Danke für die schnelle Antwort. Mit <ul>-Tag mit der Category-Klasse lassen sich die einzelnen Bilder noch zusätzlich filtern. Das ist für meine Umsetzung allerdings nicht nötig. Der Tag muss allerdings trotzdem mit rein.
Leider werden innerhalb von <ul id="coverflowData"><ul data-cat="+ Category one">|</ul></ul> nichts angezeigt. Der zweite Teil ("<ul><li data-type="media" data-url="|"></li></ul>" usw.) wird nicht ausgegeben.
Hast du eine Ahnung, woran das liegen könnte?
hast du den code reinkopiert?
sehe gerade, dass in meinem Beitrag in den Quelltext ein smiley reingerendert wurde:
import.data = file : current : publicUrl
muss das natürlich heißen, ohne leerzeilen!!
der ganze Code:
lib.images = CONTENT
lib.images {
stdWrap.wrap = <ul id="coverflowData"><ul data-cat="+ Category one">|</ul></ul>
table = tt_content
select {
pidInList.field = uid
where = colPos = 4
}
renderObj = IMG_RESOURCE
renderObj {
file {
maxW = 175
maxH = 265
import.data = file:current: publicUrl
}
altText.field = title
titleText.field = title
stdWrap.wrap = <ul><li data-type="media" data-url="|"></li></ul>
}
}
Ups, klar! Das funktioniert jetzt, danke!
Die Anforderungen haben sich noch etwas verändert. Jetzt muss der Bildpfad zwei mal ausgegeben werden... nämlich so:
<ul id="coverflowData" style="display: none;">
<ul data-cat="+ Category one">
<ul>
<li data-type="media" data-url="load/images/1.jpg"></li>
<li data-thumbnail-path="load/images/1.jpg"></li>
</ul>
<ul>
<li data-type="media" data-url="load/images/2.jpg"></li>
<li data-thumbnail-path="load/images/2.jpg"></li>
</ul>
<ul>
<li data-type="media" data-url="load/images/3.jpg"></li>
<li data-thumbnail-path="load/images/3.jpg"></li>
</ul>
</ul>
</ul>
Könntest du mir noch kurz zeigen, wie ich das anstelle? Vielen Dank!
Habe die Lösung schon selbst gefunden. Der endgültige Code lautet:
lib.projectimages = CONTENT
lib.projectimages {
stdWrap.wrap = <ul id="coverflowData" style="display: none;"><ul data-cat="+ Category one">|</ul></ul>
table = tt_content
select {
pidInList.field = uid
where = colPos = 4
}
renderObj = COA
renderObj {
stdWrap.wrap = |
10 = FILES
10 {
references {
table = tt_content
uid.field = uid
fieldName = image
}
renderObj = COA
renderObj {
10 = IMG_RESOURCE
10{
file.import.data = file:current:publicUrl
altText.field = title
titleText.field = title
stdWrap.wrap = <ul><li data-type="media" data-url="|"></li>
}
20 = IMG_RESOURCE
20{
file.import.data = file:current:publicUrl
file.maxW = 175
file.maxH = 265
altText.field = title
titleText.field = title
stdWrap.wrap = <li data-thumbnail-path="|"></li><li data-thumbnail-text=""></li><li data-info=""></li></ul>
}
}
}
}
}