This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

Hide link in menu based on service result

how should I do if I need to show to a link menu based on a condition ?

This is my YML for my menu link : 

    double_vue_klesia.backuserswitch:
      title: 'Retour user précédent'
      menu_name: navigation-principale
      description: 'Switch back to your user account.'
      route_name: double_vue_klesia.backuser.switch
      weight: 1

I want to show this link only : 

Not able to upload files to the new release

Please help me find why I am not able to upload extra zip files in the listing for customers to download? In the Add a new release section, I find https://www.drupal.org/node/1068944 shows in the picture there is a 'Release Files' but I don't have this field in my form.

Please advise on what to do. 

We have Drupal 7 integration uploaded before and now would like to upload Drupal 8 and keep both in the listing. Please help me find the best approach to do this. Thansk!

Add a new link to menu programmaticaly

Hello, I know it's possible to add a link to my main menu programmaticaly. My question is : how ?

I tried this : 

function double_vue_klesia_menu() {
  $items['user_switch_back'] = array(
    'title'           => 'Page name',
    'description'     => t('Account'),
    'menu_name'       => 'navigation-principale',
    'weight'          => 8,
    'type' => MENU_NORMAL_ITEM,
  );

  return $items;
}

Where double_vue_klesia is my module and navigation-principale is my main menu (this is system name).

How to composer autoload within a drupal 8 custom module

How do I autoload third party libraries within my custom module?
I don't want to alter the core composer.json (therefore no composer-merge-plugin.

Currently I'm adding the autoload directly in my my_module.module file

<?php

require_once __DIR__.DIRECTORY_SEPARATOR.'vendor'.DIRECTORY_SEPARATOR.'autoload.php';

Is there a setting or a dedicated hook to provide composer autoload functionality in my module?

how to PATCH use's user_picture (image)via REST in Drupal 8.6-beta ?

I want change a user' user_picture via REST, first I need to upload a file

I post it as follows:

$baseURL = 'http://localhost/d86/'; $uploadUserPicURL = $baseURL.'file/upload/user/user/user_image?_format=json'; echo "uploadUserPicURL = $uploadUserPicURL \n"; $res = $client->request('POST', $uploadUserPicURL, [ 'headers' => [ 'Content-Type' => 'application/octet-stream', 'Content-Disposition' => 'file; filename="cxx.jpg"', 'X-CSRF-Token' => $token ], 'auth' => ['admin', 'admin'], 'body' => $body ]);

How to edit a view and add a Group By and Order By in views.

Hi,

I want to add a Group By and Order By in views.
https://www.patientsengage.com/admin/reports/articles-reporting-conditio...

How to edit a view and add a Group By and Order By in views.

I want to display: Title and below respective articles to be shown

example:

Title: Autism

list of all the articles of Autism with ASC Order 

I am using Drupal7

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions