Shortcodes:Formatting
e107 Wiki: English | Русский | Deutsch | Français | Magyar | Português | Български | Česky | Nederlands | Ελληνικά | Italiano | Norske | Polska | Slovenščina | Español | Svenska | Translate: Wiki | Page
Formatting ShortcodesYou may find the need to add formatting around a shortcode depending on the shortcode content. This is now possible with the ExampleFor example, you may want to show a user avatar inside a DIV. If the user does not have an avatar configured, you don't even want the DIV to appear. In your
When the shortcode engine renders the Template ShortcodingFor templates such as the content management and forum plugins you may wish to add shortcodes to a shortcode.php file. In these instances you will have to declare the shortcodes as a Global Variable within the shortcode.php file to use formatting. Template Shortcoding ExampleSuppose you want to add a simple shortcode to the content management application that returns an integer ID of the content parent category within the content_content template. This is a silly example because the shortcode will always return a value, but it nonetheless illustrates the formatting. In
You should now be able to add formatting to {CONTENT_PARENT_ID} in your template. | ||||||||||||