Jump to content


Photo
- - - - -

Using Bootstrap Icons in Accordion Header?

bootstrap accordion

Best Answer Danny , 03 February 2013 - 01:17 PM

Hi Fintan,

 

You cant do it when using the shortcode. However, I have found a way around it, but it's a bit of a pain, what you will need to do is use the Shortcode like you have already to create your accordion and then view your page.

 

Then inspect your page, where the accordion is located and copy the entire HTML code.

Once the code has been copied, go to back to your page editor and replace the accordion shortcode with accordion HTML you have just copied.

Then go to the div called 

 

 
<div class="accordion-heading"><a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapse1"><i class="icon-home"></i> Soup &amp; Sauces →</a></div>

and add the font awesome code for your icon, see the code above, where I have already added the icon-home.

 

Repeat the process for all your accordions and then save/publish the page. Refresh your page and the icons should be added, see my image below as an example.

 

http://d.pr/i/Rzmf

Go to the full post


  • Please log in to reply
6 replies to this topic

#1 fintan

fintan

    Advanced Member

  • Members

  • 66 posts
  • LocationIreland
  • Country: Country Flag

Posted 03 February 2013 - 12:27 PM

Hi All

 

Site:

Please Login or Register to see this Hidden Content

 

I'm trying to use Bootstrap Icons in Accordion headers but I don't seem to be able to use the Bootstrap icon code (or for that matter any text style code) mixed in with the pl-accordion shortcode. I can of course change the whole style of the Accordion header in CSS but I want to differentiate the arrow color from the text color.

 

Anyone done this or have any pointers it would be much appreciated - Many thanks 

 

--

Fintan

 

 



#2 Danny

Danny

    Is Awesome!

  • Moderators
  • 15848 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 03 February 2013 - 01:17 PM   Best Answer

Hi Fintan,

 

You cant do it when using the shortcode. However, I have found a way around it, but it's a bit of a pain, what you will need to do is use the Shortcode like you have already to create your accordion and then view your page.

 

Then inspect your page, where the accordion is located and copy the entire HTML code.

Once the code has been copied, go to back to your page editor and replace the accordion shortcode with accordion HTML you have just copied.

Then go to the div called 

 

Please Login or Register to see this Hidden Content

and add the font awesome code for your icon, see the code above, where I have already added the icon-home.

 

Repeat the process for all your accordions and then save/publish the page. Refresh your page and the icons should be added, see my image below as an example.

 

Please Login or Register to see this Hidden Content


  • fintan likes this

#3 fintan

fintan

    Advanced Member

  • Members

  • 66 posts
  • LocationIreland
  • Country: Country Flag

Posted 03 February 2013 - 01:40 PM

Hi Danny

 

Very clever! Thanks for taking the time to work it out. Much appreciated.

 

--

Fintan



#4 Danny

Danny

    Is Awesome!

  • Moderators
  • 15848 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 03 February 2013 - 01:47 PM

No problem, happy to help!



#5 salestrakr

salestrakr

    Advanced Member

  • Members
  • 54 posts
  • LocationAtlanta
  • Framework Version:2.3.8
  • Country: Country Flag

Posted 04 March 2013 - 11:28 AM

Danny, instead of the accordian bar, would it be possible to place a button on the page and have that initiate the accordion down?



#6 Danny

Danny

    Is Awesome!

  • Moderators
  • 15848 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 04 March 2013 - 12:21 PM

Hi,

 

Not quite sure what you mean, therefore, would it be possible to create a new topic as this issue has been resolved and we will reply to your new topic.



#7 CliffordP

CliffordP

    Advocate

  • Members


  • 451 posts
  • LocationOklahoma
  • Country: Country Flag

Posted 17 March 2013 - 08:27 PM

Hi. I found this post when searching through the forums, and I thought my icon font shortcode plugin might come in handy: 

Please Login or Register to see this Hidden Content

(I am the seller)

If it helps, great.







Also tagged with one or more of these keywords: bootstrap, accordion