Open alexander-schranz opened 2 years ago
Since it's labelled "To Discuss": I ran into this today, having author
/authored
available would be very helpful, especially for sth. like articles/posts which I'm sure a lot of people will use in the future.
I'm currently getting that data via a twig function from the current content object to render where it's needed, didn't find a better option (with my limited Sulu, let alone ContentBundle knowledge).
@vntw if I remeber correctly if your entity implements AuthorInterface
the author
and authored
should be available when using 0.x@dev
version: https://github.com/sulu/SuluContentBundle/blob/b5c3eeb2e6875437b81febcd8583e9c1400aacaf/Tests/Application/ExampleTestBundle/Entity/ExampleDimensionContent.php#L39-L41.
Author was implemented here: https://github.com/sulu/SuluContentBundle/pull/193
Thanks for the hint, I don't want to misuse this issue for my "issue" but I used exactly that example application as a starting base since there's not much documentation available, so the AuthorInterface
is already implemented (using the latest commit in 0.x b5c3eeb2e6875437b81febcd8583e9c1400aacaf) but I don't see any author related data in the twig output (except the request object
attribute of the entity). Would I expect it in the content
array or in the root level?
While debugging I found https://github.com/sulu/sulu/blob/097a23c376f1fddbcdfdbd4f564f7847ec0cc934/src/Sulu/Bundle/WebsiteBundle/Resolver/StructureResolver.php#L110 which seems to be sth. different since the method signatures are different and the check is against ContentDocument
, not the custom DimensionContent entity
Currently the structure does not return created, changed, creator and changer. I personally not even sure if we want it. As the only thing which should be displayed on a Website is
authored
andauthor
. All other things should be not used to display as theContent Manager
can not change it. But in some cases alastChanged
can make sense example in theSitemap
or on a Blog display when it is updated. The other 3 fields I would even like to avoid to be available inTwig
to avoid false usage as it that fields are more for theAdmin
instead of theWebsite
aslong as you are not creating aWiki
like website application.