TYPO3 news -> category menu -> get information on listview

149 Views Asked by At

I´m using the categegory menu of Georg Ringers "news". When I click on a category, it leads me to the listview, showing all articles with the chosen catecory. That works fine.

But:

  • Is there a way to get the information in the listview, which category I´ve clicked? I.e. to write it as a headline.
  • Is it possbile to write the chosen category in the breadcrumb navigation?

Thanks! Chris

I used f:debug to have a look what inforamtions I can get on the listview, but only get information about the listed articles. They can have multiple categories, so not usefull in my case. The URl of the listview shows the chosen category, so the information is there, but I don´t know how to access it.

2

There are 2 best solutions below

0
Anu Bhuvanendran Nair On

The link posted by @Julian is indeed a great start. Here is an example from the author himself based on typoScript for the purpose of news in breadcrumb.

With the category read using a dataprocessor can be passed in here this could be helpful.

https://docs.typo3.org/p/georgringer/news/main/en-us/Tutorials/BestPractice/BreadcrumbMenu.html

Alternatively, this typoScript snippet should help too. I didn't tested it though.

lib.navigation_breadcrumb {
    10 = HMENU
    ### general breadcrumb settings

    ### This could check the url for a selected category and look up in the sys_category table
    20 = RECORDS
    20 {
        stdWrap.if.isTrue.data = GP:<url_parameter_for_category>
        dontCheckPid = 1
        tables = <table_name>
        source.data = GP:<url_parameter_for_category>
        source.intval = 1
        conf.<table_name> = TEXT
        conf.<table_name> {
            field = <field_of_category_title>
            htmlSpecialChars = 1
        }
     stdWrap.wrap = <li>|</li>
     stdWrap.required = 1
    }
}
0
t3fan On

Here is the filled out example from Anu Bhuvanendran Nair

20 = RECORDS
20 {
        stdWrap.if.isTrue.data = GP:tx_news_pi1|overwriteDemand|categories
        dontCheckPid = 1
        tables = sys_category
        source.data = GP:tx_news_pi1|overwriteDemand|categories
        source.intval = 1
        conf.sys_category = TEXT
        conf.sys_category {
            field = title
            htmlSpecialChars = 1
        }
     stdWrap.wrap = <li class="breadcrumb-item">|</li>
     stdWrap.required = 1
}