Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

How can I display the content and image of virtual page


Go to End


3 Posts   1440 Views

Avatar
Multidots

Community Member, 16 Posts

8 February 2010 at 8:23pm

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.

Avatar
Hamish

Community Member, 712 Posts

8 February 2010 at 8:53pm

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

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

Avatar
Multidots

Community Member, 16 Posts

17 February 2010 at 7:20pm

Edited: 18/02/2010 3:47am

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.