I'm currently wiring together a site that uses the DRY principle and makes heavy use of @croxton Stash module.
All is working as expected but if I purposefully remove part of the URL I cannot force a redirect as I'm using the URL template to capture the info and embedding (last) a template for display.
I'm using the {if {exp:stash:not_empty name="my-stash"}} Show the info {/if} to great affect but when I set {exp:channel require_entry="yes"} AND there is no entry, how do I force a redirect ?
{embed="_includes/_layout_equipment"} // The layout template
//Collect all values for all custom fields
{exp:stash:set parse_tags="yes" trim="yes" parse_conditionals="yes"}
{exp:channel:entries channel="equipment" url_title="{segment_3}" require_entry="yes"}
{if no_results}Has no effect here{/if}
{stash:title}{title}{/stash:title} // Get title
{stash:matrix}{matrix}<li>{value}</li>{/matrix}{/stash:title} Get Matrix Pair
//repeat for all custom fields in the entry - a lot of them
{/exp:channel:entries}
{/exp:stash:set}
//Need to SET a host of 'stash's' using the master stash vars captured above
{exp:stash:set name="main" parse_tags etc}
{if {exp:stash:not_empty name="title"}}
<h1>{stash:title}</h1>
{/if}
<ul>
{stash:matrix}
</ul>
{/exp:stash:set}
{exp:stash:set name="sidecontent" parse_tags etc}
//Pull in other Vars declared in the steps above
{/exp:stash:set}
{exp:stash:set name="tab01" parse_tags etc}
//Pull in other Vars declared in the steps above
{/exp:stash:set}
// Join all the bits
{exp:stash:set name="contentregion" parse_tags etc}
<div class="abc">
{stash:my_var}
<div class="inner">
{stash:tabs}
</div>
</div>
<div class="abcde">
{stash:anothervar}
{stash:morevars}
{/exp:stash:set}
Then in the Embed template:
<html>
<body>
<div class="content">
{exp:stash:get name="contentregion"}
// By this stage at least one var within this var contains some mark-up - no actual data but a random <div> or <ul>
// ************* WHERE DOES A REDIRECT FIT IF THESE IS NO CONTENT ??? *****//
</div>
<div class="sidecontent">
{exp:stash:get name="sidecontent"}
</div>
</body>
</html>
Apologies for confusion but my embed is quite simple due to the varying nature of the content (tabs, optional tabs, accordions, optional accordions and so on)
I've got all this going on and setting {no_results="redirect"} just fails to trigger