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

Wait for image to load before running custom Javascript

My customer wants a minor animation and I'm following the general pattern from this video but combining it with the latest library from Green Sock to create a simple text block moving up when the visitor scrolls to the copy.

[Solved]Views - Which Hook to Call on Exposed Filter Change

Hello,

I have three date fields in a content type. In a view, I need to show results that fall between a date range for either of the three dates.

I could create three sets of exposed filters to select dates to achieve this.

Instead

Import Twig Macro in Module Not Theme (Solved)

I have numerous twig templates in my module directory:

my module_name/
    src/
    templates/
      xxx.twig
      yyy.html.twig
    mymodule_name.module
....

How do I import xxx.twig inside of yyy.html.twig?

I do not want to put xxx.twig in my theme directory.

Contributed module template replacement

I have a custom module and I want to replace a template file of that in a contributed module. 

This is the template.
<!-- END OUTPUT from 'modules/contrib/hg_reader/templates/node--hg-event--teaser.html.twig' -->

Form ID of Views Exposed Filters

Why is the form id of an exposed views filter always "views_exposed_form"? I have several exposed filters among my views. How am I going to tell the difference between them in hook_form_alter?

Form API drupal vs custom js validation

My question is more to get a better understanding about this Drupal form, not as much the specifics here. I cleaned it up a bit. I'm trying to figure out what is allowing this form to use the Drupal validation and can I replace it with custom ajax to validate field by field, so it displays the error text below each field rather than how it is now in one error block. Is it necessary to disable the built in validation or just override? So instead of "setMessage" can this be done with callbacks on each field?

<?php

namespace Drupal\make_form\Form;

Pages

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