Questions tagged [theme-settings]

Use it for questions about the settings that can be retrieved with theme_get_setting(). Don't use it for generic settings.

Filter by
Sorted by
Tagged with
16
votes
9answers
16k views

How do I set the theme logo?

How can I set the logo in my custom theme in Drupal 8? I can see that Drupal looks for the logo.svg file. I have a PNG logo.png file that I used in Drupal 7 and I would like to re-use it. I cannot ...
15
votes
6answers
12k views

Change default favicon programmatically

I know I can load a favicon though the user interface, but is there a way of setting the default favicon for your theme, so that when someone enables the theme, the default icon is immediately used?
9
votes
2answers
2k views

How to assign blocks to particular regions on theme install?

Drupal 8 provides some blocks by default. Eg. Site Branding, Main Navigation, Powered by Drupal, Search etc. I have created a theme that has Site branding & Main Navigation named regions in which ...
9
votes
1answer
2k views

Adding a dependencies in theme info file

Can I use dependencies[] = module name in the theme.info file? I want to create a drupal theme where I using some dependencies module, if I able to mention the dependencies in theme info it will easy ...
9
votes
1answer
2k views

How to make a theme depend on a module?

My theme requires multiple modules to be install before it is fully functional. How can one set module dependency in a theme, so that when a user enables the theme, it will also enable the required ...
8
votes
4answers
8k views

Why does the favicon sometimes not show up and generate “page not found” errors, and other times does show up

As the question implies, on occasion Drupal's log is showing that the favicon is not found. Indeed, it does not show in the browser tab or address bar. At other times, even within the same surfing ...
7
votes
2answers
6k views

How do I add custom theme settings?

In my theme I have link to social network. So, I would like to have field in theme settings where administrator can put link what would be use in all place where is {{link-social-network}}. <a ...
7
votes
2answers
15k views

How to get the logo path in Drupal 7?

I have a custom logo and I have tried to get his path in this way theme_get_setting('logo_path'), but no expected result. I am using the code in a custom block, in input PHP.
6
votes
3answers
17k views

How to override default favicon.ico?

I would like to load my own, but Drupal seems to forcefully load it's own by default behind the scenes.
6
votes
1answer
3k views

How do I display multilingual logos in D7?

I have read almost every tutorial on the net about how to setup multilingual logos. Yet, I cannot get anything to work. How do I get multilingual logos to display in D7? I have added $conf['...
6
votes
0answers
1k views

How do I translate theme settings?

How do you translate custom theme settings in Drupal 8? I use hook_form_system_theme_settings_alter to add custom settings to a theme. One setting is the text string (e.g. 'Menu') to display beside ...
5
votes
1answer
3k views

Programmatically change logo

I tried two versions: 1. $form_state = array(); form_load_include($form_state, 'inc', 'system', 'system.admin'); $form_state['values']['var'] = 'theme_settings'; $form_state['values']['logo_upload'] =...
5
votes
1answer
3k views

Changing theme in Drupal 8 via drush in the command line [duplicate]

In drupal 7 I used to just do a drush vset theme to change the theme in the command line, but that doesnt work in drupal 8 anymore. How would one change the theme in the command line for drupal 8 ...
4
votes
3answers
4k views

Favicon not loading from https

I have enabled https for my site. All images and files are served with https url, but favicon it is serving from http://example.com/sites/default/files/favicon.ico instead it should show as https://...
4
votes
1answer
3k views

Change site logo for an specific content type

I'm building a really simple site and I came into this question now. The site has a few content types and one of them acts as a moderated wiki (only users with a certain role may create/edit that ...
4
votes
1answer
147 views

How to automatically enable custom modules upon theme activation?

I have a custom module that I have defined in the [root]/modules/[custom module] directory. I want it to get activated as soon as someone installs my theme rather than handing over user the custom ...
3
votes
2answers
461 views

How to theme back end forms created by a custom module?

I want to be able to theme a custom form I create using a custom module that builds a form. The form is created programmatically using the code below: public function buildForm(array $form, ...
3
votes
4answers
1k views

Language-dependent logo

How can I use a custom logo image in Drupal 8 that is language dependent? There does not seem to be an appropriate setting in the Content and Language Translation configuration page.
3
votes
1answer
2k views

How to disable breadcrumbs for certain pages?

How can I just disable breadcrumbs for certain pages on drupal 8? There is a module for this on D7, is it easy in D8?
3
votes
2answers
2k views

How to change the site logo in a preprocess function?

I want to set my site logo programmatically, so that I can change the logo based on URL args. I am able to set the $variables['logo_img']['#uri'] with the following code in MYTHEME.theme but still ...
3
votes
2answers
497 views

Get the Dimensions of the Theme Logo

In Drupal 7 theme settings, you can upload a logo. How do you print the width and height of this logo in your theme? Background Research: theme_get_setting('logo') lets you get the path of a logo ...
3
votes
1answer
2k views

Simplest way to get a full set of favicons and touch icons

So you've generated a big batch of favicons, touch icons, tiles and whatever to cover the full range of files a broswer might look for, and the generator you used has helpfully given you a whole lot ...
3
votes
4answers
3k views

How do I save a file with managed_file in a theme?

I'm developing a theme that it requires to have a header image on the front page, so I have this. casper.theme function casper_form_system_theme_settings_alter(&$form, &$form_state) { $form[...
3
votes
3answers
8k views

How to change my maintenance page?

As the title explains, I want to make a custom maintenance page, different from the default one. For that I've read this tutorial: Theming the Drupal maintenance page. I copied the file /module/...
3
votes
4answers
2k views

Force an empty region to display (D7)

I'm looking for a way to force an empty region to display. I notice Omega does this via a theme-settings checkbox, but I'm unable to track down how it's done. Regardless of removing the if ($page['...
3
votes
1answer
635 views

How can I remove the site logo?

I want to remove the logo from my site. I found some instructions here: http://www.inmotionhosting.com/support/edu/drupal-8/themes/toggle-logo My problem is that the instruction say to untick "Logo" ...
3
votes
2answers
629 views

Upload Image in system_theme_settings form using Zen on Domain Access System

I want to upload the image as the background in the settings page of the zen theme. In zen , It's easy to add an extra field in the theme-settings.php and it's worked at the single site system. ...
3
votes
2answers
2k views

CSS not loading on Chrome for drupal site after moving to https

I have a Drupal site which has huge content. Recently I moved my dev content on production and also changed the site URL from http to https. The problem is that the site is working fine on all browser ...
3
votes
1answer
663 views

Can't get favicon/shortcut icon to show up

Despite trying multiple times various favicon location approaches: at theme root at files root uploading the file through admin/appearance/settings typing in a path of manually uploaded icon always ...
2
votes
3answers
4k views

How to set theme setting

i need to set theme setting programmatically. I use mothership theme. So for example: $type = theme_get_setting('mothership_classes_view'); dpm($type); //dpm displays 1 - so this setting is checked //...
2
votes
1answer
2k views

Theme settings not getting saved

I created custom settings for my theme for storing email, fb url, twitter url and g+ url. Everything is coming properly but the settings are not getting saved. I have no idea whats wrong. All the code ...
2
votes
4answers
3k views

Override favicon output

Some of search engines (yandex in my case) want me to output favicon with type image/x-icon. But drupal 7 outputs it without this type. How could i override this through template.php or any other ...
2
votes
3answers
2k views

allow user to set some css settings through UI

The user wants to be able to choose some sizes and colors for the look of the site. These are css rules. I have a vague vision how this could be done by a module, but maybe there is already something ...
2
votes
3answers
884 views

How do i get the all the regions available in the current theme programatically?

I want the list of the names of all regions available in the current theme in drupal 8. How to do this ? And is it possible to get the list of the blocks placed on that region ?
2
votes
2answers
113 views

Choose theme depending on the USER_AGENT

How do I use the mobile theme if the $_SERVER['HTTP_USER_AGENT'] is mobile, and use the desktop theme if it is desktop?
2
votes
1answer
141 views

In drupal 7, how can I make clicking the logo navigate to a different site? [closed]

I'm starting a drupal development project to recreate an existing site, doing it in stages. For now, I need the logo in the header to link to the old site, not the homepage of the drupal site. Is this ...
2
votes
1answer
804 views

Custom Logo in Drupal 7

What is the correct way to create a translatable in four languages website logo with slogan? I am thinking of creating a custom content type which will be populated in View block. Which when will be ...
2
votes
2answers
860 views

Alter Color module fieldset within theme settings form

I've set up Color module for my theme - it works pretty well, but takes too much vertical space (I have a bunch of colors). What i'm trying to do is to alter system-theme-settings form to make Color ...
2
votes
1answer
1k views

Automatically clear cache

Theme: Basic 8.x-1.x-dev I am trying to clear theme data after any change is done to twig files. I see that rebuildThemeData is here: https://goo.gl/EA2YL4 Currently have this within my .theme file....
2
votes
2answers
3k views

Drupal 8 Theme Header Background Image Upload

I'm upgrading the Mayo theme to Drupal 8. For Drupal 7 it worked like this in theme-settings.php with hook_form_system_theme_settings_alter(): $form['adv_header']['header_bg'] = array( '#type' =...
2
votes
2answers
139 views

Can a block span more than one region in a theme?

Can a block span more than one region in a theme? Sometimes I would like content to do this, depending on the page. I'm aware (and heavily use) Panels which are great but I thought it would be worth ...
2
votes
2answers
962 views

How to set the file status of files uploaded through theme settings to permanent?

I have been trying for a week to get image files uploaded to a Drupal server through the use of "managed_file" theme settings to remain on the site longer than the default 6 hours. I have visited the ...
2
votes
2answers
2k views

Is there a way to add managed_file field to theme-settings.php?

Anytime I add a managed_file field to theme-settings.php, the field works, however, it gets saved with a status of 0 in the database. When I add a submit handler to the theme settings form, I get a " ...
2
votes
1answer
472 views

About Corolla Theme Logo

I am using my logo with the Corolla theme but its give me the following error: No setting detected for Mobile first or Desktop first. Please review "Settings > Mobile first or Desktop first" and ...
2
votes
2answers
86 views

Within my themes page.tpl.php file it has a reference to a lot of variables like $head and $local_styles. What file are they stored in?

Within my themes page.tpl.php file it has a reference to a lot of variables like $head and $local_styles. What file are this variables stored at so that I can looked at what each of these variables ...
2
votes
3answers
147 views

Change the number of entries depending on a theme setting

I have a theme setting that allows the administrator users to specify how many teasers should be shown on the home page by selecting a number from 1 to 4 (through a <select> field). Is it ...
2
votes
1answer
448 views

Print user uploaded logo in twig template

How can I print a user uploaded logo (via the theme appearance UI) in a twig template? For example, in block--system-branding-block.html.twig we can use Available variables: - site_logo: Logo for ...
2
votes
1answer
98 views

Pass a logo to image module

How do I pass the logo on my theme to the image module to create different sizes? I'm using domain access to I can't use <?php print theme('image_style', array('style_name' => 'thumbnail', '...
2
votes
3answers
2k views

How to save custom theme settings in a subtheme?

I've created a subtheme of the Premium Responsive theme. It was working fine until I tried to change some of the advanced theme settings within the subtheme's Appearance page. The parent theme adds ...
2
votes
1answer
2k views

Can't change my custom logo for Bartik-theme. How to fix this?

Have newly installed Drupal 7 . Tried to change my logo to a custom logo. Worked the first time. Theme Bartik was activated. Now wanna change the logo a second time, can't do it. Can't disable it. ...