Code: Select all
{if $view=="entry"}
{if $entry.properties.entry_specific_header_image}
<style type="text/css">.intro-header {ldelim}background-image: url('{$entry.properties.entry_specific_header_image}');{rdelim}</style>
{else}
<style type="text/css">.intro-header {ldelim}background-image: url('{if $template_option.entry_default_header_image}{$template_option.entry_default_header_image}{else}{serendipity_getFile file="img/post-bg.jpg"}{/if}');{rdelim}</style>
{/if}
... otherwise use a defined default image for all posts....
... otherwise use the theme's default image for an entry/post.
Lets say you had a series of images in the folder /img/ named background1.jpg, background2.jpg, background3.jpb, background4.jpg, and background5.jpg.
instead of using the default background image from the theme, I THINK you could do this (untested):
Code: Select all
{if $view=="entry"}
{if $entry.properties.entry_specific_header_image}
<style type="text/css">.intro-header {ldelim}background-image: url('{$entry.properties.entry_specific_header_image}');{rdelim}</style>
{elseif $template_option.entry_default_header_image}
<style type="text/css">.intro-header {ldelim}background-image: url('{$template_option.entry_default_header_image};{rdelim}</style>
{else}
{assign var=random_id value=1|mt_rand:5}
<style type="text/css">.intro-header {ldelim}background-image: url({serendipity_getFile file="img/background{$random_id}.jpg"}');{rdelim}</style>
{/if}