[TYPO3-english] Add ID to body tag depends on DB value

Philipp Gampe typo3.lists at philippgampe.info
Thu Mar 15 17:35:29 CET 2012


Hi Stefano,

Stefano Kowalke wrote:

> Hey,
> 
> I need some help with the following topic.
> 
> I am using EXT:cag_relatedcontent [1], which allows you create custom
> tags / categories and add them to pages and content.
> 
> 
> Now I want add a body ID which depends on the category the page is in.
> 
> Page: Meals (Cat: food)
> <body id="food">
> 
> Page: Wines (Cat: liquids)
> <body id="liquids">
> 
> 
> The ext uses a mm table to make the connection between the page and the
> categories.
> 
> pages_tx_cagrelatedcontent_category_mm
> uid_local   ID of the page
> uid_foreign ID of the category
> 
> 
> I need the content of uid_foreign in depend of the current page, so I
> tried this:
> 
> temp.category = CONTENT
> temp.category {
>   table = tx_cagrelatedcontent_category
>   select {
>     selectFields = tx_cagrelatedcontent_category.uid
>     join = pages_tx_cagrelatedcontent_category_mm
>     where = tx_cagrelatedcontent_category.uid =
> pages_tx_cagrelatedcontent_category_mm.uid_foreign
>     andWhere = pages_tx_cagrelatedcontent_category_mm.uid_local =
>     {page:uid} andWhere.insertData = 1
>   }
> 
>   renderObj = COA
>   renderObj {
>     10 = TEXT
>     10 {
>       required = 1
Try dataWrap = debug:data here.

Looks good on first sign. Does this query work in phpmyadmin?

Best regards
-- 
Philipp Gampe – PGP-Key 0AD96065 – TYPO3 UG Bonn/Köln – linkvalidator



More information about the TYPO3-english mailing list