Jump to content


Photo
Icon Font Shortcode

Trying to create modal button with Font Awesome



Best Answer CliffordP , 01 April 2013 - 10:40 PM

The workaround is this:

 
[pl_modal title="Request Appointment" type="btn" colortype="info" label="<i class='icon-calendar'></i> Request Appointment "]
[gravityform id="1" name="Appointment Request" title="false"]
[/pl_modal]

Notes about the code above:

-goes in HTML (not Visual) Editor (not applicable if in a widget)

-doesn't use the shortcode

-uses single quotes for < i class =  ... because you don't want to accidentally close the label's double-quote just yet

Go to the full post


  • Please log in to reply
6 replies to this topic

#1 webmktco

webmktco

    Super Member

  • Members

  • 202 posts
  • Country: Country Flag

Posted 01 April 2013 - 10:00 PM

Delete



#2 CliffordP

CliffordP

    Advocate

  • Members


  • 494 posts
  • LocationOklahoma
  • Country: Country Flag

Posted 01 April 2013 - 10:03 PM

Can you paste your entire code? I don't see any [ i ] or [ / i ] in what you pasted.



#3 webmktco

webmktco

    Super Member

  • Members

  • 202 posts
  • Country: Country Flag

Posted 01 April 2013 - 10:22 PM

Here's the code in the widget:

 

 
[pl_modal title="Request Appointment" type="btn" colortype="info" label="[i]icon-calendar[/i] Request Appointment "]
[gravityform id="1" name="Appointment Request" title="false"]
[/pl_modal]


#4 CliffordP

CliffordP

    Advocate

  • Members


  • 494 posts
  • LocationOklahoma
  • Country: Country Flag

Posted 01 April 2013 - 10:40 PM   Best Answer

The workaround is this:

 
[pl_modal title="Request Appointment" type="btn" colortype="info" label="<i class='icon-calendar'></i> Request Appointment "]
[gravityform id="1" name="Appointment Request" title="false"]
[/pl_modal]

Notes about the code above:

-goes in HTML (not Visual) Editor (not applicable if in a widget)

-doesn't use the shortcode

-uses single quotes for < i class =  ... because you don't want to accidentally close the label's double-quote just yet



#5 CliffordP

CliffordP

    Advocate

  • Members


  • 494 posts
  • LocationOklahoma
  • Country: Country Flag

Posted 01 April 2013 - 11:57 PM

Actually, this is the issue: http://codex.wordpre...Square_Brackets

 

The shortcode parser does not accept square brackets within attributes. Thus the following will fail:

 
[tag attribute="[Some value]"]

 

 

As such, there's nothing I can do code-wise to "fix" it. It's a WordPress limitation.

 

You could put the icon font shortcode next to the gravity form shortcode, but not where you were wanting to, since that's the way the pl_modal shortcode attributes are setup.

 

 

Let me know if this answers your question and if you need help with any non-shortcode version of using icon fonts.

 

Thanks for your purchase.



#6 webmktco

webmktco

    Super Member

  • Members

  • 202 posts
  • Country: Country Flag

Posted 02 April 2013 - 01:11 AM

Hey Cliff-

 

Thanks for your quick responses and support.  I think I got it.


  • CliffordP likes this

#7 CliffordP

CliffordP

    Advocate

  • Members


  • 494 posts
  • LocationOklahoma
  • Country: Country Flag

Posted 02 April 2013 - 03:30 AM

You're welcome.







Also tagged with one or more of these keywords: Icon Font Shortcode