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
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?
1
vote
3answers
4k views

Uploaded images in theme settings is going to be lost

I have a flexslider and I make its images customizable through the theme settings. I added a caption property for the the slide to meet multiple languages websites as follows in theme-settings.php: //...
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 ...
0
votes
4answers
6k views

How can I display site logo, name and slogan?

how can i show site logo, name and slogan Separately in custom area in my site theme, I now use this code to display theme, buts this code don't allow me to edit each of them Separately. {{ page....
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[...
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 ...
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
3k 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
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 //...
7
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'] =...
2
votes
3answers
954 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 ?
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 ...
3
votes
2answers
503 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, ...
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 ...
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
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['...
3
votes
1answer
723 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 ...
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/...
1
vote
4answers
972 views

Set path for favicon.ico and apple-touch-icon.png

I would like my favicon.ico to be accessible by http://example.com/favicon.ico and http://example.com/apple-touch-icon.png, but I can't manage that. I tried few things, but nothing helped. My favicon....
1
vote
0answers
940 views

drupal admin theme not working for roles other than administrator in drupal 8

I have a theme for the frontend and I use "seven" for the backend as I set it on admin/appearance. I created a new role: "power user", which is a limited access to the different content types. The "...