Skip to content

Instantly share code, notes, and snippets.

@helios-ag
Created February 24, 2015 02:23
Show Gist options
  • Save helios-ag/614ad58ea1619d22581c to your computer and use it in GitHub Desktop.
Save helios-ag/614ad58ea1619d22581c to your computer and use it in GitHub Desktop.
Custom emoticons
fm_bbcode:
filter_sets:
my_default_filter:
strict: false # if you want to parse attr values without quotes
locale: en
xhtml: false
filters: [ default, block, code, email, image, list, url ]
hooks: [emoticon]
emoticon:
resource: %kernel.root_dir%/config/emoticons.yml
###
emoticons:
my_custom_smile:
smilies:
- ":my_custom_smile:"
### place my_custom_smile.png under web/emoticons folder
@helios-ag
Copy link
Author

Yes, emoticons node should be in emoticons.yml file under config dir
the full configuration for emoticons is

emoticons:
  my_custom_smile:
    url:   %fm_bbcode.emoticon.path%/my_custom_smile.png
    html:  <img src="%fm_bbcode.emoticon.path%/my_custom_smile.png" alt="" >
    xHtml: <img src="%fm_bbcode.emoticon.path%/my_custom_smile.png" alt="" />
    smilies:
      - ":my_custom_smile:"

You can change configuration with configuration above or u can change extension

fm_bbcode:
  filter_sets:
    my_default_filter:
      strict: false # if you want to parse attr values without quotes
      locale: en
      xhtml: false
      filters: [ default, block, code, email, image, list, url ]
      hooks: [emoticon]
  emoticon:
    resource: %kernel.root_dir%/config/emoticons.yml
    extension: gif << default is png

@henryvoorburg
Copy link

Is it a known problem that some smilies like ">:)", ":@" and "(8>" won't work? I can't get ":'(" working at all. Can you? (@symfony 2.6.4)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment