Hi there,
I’ve setup a masthead_images weblog in order to display random images in the masthead of my site.
This works fine on the home page, fine on the news page. Both of these pages use different templates and here’s the code from the news page template for info:
{embed="includes/doctype"}
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
{embed="includes/metatags"}
<title>{site_name} - {exp:weblog:entries weblog="news" limit="1" rdf="off"}{title}{/exp:weblog:entries}</title>
</head>
<body id="news">
<div id="container">
{embed="includes/header"}
{embed="includes/main_nav"}
{embed="includes/masthead"}
{embed="includes/breadcrumb"}
{embed="includes/sidebar_nav"}
<div id="content_narrow">
<h2>News</h2>
<p>{exp:weblog:entries weblog="news"}</p><h3>{title}</h3>
<p>{entry_date format="%d %F %Y"} by {author}<br />
{summary}<br />
{body}<br />
{/exp:weblog:entries}</p>
<p></div><!--end content--></p>
<p>{embed="includes/footer"}</p>
<p></body><br />
</html>So far so good. However, for some reason that is beyond me, the same masthead image doesn’t appear in the About and Services pages (both use the same template - text_page1), and doesn’t appear in the Contact page either (which uses it’s own template).
Here’s the text_page1 template code:
{embed="includes/doctype"}
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
{embed="includes/metatags"}
<title>{site_name} - {exp:weblog:entries weblog="static_pages" limit="1" rdf="off"}{title}{/exp:weblog:entries}</title>
</head>
<body id="{exp:weblog:entries weblog="static_pages" limit="1" rdf="off"}{url_title}{/exp:weblog:entries}">
<div id="container">
{embed="includes/header"}
{embed="includes/main_nav"}
{embed="includes/masthead"}
{embed="includes/breadcrumb"}
{embed="includes/sidebar_nav"}
<div id="content_narrow">
{exp:weblog:entries weblog="static_pages" limit="1" rdf="off"}
<h2>{title}</h2>
<p> {if image <> NULL}{site_url}/images/graphics/{image}{/if}<br />
{body}<br />
{/exp:weblog:entries}</p>
<p></div><!--end content_narrow--></p>
<p>{embed="includes/footer"}</p>
<p></div><!--end container--></p>
<p></body><br />
</html>Any ideas what’s happening here? When viewing the source code, it’s clear that the image code isn’t generating at all. But I have no idea why if it works on other templates. It seems bizarre and I can’t explain it at all.
Thanks for any help with this,
Ste