We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Hide widgets | Forum

Topic location: Forum home » Support » General Questions
dave Leader
dave Nov 11 '19
Great :)
Marius
Marius Nov 11 '19



Hello Dave, 




I changed the language and i said it works. but not work.. I put the code in the CSS.

dave Leader
dave Nov 11 '19
Sorry i spoke before i looked at the code sadly. 


Its because your mixing php and css together and that does not work as you have it. 


Ill come up with a solution for you...   You have your own css file for the plugin correct?


Do you plan to put this code in a custom css file for your plugin or in the custom css section for the theme for personal use?



As far as i know css does not support an if statement however you can try this, or modify a @media flag to do it...


But first lets try this..


In php put  (we might change to ternary if this works)


if(isDesktop())

{

  $device = "none";

 }


if(isMobile())

{

$device = "yes"; 

}


$this->assign("device", $device);   //this passes the php variable to smarty variable of same name


Lets do the css in a html file first to make sure it works then we can try it in a css file


Then in your html file at the top


{literal}

<style type="text/css">

.ow_dnd_widget.admin-5dc732bae39bd

 {

    display: {$device};

}

</style>

{/literal}



So how this works is that the $device smarty variable will have the value of either "none" or "yes"


Remember you will have to put this code in both the desktop files and the mobile files (in the mobiile directory).







The Forum post is edited by dave Nov 11 '19
Marius
Marius Nov 19 '19


@dave



Hello,



Solved. Thank you for help  !   I moved widgets. I rearranged them.  :)

The Forum post is edited by Marius Nov 19 '19
Pages: « 1 2