17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1746 Views |
-
New fields in content not getting added

15 November 2006 at 2:55pm Last edited: 15 November 2006 3:06pm
I've created a little 'blurb' text area for a page type, when I flush the database, it appears to create the field, but it never shows up in the back end. On another site, it's working fine, and I can't think of why it's not here.
I have:
1) added this code (below)
2) flushed database
3) assigned new page type to content itemsUPDATE: I've just pulled the code over to another page type and it works fine. Just not in the new one...
PS. Do I get a gold star for asking the most questions?
class TeamMember extends Page {
static $db = array(
"IntroductionText" => "Text",
"Blurb" => "Text",
);
}function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Content.Main", new TextareaField("IntroductionText", "Short Blurb"), "Content");
$fields->addFieldToTab("Root.Content.Main", new TextareaField("Blurb", "Blurb"), "Content");return $fields;
}class TeamMember_Controller extends Page_Controller {
}?>
-
Re: New fields in content not getting added

15 November 2006 at 3:06pm Last edited: 15 November 2006 3:07pm
If thats a direct copy of your code, you'll need to move the function getCMSFields() into the class for it to do anything
(I think its just a misplaced squigly bracket)
IE:
class TeamMember extends Page {
static $db = array(
"IntroductionText" => "Text",
"Blurb" => "Text",
);
function getCMSFields() {
$fields = parent::getCMSFields();$fields->addFieldToTab("Root.Content.Main", new TextareaField("IntroductionText", "Short Blurb"), "Content");
$fields->addFieldToTab("Root.Content.Main", new TextareaField("Blurb", "Blurb"), "Content");return $fields;
}}
We should run a competition or something for the person that discovers the most bugs :-p
-
Re: New fields in content not getting added

15 November 2006 at 3:11pm
eh, stupid }'s ;) thanks, fixed now.
Man, nothing like a little PHP to make you feel braindead.
I'm in for the bug finding, though I believe I am more of a bug creator, all things ocnsidered ;)
-
Re: New fields in content not getting added

15 November 2006 at 3:27pm
I'm sure we could create a ranking board for forum members who ask the most questions. I think you're #1 at the moment anyways. ;)
Cheers,
Sean
| 1746 Views | ||
|
Page:
1
|
Go to Top |



