Jump to:

3448 Posts in 1062 Topics by 738 members

Data Model Questions

SilverStripe Forums » Data Model Questions » shortcode problem

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 647 Views
  • snaip
    Avatar
    Community Member
    180 Posts

    shortcode problem Link to this post

    hi

    i'm tring to make shortcode

    by the tutorial http://www.ssbits.com/tutorials/2010/2-4-using-short-codes-to-embed-a-youtube-video/ and some posts in forum i made this

    _config.php

    ShortcodeParser::get('default')->register('ListaKategorii',array('StaticPage','ListaKategoriiShortCode'));

    StaticPage.php

    class StaticPage extends SiteTree {

    function ListaKategoriiShortCode() {
    return $this->renderWith('ListaKategorii');
    }

    }

    class StaticPage_Controller extends DB_Controller {
    }

    ListaKategorii.ss (in Includes folder)

    some Lorem Ipsum text

    now putting in tinyMCE text [listaKategorii] but it doesn't work

  • snaip
    Avatar
    Community Member
    180 Posts

    Re: shortcode problem Link to this post

    [solved]

    change ListaKategoriiShortCode() function to this

    public function ListaKategoriiShortCode() {
    $template = new SSViewer('ListaKategorii');
    return $template->process();
    }

    647 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.