1 (edited by RomanArt 2014-02-10 14:10:09)

Topic: [Request] Shortcode plugin

Hello everyone, is it possible to create a shortcode creator plugin on monstra?
ShortCodes UI or so.
It would be popular for sure.

If you dont get my point i can explane more, just ask

(с) Roman Art
So far So good wink

RomanArt's Website

Re: [Request] Shortcode plugin

we have already blocks and snippets with UI to manage them and shortcodes to include/run them

Monstra Loves You! Give some love back!

3 (edited by RomanArt 2014-02-10 15:32:14)

Re: [Request] Shortcode plugin

i mean plugin to make shortcodes like this:

<div class="sixteen columns row"> ....... </div>

shortcode i can use in admin - pages - editor

[16] image here text here [/16]

or something like this, like i set a Html\php code by plugin and then i can use it as shortcode in pages and etc

(с) Roman Art
So far So good wink

RomanArt's Website

Re: [Request] Shortcode plugin

Okey, will think about it

Monstra Loves You! Give some love back!

Re: [Request] Shortcode plugin

RomanArt wrote:

i mean plugin to make shortcodes like this:

<div class="sixteen columns row"> ....... </div>

shortcode i can use in admin - pages - editor

[16] image here text here [/16]

or something like this, like i set a Html\php code by plugin and then i can use it as shortcode in pages and etc

+1

6 (edited by RomanArt 2014-02-22 19:12:19)

Re: [Request] Shortcode plugin

i have made one omg im so suck at this ...
Could u please fix if i made any mistakes
p\s i have not write it from the begging its spoiler plugin before.



was trying to make a plugin which gonna convert this html code:

      <div class="one_third">
        <article class="icon-box3"> <i class="icomoon-cube4"></i><br>
          <h5><strong> Web title </strong></h5>
          <p> Innovative design always develops in. </p>
        </article>
      </div>

into shortcode and also will be added in markitup editor as icon when u click on it it will call this shortcode

{iconbox title="YOUR TITLE" class="Put-icon-name-u-want-here} YOUR CONTENT FOR Icon block {/iconbox}

if no class for icon, then default icon will be "icomoon-cube4"

Then add it on page [will have a list with 400 icons for user to pick one they need(=]

{iconbox title="Web title"} Innovative design always develops in. {/iconbox}

iconbox.plugin.php code:

    Shortcode::add('iconbox', 'Iconbox::_shortcode');
    Action::add('admin_header','Iconbox::_header', 9);
    class Iconbox {
        public static function _shortcode($attributes, $content) {
            extract($attributes);
            if (isset($title)) {
                $class = (isset($class)) ? $class : 'icomoon-cube4';
                $current = (isset($show) and $show == true) ? ' current' : '';
                $html = '<div class="one_third"><article class="iconbox3"><i class="'.$class.$current.'"></i><br><h5><strong>'.$title.'</strong></h5>';
                $html.= '<p>'.Filter::apply('content', $content).'</p></article></div>';
                return $html;
            }
        }
        public static function _header() {
            if (isset(Plugin::$plugins['markitup'])) {
                echo "<script>$(document).ready(function(){mySettings.markupSet.push({name:'Iconbox', replaceWith:'{iconbox title=\"".__('Title', 'iconbox')."\"}".__('Your content', 'iconbox')."{/iconbox}', className:'iconbox-button' });});</script>";                
                echo "<style>.iconbox-button a {background-image:url(".Site::url()."plugins/iconbox/img/button.png);}</style>";
            }
        }
    }

Really need a look from professional to tell me if there is any mistakes made

(с) Roman Art
So far So good wink

RomanArt's Website