but this is already in index.tpl, as this is the default template for current issue. so function should die and continue further down with index.tpl code, otherwise loads mobile/index.tpl
-- Ljuba Rankovic Senior Front End Developer, Sourcefabric ljuba.rankovic@sourcefabric.org
Posts: 1,526Member, Administrator, Sourcefabric Team
of course it could be any other file name. It doesn't matter. The main problem is die shouldn't be used in templates. In some cases it generates an errors due to die stops standard code workflow.
that is a solution but what if i have custom templates for sections and topics? It would be easier to change whole template than make this trick in every template file.
Posts: 1,526Member, Administrator, Sourcefabric Team
you can use this template switcher for home/section/article (own switcher for each type). Also this approach could be used to differentiate templates by languages or by site name (ie mobile.domain, www.domain)
Posts: 1,526Member, Administrator, Sourcefabric Team
no. The full browser specification is availably only for client side javascript. You have several options how to implement it. 1. Apply proper style after page loading via javascript (by default style could be display:none) 2. On first page loading set cookie with browser information and reload page. In this case you can use info from cookie inside template.
Post edited by Andrey Podshivalov at 2012-04-04 04:54:39