Questions tagged [theming]

Use it for questions about rendering or modifying the HTML markup produced by a module/theme.

Filter by
Sorted by
Tagged with
2
votes
1answer
939 views

Problems with a global variable

I have the following code: $a='1'; function check() { global $a; if ($a == '1') { return "1"; } else { return "2"; } var_dump(check()); } When I run this code stand alone, its ...
10
votes
7answers
13k views

Display comma-separated list of taxonomy terms?

Drupal 7. In my node.tpl.php, I want to print out a list of taxonomy terms (the taxonomy is called "channels."). If I use: <?php print render($content['field_channel']); ?> It works, ...
1
vote
1answer
1k views

Primary Links Not Showing Up On Certain Themes

In Drupal 7, I have a page in the Primary links menu. I set the page content type to use the primary links. In Garland I can see the item at the top of the page, but in a bunch of other themes I can't,...
1
vote
1answer
1k views

How do you wrap a link around the block header text with Drupal?

(sorry if i'm redundant) What's the easiest way to wrap a link to the header of any block title text? I know a workaround would be to just not include a title and add it in the content; but that's ...
1
vote
4answers
2k views

How do I print the node add form in block.tpl.php?

I am using Microblog. How do I print the node add form in a block? I tried node_add('microblog'), but it doesn't work for me; then, I tried drupal_get_form('microblog_node_form'), but I am still ...
3
votes
2answers
7k views

How do I add classes to form elements in the theme layer?

I want to do it in template.php. The form ID is page_node_form, and there are six form text fields. The default class is "form-text." I want to add "text1," "text2," etc after "form-text" to each ...
25
votes
1answer
6k views

Why does Drupal 7 prefer CSS @import rules to <link> tags?

"Don’t use @import," lots of guys say. There are lots of shortcomings of using @import. Using @import within a stylesheet adds one more roundtrip to the overall download time of the page. Using @...
0
votes
1answer
724 views

The $directory variable doesn't contain the correct value

When I print the content of $directory in my theme's page--front.tpl.php, it outputs "modules/system." This is not I want; I want to output "sites/all/mytheme/images/…." How can I do it?
1
vote
1answer
2k views

Overriding the output for the primary navigation links

Is there another way the primary navigation is supposed to printed out besides how it is done in the core system template? print theme('links__system_main_menu', array('links' => $main_menu));` ...
4
votes
1answer
2k views

How do I add an additional sidebar to a Zen sub-theme?

I want to add an additional sidebar to my zen based theme with fixed columns. I added it to the theme info, and printed it in the page.tpl.php file, but I don't know how to configure its CSS files to ...
2
votes
1answer
634 views

Using Invisimail within a Contemplate Template

I'm in Drupal 7 and using Contemplate and Invisimail, but I can't figure out how to get my emails to be obfuscated. I think it is because the display of the node is using the contemplate template, ...
2
votes
2answers
5k views

Theme overrides for custom hook_theme() in Drupal 7

I have a custom D7 module which defines it's own hook_theme() which defines a few theme functions, of which they define their own template, for example: function foo_theme($existing, $type, $theme, $...
0
votes
2answers
5k views

how to modify the confirmation email in Ubercart?

I'm trying to modify the format and text of the confirmation email in Ubercart and I don't know from where....can anyone give me hint? for example including some images or custom links in some parts ...
2
votes
3answers
4k views

CSS files defined in .info file are being ignored

Having followed a number of different guides to try and create a Bartik sub theme that allowed me to use the Color module, the following was the last one I attempted that worked: http://drupal.org/...
1
vote
2answers
2k views

Adding the button implemented from “Printer, e-mail and PDF versions” in node.tpl.php

I am using Printer, e-mail and PDF versions, and I was wondering if there were a way I could place the print button in node.tpl.php above the $content area, instead of through the Drupal ...
2
votes
5answers
4k views

How do I get the field label?

I added some fields to the "Article" content type. I want to output them in a page--front.tpl.php. How do I get the field label value? When I use the following code in page--front.tpl.php, it doesn't ...
0
votes
1answer
236 views

Why creating the front page doesn't work?

I created the file named page--front.tpl.php, which is empty, in the Garland theme and set the front end to it. I still can access the front page: why?
2
votes
2answers
446 views

Best place to add to Drupal.settings from a theme

I am working on a theme for a client, and have run into an instance where I would like to add to Drupal.settings via drupal_add_js() from the theme. In this particular case, it is really most ...
1
vote
1answer
130 views

Can Rules be used to disable the logo variable on some pages?

I have a change in Drupal 6 that I would like to make quickly without doing another SVN roll (until I get a more permanent solution in place) and I would like to create a triggered rule that will null ...
0
votes
1answer
4k views

How to Remove read more link from front page [duplicate]

Possible Duplicate: Remove links 'read more' and 'Add new comment ' on the home I user zen theme and i tried this question answer Remove the 'read more' and 'Add new ...
3
votes
2answers
6k views

Load custom template from MENU_CALLBACK

Here's my current situation: I have an external authentication platform that loads in Drupal via an iframe. When the user is authenticated, the external application redirects the user to a Drupal ...
0
votes
1answer
756 views

Using tokens under exposed views filter

I have created a view with an exposed filter. In my display I have an Using tokens section that I do not want to display: Using the theme developer this is the closest I can get to it: So it seems ...
3
votes
1answer
7k views

Best way for including javascript/jQuery OnLoad in EVERY page on my site

Currently, in my theme.info file I am including 2 scripts: scripts[] = js/backstretch.js scripts[] = js/scripts.js Backstretch is a jQuery plugin that allows for an expanding background image to ...
4
votes
2answers
2k views

How to pass formatter settings to field theme function?

I've created a field by implementing hook_field_info, I've created the widget which works perfectly and I've hit a road block with the formatter. I've implemented hook_field_formatter_settings_form ...
1
vote
1answer
2k views

What is the best practice for theming?

I'm about to start theming a Drupal 7 website for the first time. I've watched Moshe's video, Lia Clark's introduction to theme overrides using context naming, and Franz's talk at Drupalcon Chicago. ...
6
votes
5answers
11k views

Theming the user registration form

I want to theme the user registration form in Drupal 7 by adding new markup, etc. I cannot seem to figure out how to do it. I've followed a few tutorials which suggested that you could simply invoke ...
1
vote
1answer
158 views

How to style the help text that appears at the top of pages?

I'm using the "Piano" theme, and I just don't like the way it displays the help text that would normally appear as a red box when there's an error or a green box for information or to indicate that ...
2
votes
2answers
4k views

Calendar Themes

Are there any themes for the Calendar module? The out-of-the-box theme is not great. It be nice to find a new base theme without rolling my own.
2
votes
1answer
3k views

Views theming basics [closed]

I'm starting with Drupal 7 and Views 3, and I want to learn how to modify the templates of my own views. This sentence in the Views project page worries me since I cannot use Views 2 with Drupal 7: ...
0
votes
1answer
838 views

Modifying login/user panel position in a theme

For our site, we're looking at designing a relatively simple log-in widget/panel. We want it to be in the header of our site (for reference, we're modifying the excellent "Orange" Drupal theme), and ...
1
vote
0answers
461 views

Figure out the difference between loaded JS, CSS files, and files needed to be loaded for new content

I'm looking for a way to figure out what CSS and JavaScript files are loaded, and what else CSS and JavaScript files needed to be loaded for new content I'm injecting with AJAX. I've am module file, ...
7
votes
2answers
2k views

(Un-) formatting each form element

When we declare something like $form['textfield'] = array( '#type' => 'textfield', '#title' => 'textfield title', '#maxlength' => 8, '#required' => true, ); The output will be ...
3
votes
2answers
422 views

Is it possible to add custom stylesheets while using a core theme?

I'm trying to add a custom stylesheet although I'm using the Garland theme but so far I wasn't able to do it. I've tried the following: function mymodule_init(){ $path = drupal_get_path('module',...
-1
votes
1answer
111 views

Which is the function that initializes the content of the “$scripts” variable used in html.tlp.php?

The template file html.tpl.php has access to the $scripts variable, which is not initialized in template_preprocess_html(). I have also looked at template_preprocess(), and template_process(), but ...
1
vote
1answer
101 views

Storing variables in a theme outside preprocessing

I have some variables that I want to store in my theme, but I cannot always use theme_preprocess() to set and subsequently gain access to them. What is the best way to do this? I would like to not ...
8
votes
3answers
9k views

Custom theme function not being called?

I'm building a Drupal 7 module to create a bespoke field type. I've implemented all the required hooks. My hook_field_formatter_view() function looks like this: function MYMODULE_field_formatter_view(...
1
vote
2answers
2k views

Access to preprocess variables in a custom block

I have created a custom block to display some contact information. I have a preprocess function that sets a contact variable like so: function atstump_preprocess(&$vars, $hook) { $vars['...
1
vote
1answer
21 views

access node field variables in theming view-field

How can I access a filed value of the node that I don't want to display in the view, is there any way to pass the field variable in $fields using view but not include it in display, I'm just want to ...
2
votes
2answers
322 views

Attach different CSS styles on a node basing on publishing date or other PHP properties

I want to attach a different CSS style to a node, basing on the node publishing date or some PHP properties. What would be the best way to do this?
8
votes
2answers
13k views

Dynamically adding a CSS class to a view row with template.php

I've actually reached the bottom of Google trying to figure out how to add a css class to each row of a view. The trick is that I need the class for each row to be dynamically determined based on ...
0
votes
2answers
133 views

Templating a form

I'd like to change the template of a form that I created via a module but I do not know what I'm doing exactly as I have snippets of "information." For information, this form is in 'node /add/page' or ...
1
vote
3answers
469 views

Using a custom template in a theme

I have created the custom template page-org.tpl.page in the Zen theme, and I want to include this custom template file in the menu calling; when the user clicks on the Org link it should use the ...
0
votes
3answers
529 views

Custom block that's always the first thing in a region?

I'm trying to create a region for my Drupal 7 theme that will be clickable drop-down to allow the user to log in/out, access their profile page and a few of other things. The best analogy I can come ...
1
vote
2answers
1k views

Best way to add Vcard to node

I have a content type with CCK fields that make up contact information. I was asked to add a VCard / Add to outlook feature. I have a few ideas on how to do this but not sure which one is good. My ...
4
votes
2answers
2k views

How to use Google and Ubuntu fonts on Zen theme

How can I use Ubuntu font and Google fonts on Zen theme?
1
vote
1answer
860 views

Theming user-profile

I am on Drupal 7. Hi, I have installed the Devel module and I am using it to help me theme the user-profile.tpl.php. I want to show the e-mail information only when the user looking into the user info ...
1
vote
2answers
6k views

How should I name the node template files for my theme?

I'm a bit confused about how to name my template files. It's the first time I started to mess with templates in drupal 7 and somehow I don't get it. I want a template file that changes the behavior ...
3
votes
2answers
1k views

Can you do anything about the div soup?

All the sites I have seen that build on drupal looks like it's hit by div soup. There are so many unused divs produced by the content and some templates I have looked on contribute more by adding even ...
4
votes
5answers
1k views

path_to_theme() return “modules/system”

I am trying to render the theme logo as a block. When I call path_to_theme() in page.tpl.php, it returns a true path, but when I call it in modulename.module, it returns "modules/system".
12
votes
8answers
12k views

How to theme the views exposed form?

I've created a view with a number of exposed filters, but it is pretty ugly looking. I'd like to improve the theming, including wrapping the whole thing in a fieldset as well as grouping some of the ...