Hallo zusammen
ich bin leider absoluter Fluid Newbee.
Ich habe es jetzt geschaft, mir anstatt der firstCategory bei den tx_news die kompletten Categroien ausgeben zu lassen.
<f:if condition="{newsItem.categories}">
<span class="news-list-category">
<f:for each="{newsItem.categories}" as="category" iteration="iteratorCategories">
<f:if condition="{category.shortcut}">
<f:then>
<f:link.action pageUid="{category.shortcut}" arguments="{overwriteDemand:{categories:category.uid}}">{category.title}</f:link.action>
</f:then>
<f:else>
<f:link.action arguments="{overwriteDemand:{categories:category.uid}}">{category.title}</f:link.action>
</f:else>
</f:if>
<f:if condition="{iteratorCategories.isLast}">
</f:if>
</f:for>
</span>
</f:if>
Jetzt habe ich aber das Problem, das ich genau diese Categorien in eine div class schreiben will a la:
<div class="... .... {category.title}"
Leider bekomme ich das nicht hin und auch eine 2 stündige Google und Forum Suche hat mich nicht weitergebracht.
Vielen dank im Voraus für ein Codeschnipsel oder ein Ansatz.
LG Kai
P.S: Hier mein Template list => Item.html
{namespace n=Tx_News_ViewHelpers}<!--
=====================
Partials/List/Item.html
-->
<div class="media-box-image mb-open-popup {category.title}">
<n:excludeDisplayedNews newsItem="{newsItem}" />
<!-- header -->
<f:if condition="{newsItem.falMedia}">
<!-- fal media preview element -->
<f:then>
<div class="news-img-wrap">
<f:if condition="{newsItem.falMediaPreviews}">
<f:then>
<n:link newsItem="{newsItem}" settings="{settings}">
<f:alias map="{mediaElement: newsItem.falMediaPreviews.0}">
<f:if condition="{mediaElement.originalResource.type} == 2">
<f:image src="{mediaElement.uid}" treatIdAsReference="1" title="{mediaElement.originalResource.title}" alt="{mediaElement.originalResource.alternative}" maxWidth="{settings.list.media.image.maxWidth}" maxHeight="{settings.list.media.image.maxHeight}" />
</f:if>
<f:if condition="{mediaElement.originalResource.type} == 4">
<f:render partial="Detail/FalMediaVideo" arguments="{mediaElement: mediaElement}" />
</f:if>
</f:alias>
</n:link>
</f:then>
<f:else>
<f:if condition="{settings.displayDummyIfNoMedia}">
<span class="no-media-element">
<n:link newsItem="{newsItem}" settings="{settings}">
<f:image src="{settings.list.media.dummyImage}" title="" alt="" maxWidth="{settings.list.media.image.maxWidth}" maxHeight="{settings.list.media.image.maxHeight}" />
</n:link>
</span>
</f:if>
</f:else>
</f:if>
</div>
</f:then>
<f:else>
<f:if condition="{newsItem.media}">
<!-- media preview element -->
<f:then>
<div class="news-img-wrap">
<f:if condition="{newsItem.mediaPreviews}">
<f:then>
<n:link newsItem="{newsItem}" settings="{settings}">
<f:alias map="{mediaElement: newsItem.mediaPreviews.0}">
<f:if condition="{mediaElement.type} == 0">
<f:image src="uploads/tx_news/{mediaElement.image}" title="{mediaElement.title}" alt="{mediaElement.alt}" maxWidth="{settings.list.media.image.maxWidth}" maxHeight="{settings.list.media.image.maxHeight}" />
</f:if>
<f:if condition="{mediaElement.type} == 1">
<f:render partial="Detail/MediaVideo" arguments="{mediaElement: mediaElement}" />
</f:if>
<f:if condition="{mediaElement.type} == 2">
<f:render partial="Detail/MediaHtml" arguments="{mediaElement: mediaElement}" />
</f:if>
</f:alias>
</n:link>
</f:then>
<f:else>
<f:if condition="{settings.displayDummyIfNoMedia}">
<span class="no-media-element">
<n:link newsItem="{newsItem}" settings="{settings}">
<f:image src="{settings.list.media.dummyImage}" title="" alt="" maxWidth="{settings.list.media.image.maxWidth}" maxHeight="{settings.list.media.image.maxHeight}" />
</n:link>
</span>
</f:if>
</f:else>
</f:if>
</div>
</f:then>
<f:else>
<f:if condition="{settings.displayDummyIfNoMedia}">
<f:then>
<div class="news-img-wrap">
<n:link newsItem="{newsItem}" settings="{settings}">
<span class="no-media-element">
<f:image src="{settings.list.media.dummyImage}" title="" alt="" maxWidth="{settings.list.media.image.maxWidth}" maxHeight="{settings.list.media.image.maxHeight}" />
</span>
</n:link>
</div>
</f:then>
</f:if>
</f:else>
</f:if>
</f:else>
</f:if>
<!-- teas=ser text -->
<div class="teaser-text">
<f:if condition="{newsItem.teaser}">
<f:then>
<f:format.html><f:format.crop maxCharacters="{settings.cropMaxCharacters}" respectWordBoundaries="1">{newsItem.teaser}</f:format.crop></f:format.html>
</f:then>
<f:else>
<f:format.html><f:format.crop maxCharacters="{settings.cropMaxCharacters}" respectWordBoundaries="1">{newsItem.bodytext}</f:format.crop></f:format.html>
</f:else>
</f:if>
</div>
<!-- footer information -->
<!-- date -->
<f:if condition="{newsItem.categories}">
<span class="news-list-category">
<f:for each="{newsItem.categories}" as="category" iteration="iteratorCategories">
<f:if condition="{category.shortcut}">
<f:then>
<f:link.action pageUid="{category.shortcut}" arguments="{overwriteDemand:{categories:category.uid}}">{category.title}</f:link.action>
</f:then>
<f:else>
<f:link.action arguments="{overwriteDemand:{categories:category.uid}}">{category.title}</f:link.action>
</f:else>
</f:if>
<f:if condition="{iteratorCategories.isLast}">
</f:if>
</f:for>
</span>
</f:if>
<!-- author -->
</div>
ich bin leider absoluter Fluid Newbee.
Ich habe es jetzt geschaft, mir anstatt der firstCategory bei den tx_news die kompletten Categroien ausgeben zu lassen.
<f:if condition="{newsItem.categories}">
<span class="news-list-category">
<f:for each="{newsItem.categories}" as="category" iteration="iteratorCategories">
<f:if condition="{category.shortcut}">
<f:then>
<f:link.action pageUid="{category.shortcut}" arguments="{overwriteDemand:{categories:category.uid}}">{category.title}</f:link.action>
</f:then>
<f:else>
<f:link.action arguments="{overwriteDemand:{categories:category.uid}}">{category.title}</f:link.action>
</f:else>
</f:if>
<f:if condition="{iteratorCategories.isLast}">
</f:if>
</f:for>
</span>
</f:if>
Jetzt habe ich aber das Problem, das ich genau diese Categorien in eine div class schreiben will a la:
<div class="... .... {category.title}"
Leider bekomme ich das nicht hin und auch eine 2 stündige Google und Forum Suche hat mich nicht weitergebracht.
Vielen dank im Voraus für ein Codeschnipsel oder ein Ansatz.
LG Kai
P.S: Hier mein Template list => Item.html
{namespace n=Tx_News_ViewHelpers}<!--
=====================
Partials/List/Item.html
-->
<div class="media-box-image mb-open-popup {category.title}">
<n:excludeDisplayedNews newsItem="{newsItem}" />
<!-- header -->
<f:if condition="{newsItem.falMedia}">
<!-- fal media preview element -->
<f:then>
<div class="news-img-wrap">
<f:if condition="{newsItem.falMediaPreviews}">
<f:then>
<n:link newsItem="{newsItem}" settings="{settings}">
<f:alias map="{mediaElement: newsItem.falMediaPreviews.0}">
<f:if condition="{mediaElement.originalResource.type} == 2">
<f:image src="{mediaElement.uid}" treatIdAsReference="1" title="{mediaElement.originalResource.title}" alt="{mediaElement.originalResource.alternative}" maxWidth="{settings.list.media.image.maxWidth}" maxHeight="{settings.list.media.image.maxHeight}" />
</f:if>
<f:if condition="{mediaElement.originalResource.type} == 4">
<f:render partial="Detail/FalMediaVideo" arguments="{mediaElement: mediaElement}" />
</f:if>
</f:alias>
</n:link>
</f:then>
<f:else>
<f:if condition="{settings.displayDummyIfNoMedia}">
<span class="no-media-element">
<n:link newsItem="{newsItem}" settings="{settings}">
<f:image src="{settings.list.media.dummyImage}" title="" alt="" maxWidth="{settings.list.media.image.maxWidth}" maxHeight="{settings.list.media.image.maxHeight}" />
</n:link>
</span>
</f:if>
</f:else>
</f:if>
</div>
</f:then>
<f:else>
<f:if condition="{newsItem.media}">
<!-- media preview element -->
<f:then>
<div class="news-img-wrap">
<f:if condition="{newsItem.mediaPreviews}">
<f:then>
<n:link newsItem="{newsItem}" settings="{settings}">
<f:alias map="{mediaElement: newsItem.mediaPreviews.0}">
<f:if condition="{mediaElement.type} == 0">
<f:image src="uploads/tx_news/{mediaElement.image}" title="{mediaElement.title}" alt="{mediaElement.alt}" maxWidth="{settings.list.media.image.maxWidth}" maxHeight="{settings.list.media.image.maxHeight}" />
</f:if>
<f:if condition="{mediaElement.type} == 1">
<f:render partial="Detail/MediaVideo" arguments="{mediaElement: mediaElement}" />
</f:if>
<f:if condition="{mediaElement.type} == 2">
<f:render partial="Detail/MediaHtml" arguments="{mediaElement: mediaElement}" />
</f:if>
</f:alias>
</n:link>
</f:then>
<f:else>
<f:if condition="{settings.displayDummyIfNoMedia}">
<span class="no-media-element">
<n:link newsItem="{newsItem}" settings="{settings}">
<f:image src="{settings.list.media.dummyImage}" title="" alt="" maxWidth="{settings.list.media.image.maxWidth}" maxHeight="{settings.list.media.image.maxHeight}" />
</n:link>
</span>
</f:if>
</f:else>
</f:if>
</div>
</f:then>
<f:else>
<f:if condition="{settings.displayDummyIfNoMedia}">
<f:then>
<div class="news-img-wrap">
<n:link newsItem="{newsItem}" settings="{settings}">
<span class="no-media-element">
<f:image src="{settings.list.media.dummyImage}" title="" alt="" maxWidth="{settings.list.media.image.maxWidth}" maxHeight="{settings.list.media.image.maxHeight}" />
</span>
</n:link>
</div>
</f:then>
</f:if>
</f:else>
</f:if>
</f:else>
</f:if>
<!-- teas=ser text -->
<div class="teaser-text">
<f:if condition="{newsItem.teaser}">
<f:then>
<f:format.html><f:format.crop maxCharacters="{settings.cropMaxCharacters}" respectWordBoundaries="1">{newsItem.teaser}</f:format.crop></f:format.html>
</f:then>
<f:else>
<f:format.html><f:format.crop maxCharacters="{settings.cropMaxCharacters}" respectWordBoundaries="1">{newsItem.bodytext}</f:format.crop></f:format.html>
</f:else>
</f:if>
</div>
<!-- footer information -->
<!-- date -->
<f:if condition="{newsItem.categories}">
<span class="news-list-category">
<f:for each="{newsItem.categories}" as="category" iteration="iteratorCategories">
<f:if condition="{category.shortcut}">
<f:then>
<f:link.action pageUid="{category.shortcut}" arguments="{overwriteDemand:{categories:category.uid}}">{category.title}</f:link.action>
</f:then>
<f:else>
<f:link.action arguments="{overwriteDemand:{categories:category.uid}}">{category.title}</f:link.action>
</f:else>
</f:if>
<f:if condition="{iteratorCategories.isLast}">
</f:if>
</f:for>
</span>
</f:if>
<!-- author -->
</div>
tx_news - wie bekomme ich die vorhandenen categorien in eine vorhandene
?
Aucun commentaire:
Enregistrer un commentaire