mirror of
https://github.com/e107inc/e107.git
synced 2025-08-08 07:36:32 +02:00
Updated Preparing your v1.x plugins for v2.x (markdown)
@@ -33,11 +33,6 @@ eg. If your file is called **myplugin_template.php** , within this file you migh
|
|||||||
|
|
||||||
#### Shortcode Wrappers.
|
#### Shortcode Wrappers.
|
||||||
|
|
||||||
In v1.x you might create a wrapper around a shortcode (only when there is data returned) using the following code in your template:
|
|
||||||
|
|
||||||
$sc_style['CONTACT_PERSON']['pre'] = "<small>".LANCONTACT_14."</small><div>";
|
|
||||||
$sc_style['CONTACT_PERSON']['post'] = "</div>";
|
|
||||||
|
|
||||||
In v2.x there are two methods to add wrappers around your shortcodes.
|
In v2.x there are two methods to add wrappers around your shortcodes.
|
||||||
The way to declare them differs slightly from v1 in that we use a kind of 'shortcode-wildcard' `{---}`.
|
The way to declare them differs slightly from v1 in that we use a kind of 'shortcode-wildcard' `{---}`.
|
||||||
|
|
||||||
@@ -46,11 +41,16 @@ The way to declare them differs slightly from v1 in that we use a kind of 'short
|
|||||||
A global shortcode wrapper. ie for shortcodes which are available site-wide. (for example those registered globally for use in menus or found in e107_core/shortcodes/single/)
|
A global shortcode wrapper. ie for shortcodes which are available site-wide. (for example those registered globally for use in menus or found in e107_core/shortcodes/single/)
|
||||||
example:
|
example:
|
||||||
|
|
||||||
|
// v1.x way of doing it.
|
||||||
|
$sc_style['CONTACT_PERSON']['pre'] = "<small>".LANCONTACT_14."</small><div>";
|
||||||
|
$sc_style['CONTACT_PERSON']['post'] = "</div>";
|
||||||
|
|
||||||
|
// v2.x way of doing it.
|
||||||
$SC_WRAPPER['CONTACT_PERSON']= "<small>".LANCONTACT_14."</small><div>{---}</div>";
|
$SC_WRAPPER['CONTACT_PERSON']= "<small>".LANCONTACT_14."</small><div>{---}</div>";
|
||||||
|
|
||||||
##### Template-Specific Shortcodes
|
##### Template-Specific Shortcodes
|
||||||
|
|
||||||
A template-specific shortcode wrapper. ie. as used on a single page of your site.
|
v2.x introduces a template-specific shortcode wrapper. ie. as used on a single page of your site.
|
||||||
example:
|
example:
|
||||||
|
|
||||||
$CONTACT_WRAPPER['form']['CONTACT_PERSON'] = "<small>".LANCONTACT_14."</small><div>{---}</div>";
|
$CONTACT_WRAPPER['form']['CONTACT_PERSON'] = "<small>".LANCONTACT_14."</small><div>{---}</div>";
|
||||||
|
Reference in New Issue
Block a user