Questions tagged [drupal-theming]

In Drupal terminology, "theming" is rendering or modifying the HTML markup produced by a module or a theme.

Drupal theming system allows a theme to have nearly complete control over the appearance of the site, which includes both the markup and the CSS used to style the markup. For this system to work, modules, instead of writing HTML markup directly, need to return render arrays, which are structured hierarchical arrays that include the data to be rendered into HTML (or XML or another output format), and options that affect the markup. Render arrays are ultimately rendered into HTML or other output formats by recursive calls to drupal_render(), traversing the depth of the render array hierarchy. At each level, the theme system is invoked to do the actual rendering. See the documentation of drupal_render() and the Theme system and Render API topic for more information about render arrays and rendering.

Reference

822 questions
3
votes
1 answer

Drupal 7 not showing sub menu

i am new to drupal and creating custom theme, i am using Main Menu but it is now showing sub-pages, i am using following code to show. print theme('links__system_main_menu', array('links' => $main_menu, 'attributes' => array('id' => 'main-menu',…
mian ji
  • 297
  • 1
  • 8
  • 16
3
votes
2 answers

Drupal: Render a view from admin using frontend theme

Does anyone know a way to programmatically render a view from a module using the default theme after editing a node? I'm basically trying to create a static html page of a view. I have the following code in a custom module: function…
David
  • 201
  • 2
  • 8
3
votes
2 answers

I want to place 2 forms in a single custom page in Drupal 7

I am completely new to Drupal am trying to create a single page that contains 2 forms (that come from a custom module). I also want this page to be a dedicated file in my theme directory. In the custom module called "vocabt" I have vocabt.module…
Rees
  • 1,757
  • 9
  • 33
  • 50
3
votes
2 answers

Create a custom template file for a custom block in drupal

What is the drupal way to create a custom .tpl file for theming a custom block? Specifically I m trying to create a block programmatically and then find a way to separate the view code from the module php code. If it was a page the Drupal theme()…
Nikos Tsagkas
  • 1,287
  • 2
  • 17
  • 31
3
votes
1 answer

Drupal 7 using different themes on pages using omega and delta

Can I use different sub themes on different pages. I have created two omega sub themes - Theme 1 (set as default) and Theme 2. Can I now assign Theme 2, to a set pages using the delta and context module? I created a delta theme based on Theme 2,…
3
votes
2 answers

How to add Specific Class to Each Drupal Menu Anchor

I am developing a website using drupal and i need to know about how to add link to drupal menu anchor. For example: i have a drupal menu: user menu. Within user menu, i have several list of links, let's say: A, B, C, D. Then, i want to add class/id…
user1814734
3
votes
1 answer

Warning: Cannot use a scalar value as an array in include()

In order to theme a specific page in my site, I created a file called node--2.tpl.php. Per some other tutorials I read, I added this to my template.php file: function mtheme_preprocess_node(&$vars) { if (request_path() == 'node/2') { …
KinsDotNet
  • 1,500
  • 5
  • 25
  • 53
3
votes
1 answer

Better way to overide content page in drupal

I am creating custom content pages using this function in my template file function myTheme_preprocess_page(&$var, $hook) { if (isset($var['node']->type)) { $var['theme_hook_suggestions'][] = 'page__' . $var['node']->type; } } Then I am…
rowan.t
  • 187
  • 1
  • 10
3
votes
1 answer

Drupal Sandbox git repository so big? ( pack file size: 21MB)

I have uploaded Drupal theme in sandbox. My total theme file size is less than 1MB, but inside .git folder have pack files (file size is 21MB). How to reduce pack file size? git gc git repack git verify-pack -v .git/objects/pack/pack-*.idx But…
shanidkv
  • 1,118
  • 1
  • 9
  • 12
3
votes
1 answer

own theme in module

I am writing module for drupal 7. Module generates block and item list inside that block['content']. When i am using standard theme('item_list', array('items' => $items)) everything works, but when i want to define my own theme which will be used…
Ian J
  • 613
  • 1
  • 5
  • 6
3
votes
1 answer

How to make the main menu like Stackoverflow in drupal 7?

How can I custom the output menu like stack in drupal 7. The main menu link appear above and the sub-menu link appear below, or some menu styles like this. In Bartik theme, the $main_menu variable only content primary menu information but no child.…
Kevin
  • 1,403
  • 4
  • 18
  • 34
3
votes
5 answers

Drupal 7: Template for user registration page?

How would I make a template for the user registration page? I want to theme the entire page, not just the form. I've tried page--user-register.tpl.php but that does not work.
Dustin
  • 4,314
  • 12
  • 53
  • 91
3
votes
2 answers

Drupal - alt tags on images

I'm using Drupal 7, notably the Image field and the Media file selector widget to upload images. The biggest problem is that these images do not have alt tags when viewing the HTML source on the frontend. Is there a way to display such images to…
terrid25
  • 1,926
  • 8
  • 46
  • 87
3
votes
1 answer

User template with recent posts

I'm developing a custom theme for Drupal 7. My problem is I don't know how to make a page that shows information about the author, and below the info, a list of the author's articles. (For ex. if I go to user/ i want to see the profile of the user…
Zoltán Seer
  • 63
  • 1
  • 6
3
votes
2 answers

Why is my specific page tpl.php not being used?

I can't seem to use a unique page--xxxxxxx.tpl.php for a specific page. I created a "page" content, filled it in, and gave it a path alias. Let's say: "mypage/mycontent". Then I created a page--mypage--mycontent.tpl.php file in my theme's root.…
user985219
  • 243
  • 1
  • 2
  • 10