sheadawson / silverstripe-shortcodable

Provides a GUI for CMS users to insert Shortcodes into the HTMLEditorField + an API for developers to define Shortcodable DataObjects and Views.
MIT License
48 stars 36 forks source link

Insertion of shortcode is wrong #83

Closed J-Pielage closed 2 years ago

J-Pielage commented 3 years ago

When I insert a quote it adds [App\Objects\Quote id="42"] instead of [Quote type="App_Objects_Quote" id="42"][/Quote]

Shortcode method I use:


public static function ContentButtonShortCodeMethod($arguments, $content = null, $parser = null, $tagName) {
    $buttonID = strip_tags($arguments['id']);
    $button = ContentButton::get()->filter('ID', $buttonID)->first();

    if (!empty($button->ID)){
        return $button->customise([
            'ContentButtons' => $button 
    ])->renderWith('Shortcodes/ContentButtons');
    }
}