How do I check if a user has view access to a node, in a template file?

How do I check if a user has view access to a node, in a template file?

I’m currently working on a simple LMS in D8 and have already defined the fundamental content types. Among them is a content type called Course, which can be considered “Premium” content, i.e. all users may access those fields that contain more... read more
How do I check if a user has view access to a node, in a template file?

How to acess API rest/views using token or login?

I have a Drupal 8 website. I need to access the list of articles using www.myexample.com/rest/views/articles. I could get the token using curl –header “Content-type: application/json” -b cookies.tt –request POST... read more
How do I check if a user has view access to a node, in a template file?

How do I create a custom view filter for an existing field?

I ran into a problem with creating a custom view filter for an existing field for Drupal 8. I mean a filter not for fields like “nid”, “title” and so on, but for fields, which were named CCK-fields first. Could you share with me an... read more
How do I check if a user has view access to a node, in a template file?

Update website from 8.0.0 to 8.6.1

I’m pretty new to Drupal and I’m trying to update a website from 8.0.0 to 8.6.1. I’ve followed the guide here: https://www.drupal.org/docs/8/update/update-core-via-composer The composer part went pretty well. However, when I run the command: drush... read more
How do I check if a user has view access to a node, in a template file?

How to sort the query results?

In my task I need to display the results based on “the newest first”. I perform a query: $query = Drupal::database()->select(‘node_field_data’, ‘node’); $query->innerJoin(‘node__field_ils_apps’, ‘app’,... read more
How do I check if a user has view access to a node, in a template file?

How do I get link the files in libraries.yml with absolute url path

In my libraries.yml files the css files are linked with the relative url paths. Eg : /css/mycss.html So when in the page source the linked url shows as relative. How do I link those files with absolute URL path? read more
How do I check if a user has view access to a node, in a template file?

How come my view block is not loading using ajax?

We have a view, myview, that has an exposed filter title (text input). The view has Exposed form in block:Yes and so we load it onto the page under admin/structure/block. The block has a machine name of exposedform_myview_title. We want to remove it from display and... read more
How to redirect a node to an external URL?

How to redirect a node to an external URL?

Is there a way to “alias” a Drupal site node to an external URL? I’d like that a click on a link in my Drupal site like ‘http://mysite/node/64’ redirects to an address like ‘http://anothersite/whateverurl’. I use Fullcalendar... read more
How do I check if a user has view access to a node, in a template file?

Rules, Flags, Follower and New Content Notification

I am trying to setup a couple of rules. So far I have messed with rules some but since I am new, haven’t had any success. This is what I am trying to achieve. Have created a user flag called FOLLOW. (Flag module) These are the two rules I am trying to set. Every... read more
How do I check if a user has view access to a node, in a template file?

Adding a delete button to node edit form

I need to add a delete button to a node edit form, so in case I open a edit form of the node I want to have a possibility to delete it as well. This edit node form is genereted from a view using Link to edit Content and displayed in modal window, which adds the... read more
How do I check if a user has view access to a node, in a template file?

MetaTag with JSON API won’t serialize

I’m attempting to get MetaTag info for a decoupled site but the JSON API is not converting the object to JSON correctly. I’m seeing other fields show up fine – the issue is isolated to the MetaTags. The output appears like this: field_meta_tags:... read more
How do I check if a user has view access to a node, in a template file?

"InvalidArgumentException: Field field_participant_email is unknown" although it exists

We’re working on a custom module where we are creating participant content types programatically. We then have some queries to check for where a participant exists. However although the field field_participant_email‎ exists and is defined, the below code results... read more