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
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
395 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
888 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
874 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
529 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, ...
8
votes
3answers
9k 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
694 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
42k 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 ...
5
votes
1answer
3k views

Remove specific stylesheets from a given page

Adding a stylesheet to specific pages is easy: implement hook_preprocess_page(), call drupal_add_css(...) and set $vars['styles'] = drupal_get_css(). But what is the proper way to remove a stylesheet ...
1
vote
1answer
422 views

Printing a content pane with Printer, Email and PDF versions Module

I'm trying to determine how to add a content pane with an argument to a custom tpl.php file that is adding some other things to the print version. I've done this before with a block, adding in the ...
5
votes
2answers
2k views

Best method for custom login/register

I want to create a custom login and register page. I want both forms to show on the frontpage in the content area of my template above each other and not on separate nodes. Also, I would like to try ...
3
votes
3answers
3k views

How should I upgrade a customized theme?

I have made some custom changes to my theme files template, CSS and tpl files. Is there a best practice method of updating the theme besides going line by line and re-inserting my custom changes after ...
9
votes
8answers
5k views

Theme for mobile devices

I want parts of my site to be accessible to Android, iPhone and other mobile platforms. Is there a particular theme I should start with, or anything I should look for in a theme besides it being clean ...
2
votes
2answers
2k views

How do I load a library defined with hook_library() on node/edit pages?

I've defined a library of JavaScript files and CSS files required for my module to function using hook_library(). How do I go about loading this library on node/edit pages?
12
votes
3answers
8k views

How do I convert a Wordpress theme?

I googled, but I didn't find any automated solution. So, I've started it manually. Mapping CSS files is easy, but I'm looking for a way to map blocks/templates. Please, help.
5
votes
2answers
7k views

Theme Drupal Form API checkboxes as a grid

I have a custom form that displays a form element of about 2 dozen checkboxes. I would like to output them 3 per row, in a table if possible. How can I go about doing that? $form['preference'] = ...
5
votes
4answers
3k views

Remove colons from Drupal form fields/labels

How can I remove the : from appearing after every label in forms made with the Drupal Form API?
11
votes
4answers
6k views

Candidate page template filename for particular custom content type entry

I'm working on a Drupal 7 website. I created custom content type for works. I have many fields, and some of them are related to page layout like particular page bg for each entry. So I need custom ...
49
votes
7answers
57k views

How to a use a template file to theme a form?

While nodes, comments, blocks and many other things in Drupal are themed using theme template files (like node.tpl.php), forms are a different story. There are no theme template files for forms. How ...
5
votes
3answers
2k views

Views Slideshow vs list View+jquery cycle lite?

The rotating images on my work site's home page are created as a View in list format. I'm using the jQuery Cycle Lite plugin for the rotator effect. The cycle.lite.js file is set in the scripts array ...
10
votes
5answers
17k views

hook_preprocess_page(): how to tell a views page?

Im writing a custom module that need to insert some javascript and css files only in a Views page. Im using hook_preprocess_page, but I can not tell if the current page is from a view: function ...
3
votes
2answers
315 views

How to handle blog tags in a contrib theme?

In blog or blog-like sites, taxonomy is often used for tags and categories. In Drupal 6, node.tpl.php files could use the $taxonomy variable if they needed access to an array of unrendered taxonomy ...
4
votes
2answers
4k views

How to override single function of theme's template.php using sub-theme?

Target: Drupal 7 Sub-Theme Development I don't want to override whole template.php file. I just want to override single function of template.php file.
22
votes
6answers
15k views

Correct way to change the active Drupal theme programmatically?

What is the correct way to change the active Drupal theme programmatically?
58
votes
6answers
85k views

How do I create custom regions in a theme?

I want to add a new area which will be site wide. Describe the process of getting this new region into my theme, if possible generalize it for adding any new, custom region.
78
votes
14answers
50k views

Any way to add CSS for a single page/node?

I'm cleaning up my big crazy style sheets (possibly pertinent to a future question) and I'm wondering the best way to add custom CSS to a specific node or page. In particular, my work site's home ...
5
votes
1answer
4k views

Override comment.tpl.php file with theme

Objective: Override comment.tpl.php file output in drupal core modules. Assumption: My best guess is that I need to create a comment-[type].tpl.php file in my themes folder. Requirements: template....
2
votes
1answer
730 views

How should I create a main page with a mix of dynamic and static content?

I apologize for the terribly basic question but I'm not even a particularly adept web dev. I've read that Drupal is great if you know exactly what you want to do (then the API is handy) but I don't ...
4
votes
4answers
169 views

What are the limitations of the theming system?

Can every theme function in include/theme.inc be overridden by a template (*.tpl) file? Can preprocess functions be used to add variables to any theme function?
1
vote
4answers
370 views

Can I import the current look of my website to Drupal?

I currently have an homemade CMS running on the backend of a large file distribution site. The site has to look like every other sub domain, but is the only section that requires a CMS behind it (if ...
7
votes
4answers
4k views

Sending a value to JavaScript

I have set theme handler for a form in Drupal and this handler has a template file. What is the easiest way to send a value from PHP to JavaScript in that include file?