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
0
votes
1answer
1k views

Turn off responsive behavior for Bootstrap 3

I know how to turn off responsive in bootrap . but how it can be in drupal theme. As i am using Drupal Bootstrap and created a subtheme. can that subtheme be non-responsive ??
0
votes
1answer
17 views

Page Content Type: Displaying error in Preview mode

Whenever I am creating or editing my page Content Type and go into preview mode I see these errors: And here is the code for it: The dark theme does not show up in preview mode though. However, if I ...
0
votes
2answers
649 views

Cache pages for anonymous users stuck on

I can't turn off the "Cache pages for anonymous users " cache option. I uncheck it and then hit save as usual but it stays on. Is there some sort of module conflict causing this or possibly an issue ...
0
votes
2answers
1k views

Theme logo and site name

how can I put logo and site name in an unordered list? I am using a bootstrap subtheme !
0
votes
1answer
881 views

Set permanent status for managed_file in theme settings

I'm creating some Drupal 8 theme and I need some additional settings for it. So, I have to add some managed_file field in theme settings. I have theme-settings.php file where I define this field and ...
0
votes
1answer
32 views

Set new theme setting to default on theme update

Working We have a custom base theme. There are custom theme settings with default values. When the theme is initially installed, the theme settings are correctly set as default. Good. This custom ...
0
votes
1answer
7 views

Save 2 logos in custom theme

I need to save in theme 2 custom logos and use them on the site. Can I somehow create custom field in theme or maybe save the path to another logo in one of the .yml theme files?
0
votes
1answer
512 views

How to remove favicon

How can I remove the drupal favicon, I have tried to change the theme settings and global settings but it's not changing anything because I have to put another link if I want to replace it with my own,...
0
votes
2answers
37 views

How can I copy theme configuration when copying a site?

I have written a script that copies a drupal 8 site. The steps go something like this: dump old site database into file replace old site name with new site name in said file create a new database ...
0
votes
1answer
33 views

Why would all theme background colors disappear after moving to different server?

A site using MAYO 7.x-1.2 was moved from a Windows IIS to a Linux server. Shortly thereafter, all background colors defined in MAYO settings (and also any custom CSS) have disappeared. Also gone is ...
2
votes
1answer
422 views

print theme_get_setting in php-as-css file

I'm trying to print out settings from my theme's theme-settings.php into a file called custom.php. Below is the code I'm using in custom.php: <?php header("Content-type: text/css; charset: UTF-...
0
votes
0answers
12 views

how to display field in Hook_preprocess for the template file

I am trying to display following field to the tpl.php file. However, I do not know how to display this field. $form['ExStart'] = array( '#type' => 'value', '#value' => $overallstart, )...
0
votes
2answers
723 views

How can I enable HTML output for checkbox options?

I am adding theme styling settings and I would like to have associated color to the checkbox in themes setting form. So far, i haven't been able to do so, because the output strips inline styling and ...
0
votes
1answer
14 views

how to have a different page from the front page?

In my site (psa.modares.ac.ir) all my pages are the same as the front page. for example, I have our team block and price table on the front page but I also see them in blog posts or article pages. why ...
0
votes
0answers
22 views

Group CSS and JS files for aggregation

The grouping for CSS-JS Aggregation is done on what basis ? For example, there are files A.js, B.js, C.js, D.js and E.js. If I want A.js, C.js in an aggregated file called X.js and B.js, D.js and E....
1
vote
3answers
1k views

Can I set a theme's logo_path programmatically?

When adding a logo file to a custom theme, I can either save my logo in the theme folder as logo.png (replacing the default logo.png from the theme starterkit I'm using), or save my logo in the ...
0
votes
1answer
32 views

Extra Content Appears Below Footer

I have an issue where I have the page for a specific role showing up on every page and additionally an error message. These show up below the footer on the pages. I've gone through the theme files ...
0
votes
0answers
19 views

Want to change an automatic background image selected by a theme

The Parallax theme 8.x-1.8 comes with a background image I am not able to change. What should I do?
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 ...
0
votes
1answer
150 views

Kint works in pre_process but not in Twig

On my site, I'm able to use print variables using kint in my pre-process functions. However, when I try to do the same in twig, nothing happens. I do have debug mode turned on. Has anyone ever ran ...
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 ...
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....
0
votes
0answers
69 views

Theme a block with #theme and twig template file

My custom module theme template is not render by Drupal for some reasons. In my .module file I implement the hook_theme and define my theme settings: /** * Implements hook_theme(). */ function ...
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 ...
0
votes
0answers
13 views

How do I change the width of a mega slider?

I am using Drupal 7.x. I am using the popular theme is porto. https://i.stack.imgur.com/Kmhok.png Porto comes with a Mega Slider component. And that is what I am using here. I am using the Mega ...
0
votes
1answer
131 views

amp-img tag, replace to simple img

I need to change this tag <img> to <amp-img>, I've been researching about this and I have this function for change the img tag. function amptheme_image($variables) { // Remove RDF ...
0
votes
1answer
75 views

Set value to specific custom theme setting

I noticed that I can get a specific theme setting like so theme_get_setting('myvar','mytheme'); but I don't see a way of actually setting a setting. Something along the lines of theme_set_value('...
0
votes
0answers
42 views

Don't use admin theme for adding/editing specific content type [duplicate]

Via permissions I've made it possible for my users to see/use the admin theme I use. But I want them to not see the admin theme while adding or editing one specific content type. How can I get this to ...
0
votes
1answer
112 views

Is there an easy way to adjust the block layout?

I have menus that are set to Sidebar First in the Bartik theme. When the screen size decreases, those menus are shown below the main page content. Which file in a copied version of the Bartik theme ...
-2
votes
1answer
135 views

Unable to load CSS and JS files on custom theme [closed]

I don't understand why my CSS or JS files doesn't loaded by drupal. My folder structure is: StarterTheme (starterpf_d8_2019 named folder) |__ CSS folder |__ application.css |__ ...
1
vote
2answers
842 views

Allow .svg logo uploading in theme settings

How can I allow using .svg files for the logo field, in the theme settings?
-2
votes
1answer
56 views

Is it possible to build a brand new theme without using Twig? [closed]

I'd like to move to Drupal 8 for my next project. I understand that, from version 8, Drupal standard template engine is Twig. Is it possible to build a brand new Drupal 8 theme without using Twig at ...
0
votes
1answer
271 views

Referencing an existing image in theme settings

In a custom theme (Drupal 8.4.3) I would like to add a theme setting, where I can reference (not upload) an image to use as a background image. Like in a normal reference field, already uploaded ...
2
votes
2answers
965 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
409 views

Sub-theme navigation menu and footer menu not showing

I have created a sub-theme using a purchased theme. While creating sub-theme I followed these steps as mentioned in the documentation: I have created subtheme.info.yml and subtheme.libraries.yml ...
0
votes
1answer
87 views

Import test data to theme? [closed]

I'm quite new to Drupal, and I'm still in learning process. I've installed a pure Drupal 8, and installed a the YG Agency theme. Right now the theme is only blank. Is it possible to load some test ...
1
vote
1answer
1k views

Custom submit handler for theme settings form

I am creating a new D8 theme and having slideshow functionality in it. For slideshow, we have title, description and image field in the theme settings form. I am able to alter the theme setting form ...
1
vote
1answer
2k views

Changing the url which the logo links to

I'm using Zen Theme 5.x and want that the site logo links non to the front page but another page in my base url, like to a contact page. It seems that I can achieve this modifying the page template ...
0
votes
1answer
212 views

Set <front> page in theme settings? [duplicate]

I've created a settings page for my theme, and I'd like to be able to set the frontpage from there, but I don't know how I can change the frontpage in code? This is the setting: $node_type = "page"; ...
1
vote
1answer
46 views

Subtheme install settings in config but not showing

In a brand new site installation, I created a subtheme of the Bootstrap theme. In the subtheme (let's call "mytheme") config/install/mytheme.settings.yml file, I have the following settings. settings:...
4
votes
1answer
149 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 ...
1
vote
1answer
700 views

Is it possible to use drush to save a theme setting?

I need to set a theme setting via a scripting mechanism (specifically phing). Is it possible to use drush to set a very specific theme setting, without passing JSON? drush vset {theme_setting} {...
-1
votes
1answer
49 views

head_title drupal

in html.html.twig in title tags {{ head_title|safe_join(' | ') }} This code display " home | " how to remove( | ) from display in home page? also in other page display " page | Home " i want title ...
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[...
0
votes
1answer
96 views

Core Drupal8 JS necessary for Drupal theme to function

I have recently noticed that Drupal8 is adding number of JavaScript files. I would like to know if it is necessary for theme to function <script src="/core/assets/vendor/domready/ready.min.js?v=1....
1
vote
0answers
66 views

Define custom twig page template for specific pages by page url - page--program.html.twig

I have multiple pages with different content type. All the pages 1st path component is same. So, I want to define a custom twig page template to these pages by their 1st path component. Eg. I have ...
0
votes
1answer
609 views

Saving a field of type 'text_format' as a theme settings variable

I try to add a text area with wysiwyg editor in the theme setting. If i use '#type' => 'textfield', it works : If I use '#type' => 'text_format', the text is saved but i don’t see it as ...
0
votes
1answer
34 views

How to load Ajax Site Wide?

I am trying to open a webform in a modal window through following link, which works fine when I am logged in, but when I logout it simply stops working <a class="use-ajax" data-dialog-options="{&...
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 ...
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?