default_content
default_content copied to clipboard
Provide a tab on each content entity to export the entry
In order to use default_content you somehow need to export the content.
One way, as described in the readme, is to use some REST request.
An alternative way could be to provide a tab on each content entity:
Would you like to have such a feature inside default_content itself?
Looks interesting. Wondering if it should be a local task or something else, maybe a drush command?
If we do this, we should then also apply the path changes (change every URL to drupal.org, so that it's not specific to your site), which is something you currently have to do manually.
The output itself is pretty straightforward, so it could be easily integrated into a drush command as well. I kinda see default_content as a site builder tools as well, so I ask myself whether having something like a UI would be useful as well.
$entity = $this->entityManager->getStorage($entity_type)->load($entity_id);
/** @var \Symfony\Component\Serializer\SerializerInterface $serializer */
$serializer = $this->serializer;
$output = $serializer->serialize($entity, 'hal_json', ['json_encode_options' => JSON_PRETTY_PRINT]);
Personally I would prefer to use the drush command, of cource :)
I think it makes sense to have a UI too, but better to place it somewhere in Development. Implementation could use config single export alike
Yes, pretty sure I had reference somewhere a todo to add this. Great idea
Yes, there is one in the readme
On Sun, Aug 31, 2014 at 11:31 PM, Lee Rowlands [email protected] wrote:
Yes, pretty sure I had reference somewhere a todo to add this. Great idea
— Reply to this email directly or view it on GitHub https://github.com/larowlan/default_content/issues/10#issuecomment-54001984 .