This forum is for assistance with theme development.

Advice for a new developer

Hello,

I'm working as web developer. My company uses Drupal for site development.

I have the basic knowledge (HTML5, CSS, JS, PHP, Python, Java, C, C++).

After 5 months of work I don't fully understand Drupal, I find it very difficult.

I'm able to develop a custom website from 0 all by myself but I don't know how to

gain more control over the classes drupal generate for views and blocks.

I want to be able to create classes inside custom_name.theme and then assign them as variables, override blocks, alter classes etc.

How to set the front page via custom module.

Hello friends,

I asked a similar question to these under the Module Development and Code questions, but I think this question may actually be better suited under this topic.

I am working on a drupal website that has a theme installed to it.

I would like to set the Front/Home page of the website to a .html.twig template I have in a custom module I am busy working on.

How would I go about doing this? I have done some googling and it likes like the answer lies somewhere with page--front.html.twig, but I am not sure where to go from here.

How to render field collection items in a paragraph

I've got a field collection for slides in a paragraph. Each field collection slide has a background image field and a headline field. The editor can add as many slides as they want. I'm trying to theme this output. So, I've been assuming I should loop through the field collection items and spit each out, but it's completely baffling me. I'm not the best PHP'er, but I get by.

In 'paragraphs-item--content-slider.tpl.php' this prints the first 2 just fine, as you would expect:

How to close the navigation menu when you click outside ?

I have a site with the Bootstrap 3.3.7 theme and I want the farm navigation menu to click when I click outside.

I managed to make it work with the following code :

    (function ($) {
      'use strict';
    
      $(document).click(function (event) {
           $('.navbar-collapse-first').collapse('hide');
      });
    
    }(jQuery));

My problem :

When I click next to a link in the navigation menu, it closes. I want it to close only when I click OUTSIDE of the menu.

trying to modify an installed theme in Drupal 8

Hi, this may be a naive question as I'm a real beginner to web development. I built a blog website using Drupal 8, and downloaded and installed a theme. I would like to modify the theme, as I want to make the site title smaller and the navigation menu bigger. I first used the browser's inspect element tool to modify the CSS, which did exactly what I wanted. However, when I attempted to modify the style.css file and upload the modified version to the server, my changes did not take effect.

Performance of displaying content based on value of a Field?

I have ten custom List (integer) Fields, each has 5 values to choose from on the list. Within my Twig configuration I've been programmatically using {% if node.field_options.value == 'X' %} to display some CSS and an Image based on value returned.

Performance wise, is there anything wrong with doing this or will it slow down rendering of the page?

Pages

Subscribe with RSS Subscribe to RSS - Theme development