Comments (2)
For Detail-view in typo3conf/ext/news/Resources/Private/Partials/Category/Items.html replace the code by this, links to show news of only one category then are included:
<!-- categories -->
<span class="news-list-category">
<f:for each="{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 pageUid="{settings.backPid}" arguments="{overwriteDemand:{categories:category.uid}}">{category.title}</f:link.action>
</f:else>
</f:if>
<f:if condition="{iteratorCategories.isLast}">
<f:then></f:then>
<f:else>,</f:else>
</f:if>
</f:for>
</span>
For list-view you can use nearly the same snippet but it's still a bit different:
<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:then></f:then>
<f:else>,</f:else>
</f:if>
</f:for>
</span>
</f:if>
from news.
I have a system category tree in Typo3:
─┬─A─┬─A1
│ └─A2
│
└─B─┬─B1
┼─B2
└─B3
I want to render the children of B tree.
On each child news item I am able to get the categories in a string on every iteration
<f:for each="{news}" as="newsItem" iteration="iterator">
<!-- render partial="List/ServiceItem" -->
<div
<f:if condition="{newsItem.categories}">
data-groups="[<f:for each="{newsItem.categories}" as="category" iteration="iteratorCategories">'{category.title}'<f:if condition="{iteratorCategories.isLast}"><f:then></f:then><f:else>,</f:else></f:if></f:for>]"
</f:if>
>{newsItem.title} & other stuff</div>
</f:for>
I am using Shuffle.js to filter the list and I need all the B - tree children to create the group control
I tried this:
<div class="news-list-category"> categories:
<f:for each="{categories}" as="category" iteration="iteratorCategories">
<f:if condition="{category.title} == 'B'">
{category.title}
<f:debug>{category.children}</f:debug>
<f:if condition="{category.children}">
children:
<f:for each="{category.children}"
as="subCategory"
iteration="iteratorSubCategories">
<span>{subCategory.title}</span>
</f:for>
</f:if>
</f:if>
</f:for>
</div>
category.children and category.item.children
returns null
if condition="{category.title} == 'B'
gets to the correct first level item
I used
typo3conf/ext/news/Resources/Private/Templates/Styles/Twb/Templates/Category/List.html
as a reference as well
Should I rather do this in typoscript and pass to fluid
<f:cObject typoscriptObjectPath="lib.myTyposSubCategoryList" />
I'll go and see if I can get Typoscript to render this but would like a fluid solution
Thanks
also in this thread:
https://stackoverflow.com/questions/51491216/typo3-list-children-of-a-specific-system-category-news-extension
from news.
Related Issues (20)
- Title from MenuProcessor not translated with TYPO3 12 HOT 2
- Extended flexform wont work in V12 HOT 8
- [DOC] Search fields - Content in relations - Foreign tables HOT 1
- Canonical in pagination on List view
- Cannot create backend records (Website User for instance) with News installed HOT 1
- excludeAlreadyDisplayedNews doesn't work with NewsListSticky-plugin and detail view on the same page. HOT 2
- Category menu and news list breaking on same page with frontend routing activated HOT 9
- PHP warning with TypoScript condition from SEO documentation
- Why that odd plugin name? Sticky article list view HOT 4
- Error 503 after Update HOT 1
- Update label
- Proxy Class Generation: extending contructor not working for tags HOT 1
- "Navigation loading error. Got unexpected response from the server. Please check logs for details." when category tree is still loading while saving
- Plugin updater in TYPO3 12 breaks flexform extensions HOT 2
- News Search Form returns 404 &cHash empty HOT 5
- Label for field tx_news_domain_model_tag.seo_text is broken
- Table printed in documentation for tags is broken HOT 2
- Cleanup: remove everything related to PaginateViewHelper
- Problem with Enabling Content-Elements of translated News-Records HOT 1
- TYPO3 12 eventnews plugin xml configuration is lost after upgrade wizard "txNewsPluginUpdater" HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from news.