Hi,
your module helped me out for several pages with various themes, but now I cannot get it worked with theme Barlow. Template.php code is:
<?php
function barlow_regions() {
return array(
'left' => t('left sidebar'),
'right' => t('right sidebar'),
'before_content' => t('before content'),
'content' => t('content'),
'header' => t('header'),
'footer' => t('footer')
);
}
function _phptemplate_variables($hook, $vars) {
switch($hook) {
case 'page': {
drupal_add_css($vars['directory'] . '/layout.css', 'theme');
drupal_add_css($vars['directory'] . '/typography.css', 'theme');
$vars['styles'] = drupal_get_css();
}
case 'node':
if (count($vars['node']->taxonomy)) {
$vars['terms'] = t('Tags: !tags', array('!tags' => $vars['terms']));
}
if ($vars['submitted']) {
$vars['author'] = t('By: !user', array('!user' => theme('username', $vars['node'])));
}
break;
}
return $vars;
}
How can I modify it that it will work with this great module?
Thanks,
mauk
Comments
Comment #1
nicholasthompsonchange _phptemplate_variables function to:
Comment #2
nicholasthompsonComment #3
mauk commentedHi,
thanks page_title now works, but get errors. I have changed template.php to:
But now getting following error alert, if I try to log-in:
What is wrong?
Thanks for your very good support!
Mauk
Comment #4
mauk commentedComment #5
mauk commentedBy the way, I am using Drupal 5.10
Kindest regards,
mauk
Comment #6
nicholasthompsonwhat is you php error level? I believe drupal requires E_ALL ^ E_NOTICE. Its possible something is causes a notice error which is interrupting the redirection...
Its rather odd, I've never had that error! I'll take a look.
Just a thought: Do you have a blank line of whitespace at the top of template.php BEFORE the php opening marker?
Comment #7
mauk commentedHi,
no, not any blank line nor whitespace.
Its possible something is causes a notice error which is interrupting the redirection... - Correct.
If I log-in I will be not re-directed to page, only "white" site appears without any content, etc. If I delete php-code for
page_title everything is fine.
I repeat complete php_template:
I noted that there is no closing PHP-tag but if I delete php-function of page_title it works fine, even without this closing tag. Any idea?
Thanks
Bernt
Comment #8
nicholasthompsonThis is VERY odd!
I'll have to take a look through the code, but to me it sounds like something it outputting a white-space before the code.
template.php should NOT have a ?> at the end. Strange how PT2 is doing this...
Comment #9
mauk commentedHi,
no white-space. Really strange. I never had any problems with your module. May be problem of Barlow?
Bernt
Comment #10
mauk commentedHi,
I think the problem is the "double" template.php. One was included in my theme directory and one comes with your module. So I deleted module template.php and now it works.
Thanks for your support.
Bernt
Comment #11
nicholasthompsonThats incredibly odd... Thats NEVER been a problem with any other sites. I wonder what 'Barlow' does... I'll have to investigate that one day.
Comment #12
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.