17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 846 Views |
-
Stylesheet/Menu items missing from page type

19 May 2008 at 11:57am
Hi, I posted this on the google group too.
I'm building my first Silverstripe powered website for a corporate site. I am really enjoying the ease and speed of development, but I've hit a snag: for one page subclass the generated html is missing the stylesheets in the head and menu elements in 'control Menu' template tags.
Page is called 'DocumentsGroup.php':
class DocumentsGroup extends Page {
static $db = array();
static $has_many = array(
'Documents' => 'Document'
);
function getCMSFields() {
$fields = parent::getCMSFields();
$tablefield = new HasManyComplexTableField(
$this,
'Documents',
'Document',
array(
'DocName' => 'Document Title',
'DocPublishDate' => 'Release Date'
),
'getCMSFields_forPopup'
);
$tablefield->setAddTitle( 'A Document' );
$fields->addFieldToTab( 'Root.Documents', $tablefield );
return $fields;
}
}class DocumentsGroup_controller extends Page_Controller {
function init() {
parent::init();
}
}Document is a DataObject - Document.php looks like:
class Document extends DataObject {
static $db = array(
'DocName' => 'Text',
'DocDescription' => 'Text',
'DocPublishDate' => 'Date',
);
static $has_one = array(
'MyDocumentGroup' => 'DocumentsGroup',
'DocFile' => 'File'
);
function getCMSFields_forPopup() {
$fields = new FieldSet();
$fields->push( new TextField( 'DocName', 'Document Title' ) );
$fields->push( new TextareaField( 'DocDescription', 'Description') );
$fields->push( new CalendarDateField( 'DocPublishDate', 'Release Date') );
$fields->push( new FileIFrameField( 'DocFile', 'Upload Document' ) );
return $fields;
}
}In my Page.php, I'm using the Requirements::themedCSS calls to include stylesheets. For normal 'pages' and a couple of other page subclasses I have created, this is working fine. For some reason, this particular page type is ditching the CSS and menu items.
Ie, this:
<ul>
<% control Menu(1) %>
<li class="$LinkingMode"><a href="$Link" title="Go to $Title.XML">$MenuTitle</a></li>
<% end_control %>
</ul>Just generates as
regardless of where in the sitetree the page is, or how many children/siblings/parents the node has.<ul></ul>
Any clues? Thanks in advance!
-
Re: Stylesheet/Menu items missing from page type

19 May 2008 at 12:02pm
Just a note, I tried putting this in the DocumentsGroup_Controller class
function init() {
parent::init();
}as an attempt to fix but it's not longer in the source. It didn't help.
I've also rebuilt/flushed/cleared cache etc with no change.
Thanks
-
Re: Stylesheet/Menu items missing from page type

19 May 2008 at 1:41pm
OMG, just figured it out myself... lower cap c in "DocumentsGroup_Controller". Didn't throw any errors tho - shouldn't it check that the class exists?
| 846 Views | ||
|
Page:
1
|
Go to Top |

