Monday, April 10, 2017

Drupal 8 - Restricting a node content type with access token from viewing.

Now i'll share a Module to alter the existing Drupal "Site Information" form. Specifics:
  • A new form text field named "Site API Key" needs to be added to the "Site Information" form with the default value of “No API Key yet”.
  • When this form is submitted, the value that the user entered for this field should be saved as the system variable named "siteapikey".
  • A message should inform the user that the Site API Key has been saved with that value.
  • When this form is visited after the "Site API Key" is saved, the field should be populated with the correct value.
  • The text of the "Save configuration" button should change to "Update Configuration".
  • This module also provides a URL that responds with a JSON representation of a given node with the content type "page" only if the previously submitted API Key and a node id (nid) of an appropriate node are present, otherwise it will respond with "access denied".
This Drupal Module is available here at GitHub.
https://github.com/nirmalyamondal/Drupal-Modules/tree/master/site_apikey

Tuesday, February 14, 2017

Theming with Drupal 8

|-config
|    |-install
|    |    |-themename.settings.yml
|    |-schema
|    |    |-themename.schema.yml
|-css
|    |-style.css
|-js
|    |-business.js
|-images
|    |-buttons.png
|-includes
|    |-bootstrap
|    |-flexslider
|-templates
|    |-block.html.twig
|    |-comment.html.twig
|    |-html.html.twig
|    |-maintenance-page.html.twig
|    |-node.html.twig
|    |-page.html.twig
|-favicon.ico
|-logo.png
|-screenshot.png
|-themename.breakpoints.yml
|-themename.info.yml
|-themename.libraries.yml
|-themename.theme