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

Add different menu blocks to pages with similar url pattern

I have a menu block that is applied to pages with urls  /health and /health/*. On the same site I wanted to add a different menu block but has the same base url with a few more levels /health/something/somepage. Adding this as a block causes a conflict of course since we have the first one using /health/*.

Any suggestions on maybe adding the second block via hook saying apply it to pages with url pattern of /health/blah/blahhh?

We're on D9 and was trying to avoid installing a module to do this. 

FileRepository writedata() - large files

Hi, I have some large files (upto 1GB) that arrive via FTP, and these need adding to Drupal.

I had been using file_save_data and using a handle, but this code no longer seems to work after upgrading to 9.3.0. file_save_data() has also been deprecated, so I've updated my code to use writedata()

Term select values

Hi. Is it possible to output the text values rather than ID's of taxonomy terms in a terms select field?

So rather than;

<option value="106">AECC University College</option>

Output;

<option value="AECC University College">AECC University College</option>

I am trying to remove "time ago" from forum posts.

Hello,

I installed the core module "Forum". I want to remove "time ago" from the posts.

I found this file: forum-submitted.html.twig under the folder: web\core\modules\forum\templates, that has the following content:

{% if time %}
  <span>{% trans %}By {{ author }} {{ time }} ago{% endtrans %}</span>
{% else %}
  {{ 'n/a'|t }} 
{% endif %}
 

I tried to remove "{{ time }} ago" from the file, I flushed all caches, but the text is not removed from the posts.

Style table from custom module

Absolute neophyte to Drupal module development.  I am basically still working on my own 'Hello World' module.  I have the basics down regarding what files to put where, etc.; and, my stupid simple module works, sort of.  However, my problem right now is, I can get a function that sends HTML ('#type' => 'markup') to the screen; OR, I can get a function that sends a Table ('#type' => 'table') to the screen, but I cannot do BOTH.  I think, ideally, I would want the Table-making function to be called by the HTML-making fu

Pages

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