I keep running into issues using preload-replace with conditionals that are in a grid field.
I have the preload:
{preload_replace:staticchannelslug="gp"}
And am trying to use it like so:
{page_header_{staticchannelslug}}
<h1>{if page_header_{staticchannelslug}:alt_title}...{if:else}...{/if}</h1>
{/page_header_{staticchannelslug}}
This throws the error:
Something has gone wrong and this URL cannot be processed at this time.
EDIT:
Error with debug on:
You have an invalid conditional in your template. Please review your conditionals for an unclosed string, invalid operators, a missing }, or a missing {/if}.
Parser State: Unexpected ‘alt_title’ (VARIABLE); expected RD in Template “pages/general-page” on line 9.
//end edit
If I don't use the preload and change it to this, I get no errors:
{page_header_gp}
<h1>{if page_header_gp:alt_title}...{if:else}...{/if}</h1>
{/page_header_gp}
I've used this same kind of method for years in EE2, but just running into issues with it in EE3 :/
This doesn't work either, same error message:
{if '{page_header_{staticchannelslug}'}
{page_header_{staticchannelslug}}
...
{/page_header_{staticchannelslug}}
{/if}
Any ideas on what the issue is here or what I may be missing?
Thanks.
page_header_gp
vspage_header_bp
). Also, I've used this method to create a partial with the snippet, and then only have to change the slug variable per channel / template. Hope that makes sense! Really just usually a time-saver :)