Giter Site home page Giter Site logo

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

Daniel Lobo's Projects

Daniel Lobo doesnโ€™t have any public repositories yet.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.