ホーム
>>
RSSセンター
>>
Shortcodes are coming to XOOPS 2.6.0 :D
RSSセンター
メイン | 簡易ヘッドライン |
Shortcodes are coming to XOOPS 2.6.0 :D (2015/11/1 19:50:00)
Richard continues to doing amazing changes to XOOPS 2.6.0. The latest addition are "Shortcodes", which are probably best known from WordPress. I was actually
hoping for it for a long, long time, and I was very happy to see that Richard has added it to XOOPS! YES!!!
It was possible thanks to refactoring of our old TextSanitizer. You can read more details from Richard's info on GitHub
Quote:
What does it mean for XOOPS developers? We'll be able now to simplify a lot of activities around designing the best looking Websites for our users and customers!
Also our users will be able to add tons of cool features without any programming!
For those of you who never worked with ShortCodes, let's provide a short overview and a little tutorial. The basic classes that we'll be using, are the TextSanitizer classes refactored by Richard:
Currently we have following classes derived from FilterAbstract :
- Censor
- Clickable
- Quote
- SyntaxHighlight
- TextFilter
- Xss
and following classes derived from ExtensionAbstract :
- Flash
- Iframe
- Image
- Mms
- Mp3
- Rtsp
- SoundCloud
- UnorderedList
- Wiki
- Wmp
- XoopsCode
- YouTube
For our purposes we'll be using mainly the ExtensionAbstract class. Let's see now how can we use it to create ShortCodes for Google Charts and Google Maps ( Read more-- > )
It was possible thanks to refactoring of our old TextSanitizer. You can read more details from Richard's info on GitHub
Quote:
MyTextSanitizer has become Xoops\Core\Text\Sanitizer.
Highlights:
- Single unified configuration file
xoops_data / configs / system_sanitizer_prefs . yml
- Extensions (i.e. YouTube) are now a SanitizerComponent, a base class that also includes Filters (i.e. Xss)
- Each SanitizerComponent auto-configures, and configuration is automatically updated with new additions
- Custom components can be added via response to core.sanitizer.configuration.defaults event
- ShortCodes (WordPress style) are now the basis of XoopsCode and extensions
- Custom ShortCodes can be added via response to
event, or by directly accessing the ShortCodes engine withcore . sanitizer . shortcodes . add
Sanitizer :: getShortCodes ()
- All built-in components and shortcodes can be overridden with same named custom replacements
- Some extensions have updated syntax. For example:
[ youtube = 640 , 385 ] https : //www.youtube.com/watch?v=JxS5E-kZc2s[/youtube]
can now be:
[ youtube url = "JxS5E-kZc2s" width = "640" height = "385" /]
(It also can use virtually any known YouTube URL as the url attribute.)
- Another example is SoundCloud, which now can directly support the "Wordpress code" option offered in the Share/Embed dialog on soundcloud.com.
The old styles are still accepted for compatibility with existing content, and not all extensions have conversions to new styles, yet. There is more work to be done, but the backing code is now in place.
What does it mean for XOOPS developers? We'll be able now to simplify a lot of activities around designing the best looking Websites for our users and customers!
Also our users will be able to add tons of cool features without any programming!
For those of you who never worked with ShortCodes, let's provide a short overview and a little tutorial. The basic classes that we'll be using, are the TextSanitizer classes refactored by Richard:
Currently we have following classes derived from FilterAbstract :
- Censor
- Clickable
- Quote
- SyntaxHighlight
- TextFilter
- Xss
and following classes derived from ExtensionAbstract :
- Flash
- Iframe
- Image
- Mms
- Mp3
- Rtsp
- SoundCloud
- UnorderedList
- Wiki
- Wmp
- XoopsCode
- YouTube
For our purposes we'll be using mainly the ExtensionAbstract class. Let's see now how can we use it to create ShortCodes for Google Charts and Google Maps ( Read more-- > )
execution time : 0.035 sec