I’ve got many conditionals in a page.
Basically I’ve a ‘sites’ template, that lists all my clients sites.
Then I’ve several subsections that I have to place AFTER the site name.. so I can’t just create new templates for each section.
eg:
http://www.site.com/sites/sitename/news/blog_article_name/
Anyhoo, all works great, until I try and pull in all relevent blog posts to that site.
on it’s own, the blog retrieval code works great.. get’s the right blog based on segment_4 in the URL. But in this page, even thoguh I can see segment_4 where ever I choose to echo it, I keep getting the ‘no results’ text… the blog IS there… but this code doesn’t pick it up…. :-(
On line 55, I’ve killed the
{/exp:weblog:entries}to clear all processing before starting it again, AFTER I’ve done my blog lookup.
I’ve asked a question based around this before, but I couldn’t figure it out..
so here is my full code and full problem.. I’m hoping someone can help!
{embed="home/header"}
{if segment_2}
{exp:weblog:entries weblog="sites"}
<style>
#mainArea {
top: 40px;
}
</style>
<?php $siteMaster = "{url_title}"; ?>
<div id="pageTitleText">{brandTitle}</div>
<div id="siteNavLinks">
<a{if segment_1 == "sites" AND segment_2 != "" AND segment_3 == ""} class="current"{/if} href="{homepage}/sites/{url_title}/">About</a>
{reverse_related_entries weblog="hearstblog" limit="1"}
{if total_results > 0}
<a{if segment_3 == "news"} class="current"{/if} href="{homepage}/sites/<?=$siteMaster ?>/news/">Blog articles</a>
{/if}
{/reverse_related_entries}
<a{if segment_3 == "specs"} class="current"{/if} href="{homepage}/sites/{url_title}/specs/">Site Specifications</a>
<a{if segment_3 == "contact"} class="current"{/if} href="{homepage}/sites/{url_title}/contact/">Contact</a>
</div>
<div id="mainArea">
{if segment_3 == 'news'}
<div id="standardLayoutBlogLeft">
{if:else}
<div id="standardLayoutLarge">
{/if}
{if segment_3 == ''}
<div id="standardLayoutLargeSites">
<div id="siteInformation">
<div id="siteDescription">{brandDescription}</div>
<div id="siteProfile">{if brandProfile} <strong>Reader Profile</strong> {brandProfile} {/if}</div>
</div>
<div id="siteImage">{brandImage}</div>
</div>
{if:elseif segment_3 == 'contact'}
{brandContact}
<hr ><a href="http://{homepage}/sites/{url_title}/">< < Back to {brandTitle}</a>
</div>
{if:elseif segment_3 == 'specs'}
{brandSiteSpecs}
<hr ><a href="http://{homepage}/sites/{url_title}/">< < Back to {brandTitle}</a>
</div>
{if:elseif segment_3 == 'news'}
{/exp:weblog:entries}
{if segment_4}
{exp:weblog:entries weblog="hearstblog" url_title="{segment_4}"}
{if no_results}
<div id="blogHeader">There are no blog entries selected - {segment_4}</div>
{/if}
<div id="blogHeader">{title}</div> - {segment_4}
<div id="blogDetails">Posted by {author} on {entry_date format="%j %M %Y"} (<a href="http://{homepage}/sites/{segment_2}/news/{url_title}/">{comment_total} comments</a>)</div>
{blogBody}
<hr >
<div id="blogCommentsCountBox">{comment_total} comments</div>
{/exp:weblog:entries}
{if:else}
{exp:weblog:entries weblog="sites"}
{reverse_related_entries weblog="hearstblog"}
{if no_results}
<div id="blogHeader">There are no blog entries selected</div>
{/if}
<div id="blogHeader"><a href="http://{homepage}/sites/<?=$siteMaster">{title}</a></div>
<div id="blogDetails">Posted by {author} on {entry_date format="%j %M %Y"} (<a href="http://{homepage}/blog/article/{url_title}/">{comment_total} comments</a>)</div>
{blogSummary}
{/reverse_related_entries}
{/exp:weblog:entries}
{/if}
</div>
{embed="blog/rightHandMenu"}
{/if}
</div>
{if:else}
<div id="pageTitleText">Our Sites</div>
<div id="mainArea">Get generic SITE list</div>
{/if}
{embed="home/footer"}