This forum is for assistance with theme development.

Overriding user login

For overriding user log in page, add a file "user-login.tpl.php" in your themes "template" directory

then in your themes "template.php" file add code as follow

function YOURTHEMENAME_theme() {
  $items = array();
  
  $items['user_login'] = array(
    'render element' => 'form',
    'path' => drupal_get_path('theme', 'YOURTHEMENAME') . '/templates',
    'template' => 'user-login',
    'preprocess functions' => array(
       'YOURTHEMENAME_preprocess_user_login'
    ),
  );

  return $items;
  
}

Thanks

site_name.theme

Hi,

I was wondering if there is any way to add, in a class that drupal creates,

something that I want from site_name.theme with a function.

For example let's say that I develop a site with bootstrap and some content created

by drupal don't have the bootstrap classes and I want to add them in the class.

How i can do this?

How to pass variable to page--front.html.twig from custom module.

Hello friends,

I have a theme installed on my drupal 8 site. 

The page--front.html.twig located inside the themeFolder/templates looks as follows:

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:

Pages

Subscribe with RSS Subscribe to RSS - Theme development