21492 Posts in 5783 Topics by 2621 members
General Questions
SilverStripe Forums » General Questions » sitetree pages, sometimes loose meta-title and description fields
General questions about getting started with SilverStripe that don't fit in any of the categories above.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 680 Views |
-
sitetree pages, sometimes loose meta-title and description fields

18 February 2011 at 12:15pm
I am noticing that sometimes in the cms that my pages will loose a couple fields from the Content/Metadata tab.
The fields that go missing are the title and description fields.
The last case of this (just happened) occurred after selecting another page in the left pane and duplicating it.
This is now the second time I have had this occur, the first I edited the title direct in the database..
I would rather not have to continue this way, so I am hoping that someone has come across this before?? -
Re: sitetree pages, sometimes loose meta-title and description fields

18 February 2011 at 12:17pm
OK, just tried adding a new page and still the fields are gone...
will have a look to see if I removed the fields in code somehow... can't imagine do that though. -
Re: sitetree pages, sometimes loose meta-title and description fields

9 March 2011 at 2:43am
Hi,
I have the same problem here. Im curious what have you found to solve this problem. Thanks!
john
-
Re: sitetree pages, sometimes loose meta-title and description fields

9 March 2011 at 8:28pm
Hi,
I just managed to fix this problem. this happens when you have conflict in your field names. For example you have a field named "Description" under Root.Content.Metadata and another "Description" in Root.Content.Whatever.
Hope this helps
-
Re: sitetree pages, sometimes loose meta-title and description fields

31 August 2011 at 6:09am
Also watch how you define custom Getters. If you create a custom getter method for a field, and follow the pattern suggested in the tutorials, you might end up with these issues because _the CMS also ends up calling them_ to load its values.
A better approach would be to create custom getters for display purposes by naming them differently, like:
function getDisplayTitle() { return 'customPrefix ' . $this->getTitle(); } // or whatever
Then in the templates, you are always using $DisplayTitle and never $Title. This ensures that your pages will always use the custom logic, but the CMS will always load the original, actual value.
| 680 Views | ||
|
Page:
1
|
Go to Top |



