This forum is for assistance with theme development.

hook_form_alter - how to target form tag by class?

I have a lot of webforms on my site and I need to add a custom class to them. Hook_form_alter works great if I want to override single form, targeting it by id, but how would I do it for lots of forms that have the same class?

Remove logo link from homepage

This is probably a very simple question but I can't think of the right keyword search to find the answer!

Basically, I want to remove the link from the frontpage's logo. I can see that 32% of our users are clicking on the top left logo when they're on the homepage.

Responsive Web Design - Best practice

I looked through the last few pages of the forum and have not found nothing about RWD. I have knowledge about sass/compass and have some few years of developing with d7 but just now I start jurney with that subject. Can someone help me and add some informations/links about best practices of developing responsive design websites with [maybe (?)]panels/context + mobile_tools/breakpoints.
What you need to know starting the adventure? what are the pros and cons of using each of these modules?

Drupal 7 - Add more code to function to template.tpl.php

hi all!

sorry for my english...

I have the function by default inside my template.tpl.php of my theme > corporate:

<?php
function corporate_preprocess_page(&$vars) {
  if (isset($vars['main_menu'])) {
    $vars['main_menu'] = theme('links__system_main_menu', array(
      'links' => $vars['main_menu'],
      'attributes' => array(
        'class' => array('links', 'main-menu', 'clearfix'),
      ),
      'heading' => array(
        'text' => t('Main menu'),
        'level' => 'h2',
        'class' => array('element-invisible'),
      )
    ));
  }
  else {
    $vars['main_menu'] = FALSE;
  }
  if (isset($vars['secondary_menu'])) {
    $vars['secondary_menu'] = theme('links__system_secondary_menu', array(
      'links' => $vars['secondary_menu'],
      'attributes' => array(
        'class' => array('links', 'secondary-menu', 'clearfix'),
      ),
      'heading' => array(
        'text' => t('Secondary menu'),
        'level' => 'h2',
        'class' => array('element-invisible'),
      )
    ));
  }
  else {
    $vars['secondary_menu'] = FALSE;
  }
}
?>

If I add a function for theming page.tpl.php I get an error.

I want to insert the new code within the existing function ... you can help me in this?

This is the function to add:


<?php
function corporate_preprocess_page(&$variables) {

IE styles not being picked up. Missing theme.php!

I created a Bartik subtheme and wanted to edit the ie.css. I soon realised that it wasn't being picked up. It wasn't listed in the .info file and when I checked the original bartik theme folder I realised that the ie stylesheets are being called from the template.php file, which for some reason is missing from my subtheme folder! I have no idea how I managed to do this. Copying the theme.php file to my subtheme, gives me a white screen of death. Removing it, takes me back to my styled, customised site.

Split content node-type wise ( or in a similar way )

Hi there!
I'm trying to code a theme for drupal and I'm really struggling to understand how to manage the $page['content'] variable.
I have an page.tpl.php as follows ( just meaningful parts have been added ):

<div id="header">...</div>
<div id="frontrow">...</div>
<div id="wrapper">
<div id="contentHolder">
<?php render($page['content']); ?>
</div>
</div>

In the #frontrow div I need a structure as follows:

Pages

Subscribe with RSS Subscribe to RSS - Theme development