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
3
votes
3answers
2k views

Conditional class on <html> element a la boilerplate

This might be a totally mundane question, but I hope not. I want to add conditional classes onto the <html> element of my theme like boilerplate. I'd like to keep things neat and not complicate ...
3
votes
1answer
4k views

hook_theme_registry_alter() and theme()

How can hook_theme_registry_alter() associate, for example, theme_mymodule_image_output() with the 'image' theme ID?
1
vote
1answer
113 views

Is there a function or a way to invoke the comment object?

I want to use the $comment object in page.tpl.php. Is there a function or a way to use it?
2
votes
4answers
4k views

Is there a function that can output an image?

[field_img] => Array( [0] => Array( [fid] => 200 [list] => 1 [data] => Array( [alt] => [title] => ) [uid] => 1 [filename] => cpon.jpg ...
1
vote
1answer
592 views

Which pages affect text area CSS?

I have a text area with CKEditor. The default font in this text area and my theme is 20 pixels and I cannot change its size with CSS, but if I change theme and use Garland, the font change to the ...
7
votes
8answers
4k views

Rewrite CCK field output without using templates

The Views module has the nice option to rewrite the output of a field. This allows to adapt the output of CCK fields using Tokens without having to create a template for that view. Is there a module ...
1
vote
1answer
279 views

How do I overwrite the variables in my theme?

function rate_preprocess_test(&$variables) { extract($variables); $buttons = array(); foreach ($links as $link) { $button = theme('rate', $link['text'], $link['href']); $button .= $...
1
vote
2answers
6k views

How to create a menu with background images for list items?

How would you make a menu that have a different background image for each <li> element in the menu?
1
vote
2answers
2k views

How can I remove old polls/results in Drupal 7?

How can I remove the links to old polls and results in Drupal 7? I unset view results for anonymous users, but they still can view results. I'd like to remove the link to old polls and poll results in ...
0
votes
2answers
353 views

Good looking contributed themes for Drupal 6

I am looking for good looking contributed themes fro Drupal 6. Drupal.org is filled with themes, although several of them lack support even for the most used modules (taxonomy, search, comment) and ...
11
votes
2answers
18k views

Preprocess variables only for certain blocks

Is it possible preprocess variables only for certain blocks? I have created such function: mytheme_preprocess_block__aggregator(&$vars) but it doesn't works. -- EDIT -- It seems to be fixed in ...
1
vote
1answer
180 views

Why can't I output it?

stdClass Object( [nid] => 98 ....... [title] => hello world! [body] => ........ [field_img] => Array( [0] => Array( [fid] => 200 [list] => 1 [...
4
votes
4answers
3k views

How do I use a different template for the anonymous users?

If the user is the anonymous user or an authenticated user, I want to use the page1.tpl.php; with other roles, I want to use page.tpl.php. How do I write the code?
5
votes
3answers
3k views

Using a different administration theme according to the role

Is there a way to use different administration themes according to the roles assigned to users? I have two roles (admin, editor), and I want that, when creating content, users with the admin role use ...
2
votes
1answer
442 views

Questions about theming a node

I am theming a specific node type in Drupal 7. I have named my file node--mynodetypename.tpl.php. Everything is fine and I can override the default node template; the issue is that I want to do very ...
2
votes
1answer
3k views

Filename for the front page template file

How do I create a theme for the front page only? I only want to change what is in the content area but leave the rest of the stuff the same from page.tpl.php.
7
votes
5answers
4k views

How to Rename “Request new password” link?

We want to rename the "Request new password" text on a Drupal's login page to some custom text. In the user.module file, I see that this text is hard coded if (variable_get('user_register', 1)) { ...
4
votes
6answers
12k views

How do I insert a <span> </span> tag inside the <a> </a> tag on my main menu

I have asked exactly this question on Stack Overflow, but it makes more sense to ask it here. I'm trying to make the text between my tag not display by wrapping it in a and then styling that. I've ...
3
votes
1answer
610 views

The theme is broken when I enable the “Optimize CSS files” option

The theme I made is broken, when I enable the "Optimize CSS files" option. I have cleared the cache, but the theme still doesn't work. With Firefox and Internet Explorer it is OK, but with Google ...
3
votes
2answers
559 views

usage of theme_more_link in zen template.php

I have tried to change the text in the 'Read more' link by putting: function myzen_more_link($url, $title) { watchdog("template.php","myzen_more_link"); return '<div class="more-link">' . ...
2
votes
2answers
1k views

Preprocessing a front page block causes errors on other pages: why?

I'm currently working through self-set tasks to learn Views and pre-processing in Drupal 7. I've created an unformatted view which creates a list of images (which are linked to a content-type but it ...
2
votes
3answers
402 views

Alternative themed forms for a single custom content type

On a site I would like a "quick entry" form for a custom content type on the front page, while also keeping the "normal" non-customized "node/add/mycontenttype" form. I'm able to customize the "normal"...
3
votes
2answers
1k views

How to do taxonomy based css styling using template.php?

I'm looking forward to implement taxonomy terms based CSS styling; especially for the body tag which I want to add the current terms. Here is what I have so far: function _phptemplate_variables($...
3
votes
2answers
2k views

What are the array keys of $content that can be hidden?

I see that with drupal 7 theming, we can mark elements of the $content array as hidden. From http://drupal.org/update/themes/6/7 : <?php // We hide the comments and links now so that we can ...
3
votes
2answers
822 views

Views as definition list?

Is there a way to output the content of a view as a definition list? Example: <dl> <dt>Nodes title</dt> <dd>Nodes content</dd> <dt>Another nodes title</dt&...
12
votes
3answers
17k views

Page template suggestions are not working

I've created a theme and have my template files in this structure /templates/page/page.tpl.php /templates/page/page--node-type.tpl.php I've created a custom page template but for some reason it's ...
4
votes
2answers
400 views

Why should you use theme(), rather than calling the theme functions directly?

Why should you use theme(), rather than calling the theme functions directly? theme('box', $title, drupal_get_form('comment_form', $edit, $title)); Why doesn't the code call the theme function ...
2
votes
2answers
2k views

Is there a module? Or: How to alter the Drupal pager to get this?

I want to add to alter the output of theme_pager(), and add a <li> tag, as the following: <li class="pager_go_input last">to <input type="text" id="pager_go_input_1" class="form_text ...
1
vote
1answer
4k views

I want to modify the drop down menus for Marinelli (a Drupal theme)

I have the Marinelli menu setup in a website I am internal testing. I want to modify the drop down menu (I know it uses jQuery), but I have no idea what to do to show the drop down all nested. In ...
1
vote
1answer
125 views

Alter submitted by text and retain RDF tags

I am looking to change the submitted by text from: <span rel="sioc:has_creator" datatype="xsd:dateTime" content="2011-03-20T22:54:29+13:00" property="dc:date dc:created">Submitted by <a ...
3
votes
2answers
890 views

Different style when listing nodes and displaying a single node

I'm new at Drupal, coming from the PHP framework world, and I'm having some problems understanding the the template hierarchy in Drupal 7. I've created a template called 'node--article.tpl.php' and ...
2
votes
1answer
1k views

Detect the taxonomy term(s) of a node from within a template file

I have a Drupal 7 site with a content type of event. I have a taxonomy called "event types" that has 5 options (Party, Conference, Meeting, etc) I have one template named node--event.tpl.php for ...
2
votes
3answers
3k views

moving *.tpl into “templates” folder, but Drupal does not recognize them. How?

I am building a custom theme. Currently, I put all the overridden *.tpl files under the theme root folder; it would be more clean and meaningful to put those files under "mytheme/templates", but ...
1
vote
1answer
884 views

In which cases should hook_process() and hook_process_HOOK() be used?

Considering that some modules implement hook_process() to alter the content of some variables and replace their content with themed content, in which cases should a module implement hook_process() ...
6
votes
2answers
8k views

How do I override a default view template from another module?

Drupal provides hook_theme(). But is there a hook_theme_alter()? I'm looking for something like hook_menu_link_alter(), which overrides hook menu entries, but for the theme. I want to modify a view ...
3
votes
2answers
2k views

Creating a view block inside a fieldset using templates

I am trying to create a new .tpl.php for some of my views. I know how to create the file and display the elements the way I want, but only by changing the default views-view.tpl.php which would ...
7
votes
2answers
6k views

How do I put a logo into a block?

I have tried to put this code in custom block with input formated to PHP code: $settings = theme_get_settings('my theme'); if (!$settings[toogle_logo] = 0) { print '<img src="' . base_path() . $...
1
vote
3answers
1k views

Variables used in template.php

How should I know which variables and objects can be used directly in the template.php file?This is what a template.php file created by somebody else contains: function garland_separate_terms($...
2
votes
1answer
531 views

How to adjust the display order

The HTML structure is the following one: <div id="contentp"> <p>.........</p> <p>.........</p> <div id="rate-node-18-1-1" class="rate-widget rate-...
1
vote
2answers
2k views

Fields in page.tpl.php

I want to display in my page.tpl.php 3 custom fields form the latest content type added to my website. I have a custom content type called "Articles" with three custom fields, field_1, field_2, ...
7
votes
3answers
10k views

Views 3 and HTML5 - how to override output for markup?

I have a view that I've created that selects blog posts based on a specific taxonomy term, creating a sort of "Featured Posts" view that I've embedded on the front page of my site. The issue I keep ...
6
votes
3answers
3k views

How to structure theme folder to make it more manageable?

So far, I've been able to put page, node, field and block templates in their own separate folders. My idea is that Drupal needs to find the main original tpl file (ie page.tpl.php) in a folder and ...
5
votes
3answers
696 views

Change $<field_name>_rendered output?

In a node I get the values of CCK fields as $ array or $_rendered as the rendered view of the field. How can I change the $<field_name>_rendered from its default way of rendering?
3
votes
4answers
3k views

How to hook theme of the main system menu in drupal 7 to display only some of the elements?

I want to modify the main system menu in Drupal 7. Actually I want to display only some specific elements of the menu and hide some other specific elements, in a given case (which I will implement by ...
38
votes
9answers
44k views

How do I change a theme based on the URL?

I have a Drupal instance running on example.org. Which has a theme X installed and activated. Now for a limited period an event is supposed to be held on the site for which a special section has been "...
7
votes
2answers
3k views

What is the equivalent of theme_menu_item in Drupal 7?

I know that in drupal 6 exist: theme_menu_item, but in drupal 7 there is not. Is there any replacements so that I modify the output for main system menu ? Actually I want to do a kind of filter of ...
3
votes
2answers
4k views

How can I use conditional logic to not display a <div> in page.tpl.php based on node id?

I'm using a theme that has regions not supported by Panels' "Disable Drupal blocks/regions" settings. I've tried to remove the using an if statement in PHP, but either my PHP syntax is wrong or I'm ...
2
votes
2answers
3k views

hook_preprocess_page: “node_load() + node_page_view()” versus “%node + node_page_view()”

A basic node (nid "123") exists and a module registered two paths using hook_menu: first/%node second Both page callbacks use node_page_view($node) to display a fullpage view of the node, except ...
2
votes
2answers
2k views

How to increase the width to the Omega sub-theme more than 950 usable pixels

I have created a new sub-theme of the Omega theme (version 7.x-2.1) in Drupal 7. But I want to use 970 usable pixels instead of 950 pixels as the sub-theme offers in "Default container width". How ...
4
votes
4answers
5k views

Overriding a View table layout in module

I'm trying to override a view table from within my module. I can't locate what the arguments are suppose to be and in what order (for my hook_theme func). I copied the theme file from views/themes and ...