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.

Themes /

Discuss SilverStripe Themes.

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

Problem with subtemplate


Go to End


2 Posts   1597 Views

Avatar
StarForce

Community Member, 11 Posts

18 May 2010 at 5:44am

Hey
I´m trying to display my Spielbericht Class with a subtemplate, but have some problems with it...

My Spielbericht class file mysite/code/Spielbericht.php

<?php
class SpielberichtPage extends Page {

	public static $db = array(
	);

	public static $has_one = array(
	);

}
class SpielberichtPage_Controller extends Page_Controller {

	function AnzeigenSpielbericht(){
		$game = new DetailedGame();
		$game->GetByID('2664664');
		return $game->DisplayTableHTML();
	}
}

I´ve also created a Spielbericht.ss file:
themes/djkwallstadt/templates/Layout/Spielbericht.ss (yes, i use a custom template)

<div class="typography" id="mainContent">
	$Content
	$AnzeigenSpielbericht
	$Form
	$PageComments
</div>

when i load the page, it is not working, but when i add $AnzeigenSpielbericht to the Page.ss, everything works fine (so there is no problem with the function)

Can you help me?
I use the 2.4 release

Thank you :)

StarForce

Avatar
StarForce

Community Member, 11 Posts

18 May 2010 at 5:52am

argh.... found the problem

should be SpielberichtPage.ss and not Spielbericht.ss

*sry*