This forum is for assistance with theme development.

How to Overriding a View Field Label using preprocess function?

I want to override a view field label by using theme_preprocess_views_view_field function.

I tried to use kpr() to check the name of the variable. And the location of the variable is: $...['fields']['comment_count']->label

I enter the following code into the template.php file.

Why would Drupal.behaviors and document.ready behave differently?

Hi. I'm adding some jQuery to my theme that tracks events for Google Analytics. It works when wrapped in document.ready, but not in Drupal.behaviors, and I'm not sure why.

This works:

jQuery(document).ready(function() {
  var page = document.URL;
  var tabTitle = cleanText(jQuery(this).text());
  ga_event(['Tabs', '"' + tabTitle + '" tab clicked', page]); 
});

This does not work:

Can't edit main menu links

Hi all,
In my template.php I', using this function (I found in the API pages) to adding a specific class to each menu entry.

IE cuts Nav menu

Issue I am facing is that IE (7,8) cuts the navigation menu to 4 items. Having 5 menu items that display fine in Firefox, Chrome and Safari. Building my own theme on a 960 grid with the nav being Superfish enhanced, all on localhost.
Only local images are allowed.

Installing Bootstrap to Druapl 8

I tried to add Bootstrap to Drupal 8 and enable the Bootstrap theme. Bootstrap enables but throws the following error : Uncaught PHP Exception Twig_Error_Runtime: "An exception has been thrown during the rendering of a template ("Object of type "Drupal\\Core\\Field\\FieldItemList" cannot be printed.") in "sites/all/themes/bootstrap/templates/page.html.twig" at line 80." at /var/www/core/vendor/twig/twig/lib/Twig/Template.php line 278
Can anyone please help to resolve this ?

Zurb Foundation 4 and jQuery

I am working on a Drupal 6 theme which uses the Zurb Foundation 4 framework. The problem I have is ideally Foundation 4 requires jQuery version 1.10.2. Drupal 6 only supports up to jQuery version 1.3.2 using the jQuery Update module. Upgrading to Drupal 7, unfortunately isn't an option. I have search through forums and tried a number of the suggested solutions but I can't seem to get both versions of jQuery to function without either breaking Core or Zurb Foundation functionality. Please, I am really need someone help.

Pages

Subscribe with RSS Subscribe to RSS - Theme development