[SOLVED] Hide custom field in admin

4 years 11 months ago - 4 years 11 months ago #312450 by agaudin
[SOLVED] Hide custom field in admin was created by agaudin
Hi !

I'm using "custom htlm fields" to give warnings or comments before classical form field i.e. checkboxes and so. To avoid too much big panels in admin view, I would like to hide theses fields in backend but not in frontend.

A long time ago, I managed to do opposite on some situations based on custom css, but I cannot redo it. I tried something like that
- add a custom "hide_css" class on html fields
- add css rules in template, like
.hide_css{
display : none;
}
and then
.cbRegistration.hide_css{
display : block !important;
}

Unfortunately, it didn't work. Can you imagine any way ?

Best regards.

Antoine

Please Log in to join the conversation.

4 years 11 months ago #312458 by krileon
Replied by krileon on topic Hide custom field in admin
Template CSS overrides do not load in backend. If you're adding custom CSS to backend by other means then use the namespaced CSS class cbAdminMain to specifically target backend CB (e.g. .cbAdminMain .hide_css).

If you're outputting a message in a Custom HTML field you could surround it in an IF substitution to condition it to not show in backend. Example as follows.

[cb:if application_context="frontend"]Frontend Only[/cb:if]
[cb:if application_context="administrator"]Backend Only[/cb:if]

The above usage is noted in the below substitution tutorial.

www.joomlapolis.com/documentation/279-community-builder/tutorials/18353-using-substitutions-throughout-cb


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

4 years 11 months ago - 4 years 11 months ago #312466 by agaudin
Replied by agaudin on topic Hide custom field in admin [SOLVED]

krileon wrote: Template CSS overrides do not load in backend. If you're adding custom CSS to backend by other means then use the namespaced CSS class cbAdminMain to specifically target backend CB (e.g. .cbAdminMain .hide_css).


I am so disappointed by myself - I should have thought about that !! :-(
Anyway :

krileon wrote: If you're outputting a message in a Custom HTML field you could surround it in an IF substitution to condition it to not show in backend. Example as follows.

[cb:if application_context="frontend"]Frontend Only[/cb:if]
[cb:if application_context="administrator"]Backend Only[/cb:if]
The above usage is noted in the below substitution tutorial.
www.joomlapolis.com/documentation/279-community-builder/tutorials/18353-using-substitutions-throughout-cb


worked fine as a charm, as usual with your support.
Thanks a lot !
Have a nice week-end.

Antoine
The following user(s) said Thank You: krileon

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.217 seconds

Facebook Twitter LinkedIn