Typo3, How To Dynamically Change Content

- 1 answer


There is the requirement, to swap out the logo, based on a choice, the user makes on first visit. (Logo for internationals and logo for north America)

What I came up with

On fist thought this problem can be solved using a cookie. I implemented some javascript, to check and set the cookie if needed. This works fine so far but using javascript to change to logo isn´t the way to go and now I´m looking for possible solutions to this.

Some thoughts

If following the cookie approach, I´d need a way to swap out the template/partials, based on the cookie. Is there any way to do this using fluid or typoscript perhaps?
Maybe the cookie approach is the wrong way to handle this at all? Maybe this could be done (ab-)using the language selection or something like that?

Any help or ideas are appreciated.



First of all: Please use a question title that describes the problem more precise.

After setting the cookie with your javascript, you can set the logo to render in the TypoScript.

With a condition ( you can read the cookie parameter and set the logo depending on the cookie.

[request.getCookieParams()['logo'] == 'us']
lib.logoFile = pathToYourLogos/us.svg
lib.logoFile = pathToYourLogos/international.svg