I am trying to include a glyphicons using this shortcode:
[glyphicons]glass[/glyphicons]
The icon is appearing but it is followed by the 5 letters of the icone name "glass".
How can I get rid of the icon name?

CommentFileSizeAuthor
#2 glass.png20.62 KBdunebl

Comments

dreamleaf’s picture

You need to add the icon name to the shortcode... so in this instance it would be:

[glyphicons name="glass"][/glyphicons] - for a standalond icon.

Where you currently have the word glass can go the content you want to prefix with an icon, as in:
[glyphicons name="glass"] I drink wine in a glass, sometimes out of the bottle too![/glyphicons]

Hope that helps!

dunebl’s picture

StatusFileSize
new20.62 KB

Many thanks for your answer... But I think I have a problem with my config because:

  1. If I use [glyphicons name="glass"][/glyphicons], nothing is appearing except an error message Notice: Undefined variable: glyphicons in bs_shortcodes_shortcode_glyphicons() (line 15 of /var/www/drupal/sites/all/modules/bootstrap_shortcodes/inc/elements/glyphicons.php).
  2. If I use [glyphicons]glass[/glyphicons], I can see the glass icon, but there is also the error message and the "glass" word => see the attached screenshot
dreamleaf’s picture

I don't know how you're actually getting the icon to display without specifying using name=""... weird.

I've just tested again and [glyphicons name="glass"] Text which should have an icon before it.[/glyphicons] works just fine, no errors.

1. The first error you're seeing is because there is no text within the shortcode - this is easily solved if you just need just the icon - simply put a space between your shortcode brackets [glyphicons name="glass"] [/glyphicons]

So basically, it's a combination of the 2 ways you've tried!

dunebl’s picture

Ok, many thanks!
You solved my problem: To have only the icon, I just have to add a space as you show me: [glyphicons name="glass"] [/glyphicons]

dunebl’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.