I spent hours on this problem. I wanted to access the selected categories of my page in TYPO3 Fluid, but there is no default way to do that.
TYPO3 Fluid: How to get selected page categories in fluid
21 Views Asked by rcheetah At
1
There are 1 best solutions below
Related Questions in TYPO3
- TYPO3 Fluid: How to get selected page categories in fluid
- There is no entry in the $TCA array for the table "index_stat_word". TYPO3, v.11.5. Indexed search
- TYPO3 Flexform reset after change
- Get data from database and pass it to the template in TYPO3 11.5
- How to troubleshoot and resolve a Typo3 503 Error?
- TYPO3: tx-form custom fluid templates and class for submit button
- Autogenerate link title based on URL/target for accessibility
- TYPO3 fluid viewhelper f:security.nonce doesn't generate nonce
- DCE (Dynamic Content Element) access tab for each field within a section
- Typo3 - Frontend 404 after Server Migration (also an URL Change)
- After composer dumpautoload show InstalledVersions" not found
- typoscriptObjectPath throws error in Powermail 12
- Get all categories from a page into a data attribute in typoscript
- TYPO3 v11: upgrade to PHP8 breaks the page completely
- How to implement Connector Services (svconnector) in TYPO3 12?
Related Questions in TYPOSCRIPT
- TYPO3 Fluid: How to get selected page categories in fluid
- Get all categories from a page into a data attribute in typoscript
- My page doesn't recognize my Extbase plugin Controller
- How do I get current FE language in where clause in DatabaseQueryProcessor in TYPO3?
- TYPO3 Oops, an error occurred! Code: 202402180809040864ba5c
- TYPO3 v12.4 How do I change the entryLevel in HMENU if the currenty level has no items?
- How to use tt_content.uid when outputting a field with inline type in TypoScript Typo3-11.5?
- TYPO3 12 News backlink to list view section
- Typo3 page doesn't show up at front end. Error 500 - No TypoScript record found
- Limited localisation/multilingualism in TYPO3
- TYPO3: get and display all file categories in fluid
- Usage of cObject EXTBASEPLUGIN without caching (USER_INT)
- Meta tag with dot in key is not recognized
- TYPO3 ext:form multisite multilingual, like to have the site name in the subject line
- For some reason typoscript is not creating symlink to my Public folder
Related Questions in FLUID
- Cannot center a fluid image in a fluid Div
- How to get TYPO3 settings in the utility files?
- How to assign variable in fluid?
- Fluid scaling webpage not scaling as expected on Mobile
- Is fluid design as important as responsive design?
- typo3 - image - objectStorage - FAL - Fluid
- how to render a unix timestamp and links in typo3 4.5 backend module fluid template?
- TYPO3 Femanager Passwort additionalAttributes
- "Could not analyse class: maybe not loaded or no autoloader?"
- ValveLinear Model Modelica Standard Library - Working Principle
- TYPO3: dropdown login box (menu)
- TYPO3 DCE (Fluid): How to generate an SVG Object instead of an image tag?
- What is the best usage of TypoScript in Fluid templates?
- Fluid inline version of f:cObject with array in data
- Disabling file compression in TYPO3 'be:container'
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
There is no default way of doing this. You need to query the database and join tables yourself. Thanks for nothing Typo3 – nobody could have expected, that developers would actually want to access the selected categories in their templates. (╯°□°)╯︵ ┻━┻
In the setup Typoscript in the Fluidtemplate, add a DatabaseQueryProcessor:
This snippet creates a variable called
pageCategories, which is an array of all selected categories for the current page. You can the access the title e. g. bypageCategories.0.data.titleor loop over it in fluid:To be honest, I don’t understand the query syntax myself, but this is a working solution. There were just a few google results for this problem, and they either didn't work in my case, of where just never answered, so I wanted to share my solution.
Credits go to t3brightside who maintains the pagelist extension from which this code snippet was ~~inspired~~ (stolen).