GithubHelp home page GithubHelp 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

bg-grid icon bg-grid

Background Grid React that is able to respond to match the viewport size. Working with basic triangle pattern

localgov icon localgov

Installation profile for the LocalGov Drupal distribution.

next-drupal icon next-drupal

Next.js for Drupal has everything you need to build a next-generation front-end for your Drupal site: SSG, SSR, and ISR, Multi-site, Authentication, Webforms, Search API, I18n and Preview mode (works with JSON:API and GraphQL).

raineffect icon raineffect

Some experimental rain and water drop effects in different scenarios using WebGL, by Lucas Bebber.

react-gridster-demo icon react-gridster-demo

Implements a dynamic grid and attempts to calculate if the user selected path connects from start to end

redux icon redux

Predictable state container for JavaScript apps

ticker-type-text icon ticker-type-text

This is a jQuery Plugin designed to mimic a typewriter or news ticker and iterate through a collection of html

vis icon vis

Simple Javascript plugin to check a pages visibility.

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.