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

What are the "#pound" keys in the controllers?

Hello,

I've seen in tutorials that when you create a controller, you output content something like this:

return array("#title": "Hello", "#markup": "Whatever goes here");

So here, I am referring to the keys "#title", "#markup", etc. I noticed there are other similar keywords, which I'm sure somehow relates to where and how Drupal outputs its content to.

Is it possible to store a managed_file in my custom module?

Hello friends,

I have a form input that looks as follows:

        $form['listing_logo']['dbl_logo'] = array(
          '#type' => 'managed_file',
          '#title' => 'Image',
          '#description' => 'Select a logo to upload',
          '#upload_location' => 'public://upload/business_listing/logo',
          '#required' => FALSE,
        );

Is there a way to set the "#upload_location" to store the file inside my custom module?

How to interpret versioning?

Hi,

Saw it in the getting started documentation, that versioning looks like this: (>=8.x-3.x)

Not sure how to interpret this? I assume ">=8.x" means that the module is compatible with Drupal versions 8 or higher. So what is the "-3.x" refers to?

Just curious.

Thanks.

How to use slider library programmatically in custom module.

Hello friends,

I am trying to implement the Owl Carousel plugin in my business_listing custom module.

I created a library for this plugin via:

business_listing.libraries.yml

Correct way of adding a page in a custom module? eg. About Us

Hell Friends,

I have a custom module where I am creating menu items and displaying custom pages for these items.

An example of how I render my contact page is as follows:

business_listing.routing.yml:

business_listing.about:
 path: '/about'
 defaults:
   _title: 'About Us'
   _controller: '\Drupal\business_listing\Controller\AboutController:loadAbout'
 requirements:
   _permission: 'access simple page' 

AboutController.php:

How to display internal links with metadata ?

On my Drupal 8 site the Metatag module that is configured.

When I share a link from my site to an instant messenger like Telegram or social networks like Facebook, the title, description and image are automatically retrieved and displayed.

Here is my question:

I have an instant messenger with the Private Message module :

https://www.drupal.org/project/private_message

Pages

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