The preprocess functions are functions that are executed directly before a theme function is invoked.
0
votes
1answer
21 views
Overiding custom page variable in drupal 6
I am working with drupal 6. I have created a template file page-classifieds.tpl.php for a classified page(menu). I would like to override variables of this particular page preferably using a ...
0
votes
2answers
30 views
Use mytheme_preprocess_block() to display HTML (icon fonts) in block titles
Unfortunately, HTML commands in block titles are not being rendered. I would like to be able to add icon font symbols to my block titles by adding comands like <i ...
0
votes
1answer
22 views
access field data in template.php and create variable for header image in page.tpl.php
I am trying to allow the user to set a custom image to display in the header on node pages that have a header_image field and to display a default header image on all other pages (including system and ...
1
vote
2answers
39 views
Add theme_hook_suggestions only for nodes in content
I am developing a blog with different categories (taxonomy terms) and I wanted to have custom node templates for the nodes displayed on the blog page and category pages. Because my blog page has a ...
1
vote
2answers
33 views
function theme_field__content_type() isn't working
I'm trying to modify all fields output for a specific content-type called Netrunner-Card.
After digging through Stack Exchange I ran across someone that suggested using:
function ...
0
votes
3answers
110 views
Preprocess function for node.tpl.php file
I've watched a million videos and read a million tutorials trying to figure out how to create a new variable for use in a version of a node.tpl.php file by utilizing preprocessing functions, but can't ...
1
vote
2answers
40 views
How to access $vars['some'] variables in html.tpl.php template
In the template.php, I am using the following code for mytheme_preprocess_page().
// Return nid for node of type "interface_configuraitons".
$nid_config = db_select('node', 'n')
...
0
votes
1answer
16 views
Need to change node's path to CCK value
I have a content type that has been turned into a Feature named "Earth News". It includes an optional CCK field called "Source URL". When that CCK field is not blank I want the site visitor to be ...
2
votes
1answer
41 views
How to add classes to h2 block title tags in sidebar region
I need to add a class to the h2 block titles in a sidebar. How can I do this in pre-process? I haven't been able to find an example that shows how to isolate certain blocks. I'm using Omega.
0
votes
0answers
20 views
How can I combine the output of two seaparate fields in template.php?
I have two fields displaying multiple values from select lists. The first field's a term reference field, the second's a text list. So,
print render($content['field_term_list']) produces
Term1
...
1
vote
1answer
48 views
Add content type machine name to an attribute in the body tag?
I figured this would be easily done in the template_preprocess_html function, but I haven't found a way to do it... yet.
I need to add the content type machine name to a "data-init" attribute in the ...
1
vote
2answers
46 views
drupal_match_path() for multiple wildcard patterns?
I want to add some CSS and JS to multiple matched wildcard URL patterns. According to Add javascript to multiple specific urls, I can use a wildcard using drupal_match_path() and that works well for ...
1
vote
1answer
51 views
How do I specify an image style in my preprocess function?
In my current project, whenever a node's image field is empty, I'm filling it with the image from an entity referenced in the node. To pull this off, I'm using this magical piece of code in ...
0
votes
0answers
32 views
Using book navigation links in template
I want to customize my book pages and I created a page which is called node-book.tpl.php Now I want to print all book navigation links separately. For example I want to print $next_link. But I ...
1
vote
1answer
26 views
Modify instead of add a class in classes_array for theming purposes
I am using the following preprocess in my template.php
function paddle_admin_preprocess_menu_block_wrapper(&$variables) {
if ($variables['delta'] === 'management_level_2') {
...
0
votes
0answers
15 views
Integrating Galleria module and Flag module
I had some success integrating Galleria and Flag module, so users could vote on pictures."Integration" is done on template level, there is module provided galleria-container.tpl.php where I did ...
0
votes
1answer
67 views
Insert navigation links into new Drupal Calendar item confirmation screen
I've looked everywhere but can't find an answer to my question. I've also posted this question in the Drupal Calendar issues forum, but haven't gotten an answer (http://drupal.org/node/1939914). I got ...
0
votes
0answers
258 views
Anyone using Unsemantic CSS grid system?
Has anyone tried using the Unsemantic CSS grid system in Drupal 7? It's a fluid grid done by the same people who did 960.gs. I'm using preprocess functions (mostly for blocks) to apply the grid ...
0
votes
1answer
34 views
Add div after each field of a certain name
I'm trying to display a div container after each field item with the name additional_content of my page content type. Right now im trying to preprocess my field but i can't go down to the real field ...
0
votes
0answers
86 views
Populating the $variables['classes-array'] in preprocess_html function
It seems most likely that the following code is not working due to bad php but I just can't understand why. If I var_dump $variables['classes'] it returns that it is an array with the classes listed ...
0
votes
0answers
30 views
Reorder view results by field view value
Is it possible to reorder a view's results by the value of a field view (an embedded view as a field)?
I'm talking about those field views, I'm tagging hooks in case there is an option of doing this ...
1
vote
2answers
113 views
Help with node and field theming
I am not particularly new to programming, but trying to theme how Drupal 7 outputs entity fields is giving me headaches. I think Drupal is great, but the documentation could be more organized and ...
2
votes
1answer
65 views
How can I add variables from a preprocessor function to be used in an unformatted view template?
The variables I'm adding in my preprocessor function are not visible in the template for the unformatted view I've written. This seems to work fine if the template is formatted (the default).
That ...
0
votes
1answer
29 views
My MYMODULE_config_preprocess_node(&$variables) is not displaying my variables
I have 2 modules both implementing the same hook: hook_preprocess_node()
What I do is basically the same in both:
function MYMODULE_preprocess_node(&$variables) {
$stuff_to_display = ...
3
votes
1answer
83 views
how to define entity preprocess function
My custom module defines a custom entity, which extends the EntityAPIController class. I managed to make it basically working, i.e. displaying fields etc via my custom tpl.php file. But I would like ...
0
votes
0answers
59 views
How to get thumbnail location for video in preprocess
I am trying to populate the thumbnail generated for a Video on the actual Video node page along with the video itself. I assume best way to do this is get the thumb location in preprocess and then ...
0
votes
0answers
63 views
How to implement template_preprocess_page and template_preprocess_taxonomy_term?
I am trying to implement
template_preprocess_page and template_preprocess_taxonomy_term.
I implement them in my template.php file after having replaced template by my theme name, but the functions ...
0
votes
1answer
69 views
HTML Special characters in preprocess
I'm trying to add a bullet to a string in _preprocess_node() and am running into problems.
I am using Drupal 7.
My code is as such:
if($node->type == 'contact_page'){
...
2
votes
0answers
53 views
What preprocessor should I use?
I'm trying to make signature.tpl.php available to spam filters (by default it is not).
Will adding a preprocess hook to template.php will do the trick?
If so, what preprocess hook should I choose?
...
1
vote
2answers
122 views
How to access the raw content of a views field, for use with Services Views
I have a user that I want to expose to services. Using Services Views. I'm using fields as the format, and adding the "photo" field to my display. My issue is that when I view the service (as JSON). I ...
0
votes
2answers
64 views
theme ALL form elements in a tpl through hook_preprocess_HOOK
Trying to theme a form into all the pieces available, passed my $form and $vars through hook_preprocess_HOOK but in my tpl i would like the exact render() representation of the fields and variables ...
0
votes
1answer
89 views
Menu block module overrides
I'm really confused with how to theme menus in Drupal 7 and I've found the Menu block module which is supposed to makes things simpler. Turns out it's not that simple for me.
I've created a Menu ...
0
votes
0answers
13 views
Custom tpl.php based on taxonomy [duplicate]
Possible Duplicate:
Change TPL file based on taxonomy term
I am trying to create different templates for a specific node type based on taxonomy.
I created a node type called "publication" ...
0
votes
1answer
77 views
template preprocess override not respected
I'm using Drupal 7.
I have a template preprocess function overridden in my template.php as
It does not alter the output as desired.
When I comment out (or delete) the original preprocessor ...
4
votes
1answer
334 views
Remove/Hide the block if the View is empty?
Is there any API to know if the block is empty? Basically what I'm trying to do is to hide/unset the block inside template_preprocess_page.
Here is my currrent code:
if ...
0
votes
1answer
340 views
Hide fields on the user profile page with preprocess function
On the user profile edit page I can do something like this in my theme's template.php file to hide a field:
function MYTHEME_form_user_profile_form_alter(&$form,$form_state,$form_id){
//remove ...
0
votes
2answers
91 views
How to override the default zen html template depending on a node type?
I have a themes which inherit from zen template. The zen template has an html.tpl.php, and I would like to override that html.tpl.php for one content type.
Let's say my theme name is test and my ...
1
vote
1answer
252 views
Drupal 7 Views: Use one views.tpl.php file for multiple views
Views allows you to customize output with tpl.php files.
My theme directory is getting overloaded with the .tpl.php files! Many of the files repeat the same content.
I would like to use the same ...
-1
votes
1answer
27 views
Are proprocess functions cached?
I'm using a MODULE_preprocess_node function to modify the node template and I'm experiencing strange things.
Basically my idea was to prevent anonymous users from commenting more than once. In the ...
2
votes
0answers
414 views
How to add a preprocess function in Omega theme?
Omega theme has a singular way to add preprocess functions.
I need to add this preprocess function to be executed when a view is rendered:
function ...
3
votes
1answer
228 views
How to use template_preprocess_views_view to pass a variable to a views tpl file
Since the case re-occurred to me for the second time recently, I decided to ask the question so to perhaps learn something.
In Views, the main display title (the one that usually gets rendered at the ...
0
votes
1answer
88 views
Change size of views exposed form search box
Im using hook_preprocess_views_exposed_form to change the output of my views exposed search box. I am able to successfully change the text on the search button, but I am not able to change the size. ...
1
vote
2answers
214 views
How to use the right menu_tree and menu_link depending on region
How can I have specific menu_tree and menu_link for specific region?
Example:
left region will have his own menu_tree menu_link which will be different from the right region.
How can I achieve ...
0
votes
1answer
74 views
theme_preprocess_node not working inside of a view
I'm trying to add a variable to the $classes array on a node, but it's not adding it while the node is in a view.
function MY_MODULE_preprocess_node(&$vars, $hook) {
// Add the terms to the ...
0
votes
1answer
89 views
Change the heading User Accounts in user Registration Page
I am trying to change the heading in User Registration Page from User Account to Registration.
I tried pre-processing, but in the page variable title is empty and I can only see rendered html.
I ...
0
votes
0answers
39 views
'Undefined Index' Error in *.module
How can I display dsm($text_form) to see all form elements? This is from my custom module. I have created the form elements in my module file, but I still want to see the form elements as a dsm(…) to ...
0
votes
1answer
107 views
Making $logo variable available in custom template
In the template-folder of my omega-subtheme I have placed a custom views-filter-block--front.tpl.php. I want to make $logo, $logo_img and $linked_logo_img as defined in the omega/template.php file of ...
1
vote
3answers
219 views
Undefined index: und in mytheme_preprocess_page()
I created a custom image field for a banner in one of my content type. I wish to display this banner in the page.tpl.php instead of node template. Here's my code in template.php:
function ...
0
votes
1answer
85 views
Error in Submit handler for custom node add form
Trying to theme my own node add form with hook_theme() in my own module. In the *.tpl.php page for the node add form, submit button is not actually adding the content to database.
Issue: Why is "php ...
0
votes
1answer
19 views
Why my stylesheet won´t load into my node/add forms? (D6)
I wanted to have a special template for all my node/add forms, in my Drupal 6 installation.
So, I´ve added this code to a little module:
function modding_preprocess_page(&$vars, $hook) {
if ...