[TYPO3-dev] render content or not based on user input

media.res | Alex Widschwendter a.widschwendter at mediares.at
Tue Jan 22 10:21:45 CET 2008


hi christopher,

> It's hard to give really specific advice since I don't really
> understand what you're doing, but both the conventional multilanguage
> setups, and 'printable' pages are examples of showing different
> content or changing the way it's displayed based on user input.

gernerel: i'd like to dispaly content based on ip2location service: 
http://www.ip2location.com/ip-country.aspx

first the editor select form a dropdown for which countries (user 
origin) he wants to display the CE.

based on the selection the editor made in the BE and the site visitors 
origin contents is displayed in the FE.

this works but is not as sexy as i want it.

template setup:

[userFunc = user_match(checkCHIP)]
styles.content.get.select.andWhere 
=x_mdrscontentlocalization_loc_country = "CH"
[userFunc = user_match(checkATIP)]
styles.content.get.select.andWhere = 
tx_mdrscontentlocalization_loc_country = "AT"
[userFunc = user_match(checkDEIP)]
styles.content.get.select.andWhere = 
(tx_mdrscontentlocalization_loc_country = "DE"  or 
tx_mdrscontentlocalization_loc_country = "ALL" or 
tx_mdrscontentlocalization_loc_country = "")
[end]

the function user_match(checkCHIP) for example checks if site visitors 
origin is switzerland.

problem with this approach is that it is not very generic, cause i have 
to implement a condition for every country i like to check for.

thx for tips!

cheers alex




More information about the TYPO3-dev mailing list