[SOLVED] collapse search field

2 years 7 months ago - 2 years 7 months ago #326235 by HogeRaad
[SOLVED] collapse search field was created by HogeRaad
Is there a way to collapse a search field?
for example I have 3 fields with 'Check Box (Multiple)' with more then 20 items. I want make the label clickable to show and hide al the checkboxes for each label.

I looked if i could do something with css but all examples that i found needed a input= checkbox or button to click on or html code.

html example
<details>
          <summary>Installation/Upgrade Issues</summary>
          <p>After setup the program doesn't start</p>
        </details>

Please Log in to join the conversation.

2 years 7 months ago #326239 by krileon
Replied by krileon on topic collapse search field
We provide no such functionality out of the box. You'd need to write all the necessary JS for that. You can then add the JS to profile edit and registration display triggers using CB Auto Actions and a Code action or by adding the JS to your Joomla template for it to load a custom JS file.


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.

2 years 7 months ago - 2 years 7 months ago #326278 by HogeRaad
Replied by HogeRaad on topic collapse search field
Even as a paying user you apparently get an IP block if you try to post a solution to your own question to help others.
This without proper notification so i posted i test message which a wanted to edit but when i`m going to try that i probably get also blocked on my current VPN connection.

So I have an answer which i cannot share.

Please Log in to join the conversation.

2 years 7 months ago #326283 by beat
Replied by beat on topic collapse search field
Hi,
Thanks a lot for sharing your solution, or actually attempting to share it.

Your message was unfortunately intercepted by our Web Application Firewall (which is clearly a false positive), and then after multiple trials, the temporary IP block kicked in. Both are part of the extensive security framework of our own Joomlapolis hosting keeping our servers and sites safe since almost 15 years.

I have now added the necessary exceptions for forum posts, and also unbanned the IPs that got temporarily blocked by this rule, so that you can post your solution. Please also see the reply by email.

Sorry about that "false positive".

Beat - Community Builder Team Member

Before posting on forums: Read FAQ thoroughly -- Help us spend more time coding by helping others in this forum, many thanks :)
CB links: Our membership - CBSubs - Templates - Hosting - Forge - Send me a Private Message (PM) only for private/confidential info

Please Log in to join the conversation.

2 years 7 months ago - 2 years 7 months ago #326287 by HogeRaad
Replied by HogeRaad on topic collapse search field
Thank you :)
Here is the message that i wanted to post earlier:


For other users and my own documentation the answer:

Load jquery:
<script   src="https://code.jquery.com/jquery-1.12.4.min.js"   integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ="   crossorigin="anonymous"></script>


Hide input element at load.
#cbfv_65 { display: none;}
The div id contains the input elements and is constructed with the ID of the field, 65.

$("#cblabcb_FIELDNAME__").click(function () {

  var x = document.getElementById("cbfv_65");
  if (x.style.display === "none") {
    x.style.display = "block";
  } else {
    x.style.display = "none";
  }

});
The click on function is set on the labels which is constructed with the fieldname. When clicked it will change the display status of the div (cbfv_65).

One small thing, the first time you need to click twice to unfold it.

For Gantry template users
Go to page settings:
Custom Content - the load jQuery script.
Add an atom 'Custom CSS / JS' - place here the css and javascript, check the 'Before </body>' option.
It was not possible to load the atom only on the particular pages like a module. If you want that you should make a separate template only for those pages.

Please Log in to join the conversation.

2 years 7 months ago #326297 by krileon
Replied by krileon on topic collapse search field
I suggest using CB Auto Actions to insert custom search JS. Do not load jQuery manually. Either let CB do this or Joomla do this with their respective APIs. Example as follows for loading custom jQuery on userlists.

Global
Triggers: onBeforeDisplayUsersList
Type: Code
User: Automatic
Access: Everybody
Action
Method: jQuery
Code:
JQUEREY_HERE


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.

Moderators: beatnantkrileon
Time to create page: 0.231 seconds

Facebook Twitter LinkedIn