[ARCHIVED] Help Center - Collapsible headers in articles (accordions) | Community
Skip to main content

[ARCHIVED] Help Center - Collapsible headers in articles (accordions)

  • September 24, 2013
  • 102 replies
  • 0 views

Show first post

102 replies

ModeratorWes

@Joe - LOL well that does happen at times.  I'm just glad that you got it all figured out.  Don't forget to make your site responsive :-)


  • June 27, 2014

Hi Wes, I added the accordions thanks to your instructions. However, the Bootstrap library seems to have overridden the looks of the {{search_bar_small}} component (made it 2,3 times taller).  Can you show me how to fix this?  If possible, please be specific as I only have rudimentary knowledge of HTML and CSS.  Thanks.


ModeratorWes

@PhilipD - Sorry about that as Bootstrap does tend to overwrite some of the Zendesk CSS when they are named the same.  Can you tell me what theme you are on so I can get the line numbers for you.  We can override the Bootstrap CSS by simply adding !important like below.

.search input[type=search] {
border-radius: 20px !important;
font-size: 18px !important;
padding: 6px 45px 6px 20px !important;
width: 450px !important;
}

Above is and example of what we will need to do and once you let me know the theme, I will post the code for you so you can fix your search bar.

 


  • June 30, 2014

Hi Wes, I am using the Humble Squid theme. Appreciate the help. Thanks.


ModeratorWes

@PhillipD - Did you include the Bootstrap CSS file along with JS file.  This tip only calls for the JS file which is this one:

<!-- Latest compiled and minified JavaScript -->
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>

 

From your description it sounds like you also added the CSS file from Bootstrap which is what causing the interference. If you want a fully responsive Help Center then keep this included and we can make a few changes but you may find other interference's along the way. Add the following to your CSS tab:

input, button, select, textarea {
line-height: normal !important;
}

Let me know if that puts your search bar back the way it was.


  • June 30, 2014

Hi Wes, it worked! Thanks a lot! However, not adding Bootstrap CSS file doesn't work so I had to do the folowing:

Include Bootstrap CSS and JS files in the "Document Head".

Add your code to maintain the CSS style in the "CSS".

Add the sample accordion code from the comments in one of the article's "source".

Note that http://bootply.com/82734 blocks users from copying the source.


ModeratorWes

@PhilipD - Glad you got it sorted out as if you are not including the Bootstrap CSS then you must use the CSS thats noted here in this article.  Now that you have included the CSS you are half way there providing a responsive theme.  There are a few other things that you may have to override as the User Info dropdown should be a little off now.  If thats the case let me know as I have the code to correct it.  In order to have a fully responsive theme you must remove the CSS for main:

/* ====================================================

Content frame

main, .header-inner {
margin: 0 auto;
padding: 0 20px;
width: 940px;
}

Then add at the top of each HTML page add "<div class="container"> and then at the very bottom close it with "</div>.  This will align everything up and make your entire site responsive.


  • June 30, 2014

Hi Wes, thanks a lot. Actually I had missed your link to the CSS in your article before and so I have just used it instead of including Bootstrap's CSS. I'd rather take the safer route, at least for now.  Thanks a lot for proactively preventing me from having further issues.


  • July 14, 2014

Question, how difficult would it be to add collapsible sections with articles underneath? Example:  http://www.opensignhelp.com/hc/en-us/categories/200026185-OpenSign-Publisher

Would implementation be similar to collapsible articles?

Sorry, I have not tried yet and am not a developer, but was able to do collapsible articles successfully based on these great instructions, and thought it would be nice to collapse articles under a sections as well.

Thanks!

 


ModeratorWes

@Brian - You may can accomplish this via one of the default themes that Zendesk have.  Just take a look and get the functionality that you want first then you can edit around the them.  Take a look at The Wiry Merchant and The Curious Wind as they have some collapsible options already in place.  If these are still not what you are looking for then just let me know as with a little re-work we should be able to get the sections to collapse instead of the categories.


  • July 14, 2014

@Wes. Thanks!  I did notice those other themes as well.  Feedback on my end was collapsible sections would be nice to have (instead of categories).  Let me get some more feedback on my end and play around a little more and I'll let you know.  Thanks for the quick reply!


  • October 11, 2014

Hi Wes

I know this article has aged a bit - however was hoping you could help me. How could add this accordion to the actual FAQ's as per this example.

http://www.emailready.com/faq

 


ModeratorWes
  • Author
  • October 12, 2014

@EmailReady - I've got code that will add accordions to articles and accordions to categories.  It looks like you might be wanting to add accordions to sections which I would have to play around with.  You could always use one of the default Zendesk themes which have drop-downs for sections.  You could easily turn those into accordions with some CSS.  Let me know if you need further help and I'll do some testing.  Also what theme are you currently using.


  • October 12, 2014

Thank for you reply I would typically want for categories.. I think could I have a copy of this and how I would use Zendesk's {} with your code please

I tried the Zendesk's version not crazy about it :)


  • December 9, 2014

Hi Wes

I am trying to add an accordion to this FAQ's page of mine. I read through this article but not sure which page I need to add this on.

http://support.emailready.com/hc/admin/appearance?return_to=%2Fhc%2Fen-us

Any help would be appreciated


ModeratorWes
  • Author
  • December 9, 2014

@EmailReady - Your Help Center is locked down so I cannot see the page you are referring to.  Would it best to create an account so that I can see as I won't be of much help if I can't see.  Is your FAQ inside of an article as this tutorial is showing you how to add accordions inside of an article.


  • April 1, 2015

@Wes

  • From your Design Panel select “Add Content” then “Article”
  • Click the html button in the article editor
  • Add the following code - http://bootply.com/82734
  • Edit the code as needed and submit your Article.

 

All I see in that link is a bunch of CSS, and that's an HTML editor. How am I suppose to paste in CSS into an HTML editor? =/


ModeratorWes

@Andrea - Thanks for the update it looks like my bootply has gone missing.  I would update my article however I can't.  If you look back on Page 1 the HTML code is listed there. :-)


  • August 11, 2015

Is there a way to create an expand all link that opens all the collapse sections? Thanks


ModeratorWes

@Rae - Sure just do the following.

Inside the article add:

<button type="button btn-default" class="btn btncollapse openall">Open All</button>

<button type="button btn-default" class="btn btncollapse closeall">Close All</button>

 

Then in the JS tab below the $(document.ready) function add:

//Open and Close all accordions
$('.closeall').click(function(){
$('.panel-collapse.in')
.collapse('hide');
});
$('.openall').click(function(){
$('.panel-collapse:not(".in")')
.collapse('show');
});

 

That should do it as long as you are using the Bootstrap framework like I mentioned above.  Let me know if you run into any issues.


  • August 11, 2015

Thanks! @Wes worked!


ModeratorWes

@Rae - Awesome :-)


  • August 14, 2015

Hi @Wes,

Another question, can we create collapsable sections within the collapsables we set, sub-collapses? As of now I'm using collapsables, and within each section, I have a huge bullet point list that is being anchored to seperate sets of documentation. I was wondering if there was a way to not create so many anchors and possibly have sub-collapsables. I hope that makes sense. 


ModeratorWes

@Rae - Almost everything is possible with some Javascript/JQuery.  I'm not sure when I will get some free time but if I do I'll try and play around with it.  Take a look at some of the other themes as sometimes you can still the code from there if they are doing that function.


ModeratorWes

@Rae - Almost everything is possible with some Javascript/JQuery.  I'm not sure when I will get some free time but if I do I'll try and play around with it.  Take a look at some of the other themes as sometimes you can still the code from there if they are doing that function.