Jump to:

5540 Posts in 1738 Topics by 1224 members

Customising the CMS

SilverStripe Forums » Customising the CMS » How to call or include stuff from content

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

Page: 1
Go to End
Author Topic: 1039 Views
  • senica
    Avatar
    Community Member
    18 Posts

    How to call or include stuff from content Link to this post

    I'm trying to come from ModX over to SilverStipe, thinking there is more flexibility. There seems to be some limitations that are quite frustrating to me.

    I understand the concept of MVC, so please don't post back saying this shouldn't be allowed.

    From within the admin...let's say I am editing the Home page's content. How could I include another page directly from here. I know I can do it from within the templates, but I build pages for clients, and a large majority of clients don't need to know HTML if they are using a CMS.

    Secondly, is it possible to call something like :<% control MyLinkedImage %><a href="$URL">$Image</a><% end_control %> from the content section of the HomePage? Again using the CMS?

    I'm basically trying to find an easy way that my clients could include something or use controls that I've made for them without having to open a php or ss file.

    Thanks.

  • Willr
    Avatar
    Forum Moderator
    5503 Posts

    Re: How to call or include stuff from content Link to this post

    Hi Senica,

    I think you may want to look at creating short codes to embed functionality in the cms

    http://doc.silverstripe.org/shortcodes
    http://ssbits.com/2-4-using-short-codes-to-embed-a-youtube-video/

    You can't include <% %> tags directly in content as the template parser doesn't also parse the database fields so the best way to include tokenized functionality it to use short codes. One limitation of the shortcodes is there is no way of showing all shortcodes in the CMS for a user so I normally also include a LiteralField before the Content which lists all the available codes.

  • senica
    Avatar
    Community Member
    18 Posts

    Re: How to call or include stuff from content Link to this post

    Willr, Thanks! Yeah, this will work out nicely!

    1039 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.