Jump to:

23369 Posts in 18145 Topics by 2863 members

General Questions

SilverStripe Forums » General Questions » How can I display the content and image of virtual page

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 717 Views
  • MULTIDOTS
    Avatar
    Community Member
    16 Posts

    How can I display the content and image of virtual page Link to this post

    Hi

    I am using BlogHolder page type to display list of inner BlogHolder and it's blogentry. I have applied different layout style for individual BlogHolder page type using their id. I did this using customised code in "/sapphire/core/control/ContentController.php". Now I got problem when I use virtual page, it doesn't display the content and image.

    Please help, how can I display the content and image of virtual page.

    As I know, Virtual page is link with "SiteTree" in db and Blog entry is link with "BlogEntry" in db.

  • Hamish
    Avatar
    Community Member
    712 Posts

    Re: How can I display the content and image of virtual page Link to this post

    arg... "Don't hack the core"

    Extend BlogHolder with a new page type and customise it's controller instead.

  • MULTIDOTS
    Avatar
    Community Member
    16 Posts

    Re: How can I display the content and image of virtual page Link to this post

    Yeh, thanks.

       I have extended the BlogHolder controller. As I require the page type for different layout. It looks like this :
       

       class NewPageName extends Page {
       }
       
       class NewPageName_Controller extends Page_Controller {
          // My custom function
       }

       I removed the custom code form core file.

       I have also found the solution for virtual page content.

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