Jump to:

3444 Posts in 1030 Topics by 871 members

Template Questions

SilverStripe Forums » Template Questions » Might be a pointless question, but...

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

Page: 1
Go to End
Author Topic: 987 Views
  • Timothy McClatchey
    Avatar
    Community Member
    3 Posts

    Might be a pointless question, but... Link to this post

    I'm sorry if this is a pointless question, I don't have a lot of time ATM and scoured the documentation a bit, but couldn't find anything regarding what I'm looking for.

    Anyway, I'm curious if there is a way to import a page into a template. Not another template page, but one of the pages in the list on the backend.

    In case you need to know why, I have a client who want's to change their website to SilverStripe. They have a scrolling news ticker on their website and want to be able to change that content dynamically. I figure if this is possible, just set up a page that's hidden from view and just pull the content into the template code.

    Any help that anyone can give me would be much appreciated. Thanks!

  • honeybunny
    Avatar
    Community Member
    79 Posts

    Re: Might be a pointless question, but... Link to this post

    Could you just untick the "show in menu" box on the Behavior tab? It's not a sophisticated solution, but it would give you a live page that is hidden from the menu.

    HB

  • Timothy McClatchey
    Avatar
    Community Member
    3 Posts

    Re: Might be a pointless question, but... Link to this post

    I understand how to hide the page in the menus and whatnot. What I am looking to do is import page content dynamically into a template ss file.

  • Willr
    Avatar
    Forum Moderator
    5503 Posts

    Re: Might be a pointless question, but... Link to this post

    <% control Page(url-of-page) %>
    .. inside your url-of-page page. You can use $Content etc.
    <% end_control %>

    http://doc.silverstripe.org/sapphire/en/reference/built-in-page-controls

  • Timothy McClatchey
    Avatar
    Community Member
    3 Posts

    Re: Might be a pointless question, but... Link to this post

    Awesome. Works exactly like I wanted it to. Thanks a lot!

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