[TYPO3-templavoila] switch/change template based on screen resolution

Jonas Dübi admin at commandline.ch
Thu Sep 7 09:47:12 CEST 2006

Hi Felix

Felix Natter schrieb:
> previously I have used "modern template building" with cc_screenres to
> change a template's widths/heights (with markers like
> width=###MAINTABLE_WIDTH### in the HTML) based on the screen resolution
> (800x600 or 1024x768).
> Now I switched to tv and I am wondering what would be the best way
> to do this? I'd be happy with either:
> - switching the TO based on resolution (2 resolutions are enough)
> - modify the TO based on resolution (change widths/heights in the HTML)

Personaly I wouldn't use inline styles or HTML attributes like "width" 
within the template, because you can do everything with CSS much easier 
and cleaner.

I would suggest:

1. Make two CSS stylesheets, one for 800x600 and one for 1024x768.
2. Select the stylsheets based on the screen resolution.

If you set the stylesheets by TypoScript within the PAGE object it 
should be possible to switch them with cc_screenres (I didn't use the 
extension yet).

Otherwise you can identify the resolution by javascript and switch the 
stylesheets directly with js. This way you don't need to change anything 
within TYPO3 and it's much easier to solve...

This way you don't need to change anything on templavoila, which is much 
more work.

Greetings from switzerland

More information about the TYPO3-project-templavoila mailing list