Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Smarty and responsive behaviors

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
Odin
Smarty Rookie


Joined: 07 Mar 2013
Posts: 8

PostPosted: Sat May 02, 2015 7:59 pm    Post subject: Smarty and responsive behaviors Reply with quote

Hi,
I have a Smarty template which is responsive and I would like to hide/show some elements of the template on mobile or desktop - pretty common thing but... I don't want to just use display: none because it will be loaded/visible in source anyway so I would like to use smarty and {if}.

My question is, does Smarty have some solution for checking device resolution or window size? I think NO but maybe I'm wrong...

If answer is no, is it possible to use {if} to check if div with id have some specific class? I would be able to use javascript to check window.size and add class to div with specific id, for example:

Code:

<div id="device" class="desktop" ></div>


and than use Smarty:

Code:

{if #device class = desktop}
<div>Content visible only for desktop user!</div>
{/if}


That would be awesome. Thank you
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Sat May 02, 2015 9:38 pm    Post subject: Reply with quote

Do you know the difference between server and client scripting?
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP