Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
2 votes
2 answers
1k views

Adding script conditionally

In the module I am developing I need to add script which require jQuery.The will be added depending on configuration settings. Hence I am using template_preprocess_module(&$variables) where I am ...
user2750995's user avatar
1 vote
3 answers
584 views

Can a theme leverage block config Yaml files when installed for the first time?

In my Drupal 8 contrib theme, when the theme is first enabled, a number of system blocks are dumped into the first region that's in my theme's info.yml file. From a UX perspective, this is not really ...
Danny Englander's user avatar
1 vote
2 answers
2k views

Programmatically changing the global site name?

I'm making a multi-site setup using the same install and the same database, basing it off domains. I'm trying to programmatically alter the site_name variable so that it displays a different site name ...
ividyon's user avatar
  • 158
1 vote
1 answer
41 views

Is it possible to organize template files?

As I've gotten more familiar with Drupal, I've been utilizing template files more and more. However, the naming conventions for template files make them difficult to organize. Is it possible to ...
Kellen's user avatar
  • 457
1 vote
2 answers
1k views

Print the node author's full name on a custom node template

I have a content type "Blog entry" which I have overridden the template. (node--blog_entry.tpl.php) The target is to display the node author's full name (as a link) which will take the user to a page ...
wotney's user avatar
  • 202
1 vote
1 answer
256 views

Unable to install lullabot/amp and sensiolabs/security-checker

i have installed amp and composer manager today i have been trying to get lullabot/amp installed, i have managed to install composer and drush on my computer but im not sure if they have been ...
twizz's user avatar
  • 11
1 vote
0 answers
110 views

Configuration export not working for sub-theme that has underscore in name

Had a strange issue today where I have a sub-theme (bootstrap) called 'rrre_theme'. I can confirm I have not made any errors throughout my sub-theme in terms of naming. I position blocks and generally ...
iain maitland's user avatar
1 vote
1 answer
46 views

What's the best way to create variables that are available to every single URL on my site, based on node id or taxonomy id?

On Drupal site A we have a bunch of links to non-Drupal site B. For marketing and tracking purposes all these links have a different URL variable appended to them, so that when a user registers on ...
Matt Morrison's user avatar
0 votes
1 answer
177 views

Is there a way to import Drupal variables into a the twig template?

I save a configuration setting using the following code. $config = \Drupal::service('config.factory')->getEditable('report.settings'); $config->set('id', $values['id'])->save(); Is there a ...
BrandenB171's user avatar
  • 1,122
0 votes
2 answers
273 views

D6 - Trying to display variable_get()s in a block

I am trying to display 4 variables in a custom block(created from my custom module). I am accessing the variables using variable_get('$myvariable', '0'). I am not able to display the array in the ...
drupalmav's user avatar
  • 565
0 votes
1 answer
4k views

How do I access Session variables in Drupal that were set on non-drupal pages?

If I go print_r($_SESSION) on a drupal page (say mysite.com/ )I only get Session variables set from drupal pages (which are none atm). I can set new ones and they'll show up. Array ( ) However If ...
Jiminy Cricket's user avatar
0 votes
1 answer
98 views

html.tpl.php is deleted and the site is down!

I'm mid-versed in WordPress, but newbie in Drupal, developing a Theme from scratch. I started with page.tpl.php, then extended the design with a custom front-page (page--front.tpl.php). Then for a ...
Mayeenul Islam's user avatar
0 votes
1 answer
51 views

Add fields to content-type when Theme is enabled

Is there any way we can change configuration items when we switch to a specific theme? Our (simplified) situation: Using Drupal 10.2 Our customers can choose between different themes Every theme uses ...
mullzk's user avatar
  • 65
0 votes
1 answer
253 views

Dynamic value in Twig or preprocess based on config and getHost()

I need to dynamically change a value in Twig templates by selecting a configuration value (defined in a custom module) based on the current environment. I did the following in a Form class, which ...
hotwebmatter's user avatar
  • 2,132
0 votes
1 answer
497 views

Show a summary calculated from webform submitted values on the submission preview page only (not on form) and re-use in e-mail handler

We need to display a computed summary of submitted information on both the submission preview page and in e-mails that are sent out. I'd expect this is a common usecase and wanted to check if i'm ...
mlncn's user avatar
  • 1,504
0 votes
1 answer
287 views

Favicon settings missing on subtheme config

Using Drupal 8 W3CSS Theme 8.x-1.17, I created a subtheme. The subtheme works fine, but on the settings page, the entire #edit-favicon div is hidden; style="display: none" has been added. I ...
pglatz's user avatar
  • 469
0 votes
1 answer
415 views

Theme shown without styles

I executed the config:import: import successfully, but now it seems that the theme settings are no longer found. The site is now seen as in the attached image How can I solve the problem? Note: I ...
Alessio Frabotta's user avatar
0 votes
0 answers
214 views

Add custom variable to page.tpl.php using custom module?

I found this solution here: https://www.drupal.org/forum/support/module-development-and-code-questions/2010-12-25/add-custom-variable-to-pagetplphp I created a module for give possibility to some ...
Ponzio Pilato's user avatar
0 votes
1 answer
32 views

Where do I set the HTML that wraps a module's config $form inputs?

I am transferring a module from one site to another. All is well except the modules form (where I set settings, upload images, etc). On the original site this is nicely wrapped in a table with each ...
MeltingDog's user avatar
0 votes
1 answer
50 views

Where does the variable for the left sidebar get set in Drupal 6?

I have a Drupal 6 site where I've added a submenu for a new set of products: products -old products set 1 -old products set 2 -new products set --new product 1 --new product 2 --new product 3 that ...
ronnienorwood's user avatar
-1 votes
2 answers
635 views

How to Restrict some special character in password field

I'm very new in Drupal, I would like to restrict some special characters from user password field Is there any way to edit configuration of core modules i'm trying to create preg_match modules . i ...
Shyam's user avatar
  • 1