Is it ok to put {exp:weblog:entries} tags inside of other {exp:weblog:entries} tags?
I have a conditional which checks to see if a field in the current entry is set to Yes or No. if set to No, it shows a couple fields from the current entry, if set to anything but No (Yes) then it should display a specific entry (default_sidebar). It works fine on my site’s index page, but not within a different section/weblog. No idea why it’s working in one place and not another. I also tried putting a closing {/exp:weblog:entries} tag immediately after {if:else} (which it should need I assume), but it only echoed that closing tag to the screen.
Here’s the code:
<div id="contentwrapper">
<div id="col1">
<span class="toppad"> </span>
{exp:weblog:entries weblog="{my_weblog}" orderby="date" sort="desc" limit="1"}
<h2>{title}</h2>
<p> <span class="toppad"> </span><br />
{body}<br />
{extended}<br />
<span class="toppad"> </span><br />
</div><br />
<div id="col2"><br />
<span class="center"><br />
{if default_sidebar == 'No'}<br />
{sidetitle}<br />
{sidecontent}<br />
{/exp:weblog:entries}<br />
{if:else}<br />
{exp:weblog:entries weblog="sidebar" entry_id="40"}<br />
{sidetitle}<br />
{sidecontent}<br />
{/exp:weblog:entries}<br />
{/if}<br />
</span><br />
</div><br />
</div>
Any ideas are appreciated.
-steve