Skip to content

Instantly share code, notes, and snippets.

@cjolly
Created November 29, 2011 19:32
Show Gist options
  • Save cjolly/1406092 to your computer and use it in GitHub Desktop.
Save cjolly/1406092 to your computer and use it in GitHub Desktop.
TinyMCE Config: Allow Facebook and Google Plus Tags
<div class="social_widgets">&nbsp;<!-- Keep this nbsp; so TinyMCE doesn't consider this div empty -->
<g:plusone size="medium"></g:plusone>
<fb:like layout="button_count"></fb:like>
</div>
$('textarea.tinymce').tinymce({
valid_child : "+div[fb:like|g:plusone]",
extended_valid_elements : "fb:like[*],g:plusone[*]",
custom_elements: "fb:like,g:plusone"
});
@cjolly
Copy link
Author

cjolly commented Nov 29, 2011

Apparently you can style the resulting divs created in the WYSIWYG editor with the custom elements, too:
http://topsecretproject.finitestatemachine.com/2010/02/how-to-custom-tags-with-tinymce/

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