By pruner on
is it possible to customize the "Submitted by" line for different types of nodes?
for instance, I would like forum topics to say "Posted by..." since users can post them without approval; and book pages to say "Submitted by..." since they go into the queue.
I've been hacking my way through the Xtemplate theme, so far to no avail.
Comments
Try this
You might find this thread helpful.
not what I'm looking for
that thread only deals with hiding the "Submitted by" line for a particular node type... not customizing it for different types.
Change the following lines in
Change the following lines inside xtemplate.theme under function xtemplate_node():
$xtemplate->template->assign(array(
"submitted" => t("Submitted by %a on %b.",
array("%a" => format_name($node),
"%b" => format_date($node->created))),
switch ($node->type) {
case 'page':
$xtemplate->template->assign(array(
"submitted" => t("Submitted by %a on %b.",
array("%a" => format_name($node),
"%b" => format_date($node->created)))));
break;
case 'story':
case 'blog':
case 'forum':
$xtemplate->template->assign(array(
"submitted" => t("Posted by %a on %b.",
array("%a" => format_name($node),
"%b" => format_date($node->created)))));
break;
}
This is untested, but i'm pretty sure this should work...
changing the lines didn't work
it caused a parse error.
what did work is adding the lines you suggested:
just below this:
above this:
thanks for your help. :-)