[themes] include external code in theme function
Farsheed
tfarsheed at yahoo.com
Wed Dec 20 19:01:27 UTC 2006
You can add styles in an easier way:
$path = path_to_theme();
theme_add_style( $path.'/style.css');
http://api.drupal.org/api/4.7/function/theme_add_style
--- Mark Hope <mark at markhope.net> wrote:
> I'm trying to override the theme function for
> mimemail_message, to
> include css code for a html email.
> Basically I'm looking for the easy/lazy way of
> outputting the
> newsletter.css from an include file.
>
> My feeble attempt that doesn't work...
>
> /**
> * Themeable message body for newsletter
> */
> function phptemplate_mimemail_message($body) {
> $output = '<html><head><style
> type="text/css"><!--' ;
> // include a stylesheet specifically for the
> newsletter
>
>
include_once("$_SERVER[DOCUMENT_ROOT]/mysite/modules/contrib/
>
> simplenews/newsletter.css");
> $output .= '--></style>';
> $output .= '</head><body id="mimemail-body">';
> $output .= '<div id="newsletter-header"
> style="border: 1px solid
> black;">Clubmark</div>';
> $output .= '<br />'.$body.'</body></html>';
> // compress output
> return preg_replace('/\s+|\n|\r|^\s|\s$/','
> ',$output);
> }
> ?>
>
> What's the best way of doing this?
>
> Mark
>
> _______________________________________________
> themes mailing list
> themes at drupal.org
> http://lists.drupal.org/mailman/listinfo/themes
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
More information about the themes
mailing list