This forum is for assistance with theme development.

Remove the link to itself

Hello!
I am making a theme for Drupal 8 || 9
I need to remove the link to the current page. Replace the tag <a> with the <span> tag, if the link has the "is-active" class

For drupal 7 I wrote this code:

Document file contains both text field and file

I need a field to get a page url or a file, template loops this field content and if contains file will show Download button else shows View button, so in dashboard if user uploads any file, template ignores the text field

currently I used default drupal media file contains description, so if description field filled it ignores file rendering but the problem is that user must upload a file to access description field means at least must upload a file on server

How we can have a field with both inputs?

AJAX errors only on production

I tried to use my custom module contains AJAX behavior and also using Webform module that works as dialog. both of them working locally but on the host i get console error as below and both of this module navigate to the module relevant path instead open up as dialog

Call custom module as a part of template and prevent access it directly

I created a module contains form which should work as a part of template or as a modal and it works for these purposes

test_form.open_test_form:
  path: 'test-form'
  defaults:
    _title: 'Test Form'
    _controller: '\Drupal\test_form\Controller\TestFormController::openTestForm'
  requirements:
    _permission: 'access content'

but if i load form path directly loacalhost/test-form will get below response as a textarea

Access to active language in views-view-unformatted-list

I made page view and added Content: Translation language (= Interface text language selected for page) and Rendering Language: Interface text language selected for page and needed override default  views-view-unformatted-list template so in my template have

Pages

Subscribe with RSS Subscribe to RSS - Theme development