Message of the day:
Welcome to SilverStripe | Current stable: https://goo.gl/C4F1T9 | Feature requests: https://goo.gl/EcQ34L | Community Forum: https://forum.silverstripe.org | StripeCon EU 2019! https://stripecon.eu
If you have any SilverStripe related questions, please supply the version of Framework you're using.
Did you flush? 🚽 =
Maybe have a look at SilverStripe\CMS\Model\SiteTree, it does a few checks for stage vs live etc.
$obj->isVersioned() perhaps and/or $obj->hasStages ??? I can look this up, but I was wondering what would be the most reliable / universal way?
what is the best way to work out if a DataObject has: (a) write (b) writeToStage('Stage'), (c) publish, etc.... I am just writing a test that goes through all DataObjects to see if they can be written, deleted, etc.. and for Pages, and the like, I also want to test publishing ....
That's what unit tests are for....
I prefer to give them something they will always know how will turn out
h2 inside the Content?
Yes, also clients always manage to do weird things, like copying from word, or a video or image or a list with titles inside or who knows what combination of all those
Interesting — if there’s no actual paragraph it shows the whole content of the page! That’s headings, lists, everything!
ShortDescription field is another workaround, could also display a set number of characters but this could be problematic — client would need to keep a count on Level 2 headings which restricts what they could say and how they say it…
Not as programmatic but probably easier to do, and more predictive for the client to use
I’d solve that by adding a
ShortDescription field to the items