Closed (cannot reproduce)
Project:
Footheme
Version:
7.x-3.0-rc1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 Nov 2012 at 10:23 UTC
Updated:
20 May 2013 at 16:29 UTC
Hi,
I'm using Footheme as a subtheme of Sky & generally, everything works great.
I'm trying to use a theme_preprocess_node() function to change the submitted text from the default set by AT. This is the function:
function mytheme_preprocess_node(&$vars) {
if (variable_get('node_submitted_' . $vars['node']->type, TRUE)) {
$vars['submitted'] = t('By !username on !datetime',
array(
'!username' => $vars['name'],
'!datetime' => date('j/n/y',$vars['changed']),
)
);
}
}
When I include this snippet in Sky's template.php, the submitted text changes. However, when it's in Sky's subtheme, it does not change. I've done all the cache clears I should and I can confirm that a dsm($vars); before the function closes (in the Sky subtheme) does suggest that $vars['submitted'] has changed. However, the submitted text that appears is the AT default.
Please tell me I'm not going mad!!
Matthew
Comments
Comment #1
mshepherd commentedBy the way, I'm successfully using a
theme_preprocess_page()function, but that's not trying to override anything from further up the chain.Comment #2
mshepherd commentedWell, today, it's working like it should. I have no idea why it didn't work yesterday and why it does today...
I'll reopen this if I notice it again.
Comment #3
mshepherd commentedI just flushed caches again after some node template additions to the theme and the submitted text has reverted back to the AT default.
Puzzled.
Comment #4
mshepherd commentedI'm still finding this happens, but I'm finding it hard to pin down under what circumstances as sometimes it behaves as expected. I'll close until I can reliably reproduce.
Comment #5
mrtoner commentedI've not been able to get theme_preprocess_node() or theme_process_node() to work;
dsm($vars)doesn't fire at all. A search of the API indicates that neither of these hooks is in D7, but I still see multiple users suggesting that theme_preprocess_node() is indeed where the submitted variable should be altered.Comment #6
mrtoner commentedOkay, just ignore. I don't know why
dsm($vars)doesn't work or why the API doesn't document the hook, but the function is executed when it should be.