set defaults per device

Status
Not open for further replies.

joit

Active Member
Hi,

I want to set the default value of a radio button with the device the user is using. This way I want to give a simple form for phones and a complex form for tablets and larger.
Is there a way to do this?

Thanks,
Hannes
 
You can do it with CSS mediaqueries.
In custom_css.php something like
Code:
@media (max-width: 767px) {
#$form .fb_el_your-element-name {display:none}
}
 
Thanks troester,

this works great for form view but it doesn't work in details view.

Any ideas?
 
Last edited:
Yup, in details view it's
.fb_el_your-element-name_ro

For CSS stuff it's best to use a browser dev tool to examine the elements and check which classes/ids/tags must be addressed (you can even test CSS settings "on the fly")
 
hmm for some reason it's not working.
neither in bootstrap nor in bootstrap_tabs template.
Would this example be correct?
#$form .fb_el_cargo___Moebel_ro {display:none}
 
As I've said: use a browser dev tool to see what you need.
Moebel is in a repeated group, so the CSS class is
fb_el_cargo_90_repeat___Moebel_ro

If you want to hide the complete group you could do
#$form #group90 {display:none}
 
Well, this element is in 2 different groups...
I inspected it with Chrome's dev tool and the CSS class is like this:
class="fabrikElementContainer plg-display fb_el_cargo___Moebel_ro span4"
so this is without the "." before fb
so I removed the dot but it also doesn't work.
This is what I put in the custom.css:
#$form .fb_el_cargo___Moebel_ro {display:none}

and I put the custom.css in
/components/com_fabrik/views/form/tmpl/bootstrap_tabs
and
/components/com_fabrik/views/form/tmpl/bootstrap

it doesn't work in either views.
any idea what could be wrong?
 
Last edited:
Did you put the CSS in
your-site/components/com_fabrik/views/details/tmpl/bootstrap_tabs/custom_css.php
and
your-site/components/com_fabrik/views/details/tmpl/bootstrap/custom_css.php
?
in bootstrap-tabs it's loading custom_css.php but only setting .fabrikDataEmpty {....}
with bootstrap there's no custom_css.php at all
 
oh god thanks a bunch!
I somehow thought details custom css goes into the same file as form custom css...
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top