User Tools

Site Tools


joomla_code_snippets

Joomla Code Snippets

You'll find the Joomla WYSIWYG editor is quite strict and won't allow even common html embed code such as iframe content like youtube videos or map or event calendar embeds.

To get around this you can use the RokCandy extension for Joomla. RokCandy allows you to create code snippets and then make a short code substitute for them that you will insert into the Joomla editor (which works in both HTML or WYSIWYG mode). These short code substitutes are called Macros in the RokCandy system.

By typing in the “macro” or shortcode into the editor, later on Joomla knows to substitute the actual content you want when the page is seen publicly by the visitor.

BTW this is written for a Joomla 2.5 install.

If the extension RokCandy is installed, in your administrator panel

  • Go to Components > RokCandy
  • You'll see any currently available snippets that have been created.

  • Click the New Button
  • You will see 2 panes.
  • On the Macro Pane, create a short code macro, see the text below for example
  • [insertyourcustomname]{insertyourcustomname}[/insertyourcustomname]
  • On the HTML side, put whatever embed code you need to call up.
  • Save the Macro. Now it's usable.
  • Now go to the article / page you want to use the macro code.
  • Once on the page wysiwyg editor, use the macro text exactly as you've named it with the brackets as shown below
  • e.g. [insertyourcustomname]{insertyourcustomname}[/insertyourcustomname]

  • Note, the bracketed text you can type it in either the wysiwyg or html mode, either place it will work
  • Save the page, publish if needed.
  • If it still doesn't display your code, check your spelling of both the bracketed text and the longer html code too, make sure it's valid.
joomla_code_snippets.txt · Last modified: by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki