default_content icon indicating copy to clipboard operation
default_content copied to clipboard

Provide a tab on each content entity to export the entry

Open dawehner opened this issue 9 years ago • 5 comments

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? default_content

dawehner avatar Aug 29 '14 11:08 dawehner

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.

Berdir avatar Aug 29 '14 11:08 Berdir

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

dawehner avatar Aug 29 '14 11:08 dawehner

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

andypost avatar Aug 29 '14 15:08 andypost

Yes, pretty sure I had reference somewhere a todo to add this. Great idea

larowlan avatar Aug 31 '14 21:08 larowlan

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 .

dawehner avatar Aug 31 '14 21:08 dawehner