Skip to Content Skip to Menu

🌟 CB Editor Assistant 1.0.0 is here! Discover our new AI Joomla Plugin that wrote its story! (and this banner!)
Start at just $12.50/month* or 💸 save 30% with our 🛍️ Intro Black Friday Offer for a lifetime*

[SOLVED] Hide custom field in admin

  • agaudin
  • agaudin
  • OFFLINE
  • Posts: 83
  • Thanks: 16
  • Karma: 3
5 years 6 months ago - 5 years 6 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
Code:
.hide_css{ display : none; }
and then
Code:
.cbRegistration.hide_css{ display : block !important; }

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

Best regards.

Antoine
Last edit: 5 years 6 months ago by krileon. Reason: Added [SOLVED] tag to subject

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48554
  • Thanks: 8292
  • Karma: 1445
5 years 6 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.

Code:
[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 or Create an account to join the conversation.

  • agaudin
  • agaudin
  • OFFLINE
  • Posts: 83
  • Thanks: 16
  • Karma: 3
5 years 6 months ago - 5 years 6 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.

Code:
[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
Last edit: 5 years 6 months ago by agaudin.
The following user(s) said Thank You: krileon

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum