Omega and templates
hi
I am trying to create a table in views which has different colours for the rows according to the value of a field in user. At present this is either white or green if the user:field_paid is set or not.
Following the video of torontowebdeveloper on youtube I have created a tpl.php file in my subtheme templates directory and a template.php in the root of the subtheme.
The tpl.php seems to sort of work but does not have any impact on the targeted row or even a field apart from removing the value of the row or field. Though I can see the class in firebug.
Omega template.php vs. preprocess/process
From what I understand, the proper place to put code to alter a form is in hook_form_alter. So I created a function mytheme_alpha_form_alter() and put it in template.php. Everything works fine, however the comments in template.php suggest that I should keep that file "as clean as possible" and to use the preprocess and process subfolders instead. So in trying to do things the proper alpha/omega way, I created a file preprocess/preprocess-page.inc and did the form modification code inside mytheme_alpha_preprocess_page(). This also works, but sure seems ugly.
Read moreHow to programmatically test if a rule has ran.
I have set up a rule that triggers when a new content of a certain type is created. How is it possible to programmatically test if this rule has ran?
I have the following code
<?php
function nupostmark_test() {
$node = node_load($node);
$ntypes = node_get_types('types', $node);
$nodesaverule = rule_function_to_call_here;
if($nodesaverule !== NULL && $ntypes == 'plistings'){
drupal_set_message('you can set the variable now');
//set some variable to make available to template.php in phptemplate_preprocess_block
}
}
?>