Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created, Changed, Creator and Changer not available in Structure #225

Open
alexander-schranz opened this issue Aug 11, 2022 · 3 comments
Open
Labels
To Discuss The core team has to decide if this will be implemented

Comments

@alexander-schranz
Copy link
Member

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 and author. All other things should be not used to display as the Content Manager can not change it. But in some cases a lastChanged can make sense example in the Sitemap or on a Blog display when it is updated. The other 3 fields I would even like to avoid to be available in Twig to avoid false usage as it that fields are more for the Admin instead of the Website aslong as you are not creating a Wiki like website application.

@alexander-schranz alexander-schranz added the To Discuss The core team has to decide if this will be implemented label Aug 11, 2022
@alexander-schranz alexander-schranz added this to the Stable Release milestone Aug 11, 2022
@vntw
Copy link

vntw commented Apr 24, 2023

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).

@alexander-schranz
Copy link
Member Author

@vntw if I remeber correctly if your entity implements AuthorInterface the author and authored should be available when using 0.x@dev version:

class ExampleDimensionContent implements DimensionContentInterface, ExcerptInterface, SeoInterface, TemplateInterface, RoutableInterface, WorkflowInterface, AuthorInterface, WebspaceInterface, ShadowInterface
{
use AuthorTrait;
.

Author was implemented here: #193

@vntw
Copy link

vntw commented Apr 25, 2023

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 b5c3eeb) 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
To Discuss The core team has to decide if this will be implemented
Projects
None yet
Development

No branches or pull requests

2 participants