Hi,
It is possible to use output of url segment variable as parameter of exp:weblog:entries tag together with if no_results redirect. That is, such code as this works:
{exp:weblog:entries weblog="my_weblog" url_title="{segment_3}"}
{if no_results}
{redirect="my_template_group/my_template"}
{/if}
{/exp:weblog:entries}
But is it possible to use as parameter output of some plugin? I have tried with Subsegment plugin both the code as here
{exp:weblog:entries weblog="my_weblog" url_title="{exp:subsegment segment="3" separator="-" index="0"}"}
{if no_results}
{redirect="my_template_group/my_template"}
{/if}
{/exp:weblog:entries}
and the code as here
{exp:subsegment segment="3" separator="-" index="0" parse="inward"}
{exp:weblog:entries weblog="my_weblog" url_title="{subsegment}"}
{if no_results}
{redirect="my_template_group/my_template"}
{/if}
{/exp:weblog:entries}
{/exp:subsegment}
but without success.
In contrast, PHP function, which is wrapped in Subsegment plugin, works perfectly with exp:weblog:entries tag and if no_results redirect. That is the code as here works
{exp:weblog:entries weblog="my_weblog" url_title="<?php echo Subsegment(3, '-', 0); ?>"}
{if no_results}
{redirect="my_template_group/my_template"}
{/if}
{/exp:weblog:entries}
So, is it possible somehow to achieve that output of a plugin is used as parameter of exp:weblog:entries tag and if no_results conditional redirect works (as in url segment variable case)? Or only plain PHP can be used as parameter and work with if no_results conditional redirect?
Thanks.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.