https://github.com/2dareis2do/virtual_edit_link_field
Virtual Edit Link Field
https://github.com/2dareis2do/virtual_edit_link_field
contenta drupal8 json-api php
Last synced: 4 months ago
JSON representation
Virtual Edit Link Field
- Host: GitHub
- URL: https://github.com/2dareis2do/virtual_edit_link_field
- Owner: 2dareis2do
- Created: 2022-02-18T18:56:17.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-03-15T18:17:27.000Z (over 4 years ago)
- Last Synced: 2025-10-24T20:41:20.925Z (8 months ago)
- Topics: contenta, drupal8, json-api, php
- Language: PHP
- Homepage: https://github.com/2dareis2do
- Size: 20.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Virtual Edit Link Field
When working in a de-coupled environment it might be useful to output a Drupal
entity's edit link as part of a RESTful implementation (such as when using
Drupal's core JSON API that comes preinstalled on Drupal Distro such as
contenta).
## Install
Download and install like any other Drupal Module. Consider installing via
composer as is recommended by Drupal.
## Usage
There is pretty much no config required. Once enabled you should see the
virtual `editLink` field output in the attributes array along with all other
fields that are exposed to the REST API and other modules.
Timeout is currently set to 1 day (60s x 60 x 24).
e.g.
`` "attributes": {
"internalId": 3,
"isPublished": true,
"title": "The umami guide to our favorite mushrooms",
"createdAt": "2022-02-17T01:34:43+0100",
"updatedAt": "2022-02-17T19:31:05+0100",
"isPromoted": true,
"path": "/articles/the-umami-guide-to-our-favourite-mushrooms",
"editLink": "http://drupal.docker.localhost/node/3/edit",``
## Todo
- Tests for different scenarios
- i.e. accessing pages via api / page
- check not being able to access after logging out etc.
- Make timeout configurable