[CmfCreateBundle] - How to create new documents?

52 views
Skip to first unread message

Emanuele Iannone

unread,
Aug 4, 2015, 6:53:44 AM8/4/15
to symfony-cmf-users
Hi,
I'm able to edit existing documents using WYSIWYG editors and REST calls offered by this bundle, but I cannot find any information in documentation about creating new documents.
What is the correct way to do this? 
Looking at the bundle source code I see a postDocumentAction in the RestController, which is supposed to be used for creating new documents, but I cannot find any example of using it.

I wonder also if it's possible to use the same twig template both for editing existing documents and creating new ones.

If try to pass a new object to a twig template in the {% createphp %} tag, I get the error: "Document is not managed and has no id".
If I try to pass null, I get the error "The model to create the entity from must be a class".

So, how I can tell CreatePHP that I want to create a new document?

Thank you

Lukas Kahwe Smith

unread,
Aug 5, 2015, 11:01:05 AM8/5/15
to symfony-...@googlegroups.com
We never really got around to pushing the idea of creating new content via create.js.

There was a PR started ages ago with the aim if allowing creating of new pages:
https://github.com/symfony-cmf/CreateBundle/pull/24
https://github.com/symfony-cmf/cmf-sandbox/pull/143

So at any rate .. this was never finished and it could mean that this feature is simply broken ..

regards,
Lukas Kahwe Smith
sm...@pooteeweet.org



signature.asc

David Buchmann

unread,
Aug 5, 2015, 11:19:12 AM8/5/15
to symfony-...@googlegroups.com
note that the pull request was trying to create a new page with its own
route, before routing auto bundle existed. with routing auto it should
be a lot simpler now.

or we could start with creating blocks inside a container block that
need no additional documents to be created at all.

it would be awesome if you can look into this emanuele. i wanted to look
into it so many times but in the end there was always something more
urgent... the createjs side is already a bit sparse, so a PR to the
sandbox where we can try to add blocks and see the failure you see would
already be progress.

Bruno Reis

unread,
Aug 6, 2015, 10:16:43 PM8/6/15
to symfony-...@googlegroups.com
The idea of having a parent container that already sets the rules for a new content might really make things easier. 


--
You received this message because you are subscribed to the Google Groups "symfony-cmf-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to symfony-cmf-us...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages