Project

General

Profile

Actions

Bug #44961

closed

Categorization in core is not usable in frontend

Added by Marc Bastian Heinrichs almost 12 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Content Rendering
Target version:
Start date:
2013-01-30
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.0
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Besides the common use case to be able to categorize records, it should also be possible to render the categories of a record in frontend.
The basic API in TYPO3 for this use case is the CONTENT object in TypoScript. ("This object is designed to generate content by making it possible to finely select records and rendering them.")

But naming the category table sys_category this is not possible, because a prefix sys_ is not allowed for CONTENT.

e.g. the following would not work to render the categories of pages

page.20 = CONTENT
page.20 {
    table = sys_category
    select {
        pidInList = XYZ
        join = sys_category_record_mm ON sys_category.uid = sys_category_record_mm.uid_local
        where = tablenames = 'pages'
        andWhere = sys_category_record_mm.uid_foreign = {TSFE:page|uid}
        andWhere.insertData = 1
    }
    renderObj = COA
    renderObj {
        10 = TEXT
        10.field = title
        10.wrap = |,
    }
}

Having a userFunc in core for this is IMO not the right way.

Using a query to pages with a join is also only a annoying workaround.


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Feature #38711: Categorization into the CoreClosed2012-07-06

Actions
Related to TYPO3 Core - Feature #38773: Add Category CollectionClosedFabien Udriot2012-07-09

Actions
Actions #1

Updated by Marc Bastian Heinrichs almost 12 years ago

If anybody needs the workaround:

page.20 = CONTENT
page.20 {
    table = pages
    select {
        uidInList = this
        pidInList = 0
        selectFields = sys_category.*
        join = sys_category_record_mm ON pages.uid = sys_category_record_mm.uid_foreign JOIN sys_category ON sys_category.uid = sys_category_record_mm.uid_local
        where = sys_category_record_mm.tablenames = 'pages' AND sys_category.pid = XYZ
    }
    renderObj = COA
    renderObj {
        10 = TEXT
        10.field = title
        10.wrap = |,
    }
}

Actions #2

Updated by Ingo Renner almost 12 years ago

I think an exception (whitelist) for sys_category would be ok.

Actions #3

Updated by Marc Bastian Heinrichs about 11 years ago

  • Target version set to 6.2.0
  • Is Regression set to No

Solutions:

a) whitelist sys_category
b) rename table sys_category (with migration wizard)
c) remove the check for "pages,tt,fe,tx,ttx,user,static" complete - following core tables could be rendered then:

  • backend_layouts
  • be_*
  • ct_*
  • sys_*
  • zzz_deleted
Actions #4

Updated by Gerrit Code Review about 11 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/25316

Actions #5

Updated by Gerrit Code Review about 11 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/25316

Actions #6

Updated by Marc Bastian Heinrichs about 11 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #7

Updated by Riccardo De Contardi about 7 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF