-
-
Notifications
You must be signed in to change notification settings - Fork 79
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
Provide default_page and layout properties in content GET #411
Comments
I really dislike the whole default_page method it confuses end users. I suggest we will go for collective.folderishtypes which makes a lot more sense. see also #427 |
Personally I think that while default pages are a bit confusing, they have their uses. In a world with default pages, an editor can prepare a major edit of a section landing page as a separate page, and then easily activate it. In a world without default pages they would need to move the entire subtree into the new landing page, delete the old one, and rename the new one. The 1st and 3rd operations would take a lot of time with a big subtree, and there would be some time in between where the landing page is missing. Anyway, this probably isn't the best place to have that argument. In our current world where default pages exist, it would be useful to have that info in the API. |
How about portal root? |
Like default pages or dislike them..they are a core feature of Plone and in some case you need to use them and therefore they should have some support in the REST API - meanwhile I wrote my own endpoint inside my provisioning API. |
@zopyx Could you share some code you created to access the default_page property of a folder? I'm in need to set this property once per folder (nothing else at the moment) in some import code I'm working on ... |
While trying to implement something to get my work done, I unintentionally found a way to "set" the default page when uploading a new document with the REST API without needing to patch anything at all. It is rather easy: You can upload (by POST) a new document and use the name |
@wobsta right. This is Plone standard behavior. Good to know this solves your problem. Thanks for sharing it! I'd still be ok with implementing the default_page and layout in plone.restapi. Especially in plone-react it would be handy to being able to set the layout of a particular object. We use that a lot at kitconcept...So if anybody is willing to implement this, I'd be more than happy to help with pointers and reviewing... |
@buchi making default_page and layout an expandable might be overkill IMHO. Maybe just get/post them as regular attributes? As always, we would have to live with possible name collisions. Though, I guess I'd be ok with that. Opinions? |
@davisagli that seems to be a versioning workflow (can be done with plone.app.iterate?), using the default page for that is just a convenient hack. @datakurre the portal_root issue is fixed with this PLIP plone/Products.CMFPlone#2454 |
Hi all. |
@sauzher didn't you signed the Plone contributor agreement or what's the reason you can not push your branch here? You can always create a PR from a fork. |
…ike `"default_page": {"@id": "http://localhost:8080/Plone/front-page"}`
@sauzher , can you please create a PR so we can integrate this. Also, we should add the same functionality for the deserializer. |
@thomasmassmann |
Needed to be able to render the default page or the correct view in the frontend.
Example:
or make it an expandable component?
See also #126
@tisto @sneridagh @ebrehault opinions?
The text was updated successfully, but these errors were encountered: