We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Using plugin's output as exp:weblog:entries parameter together with if no_results redirect

Development and Programming

Laisvunas's avatar
Laisvunas
879 posts
17 years ago
Laisvunas's avatar Laisvunas

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.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.