I am wondering what a better way there is to write the following code:
{preload_replace:this_index_channel="case_study"}
{preload_replace:disable_fields="categories|member_data|pagination"}
{if segment_2 != ""}
{exp:channel:entries channel="{this_index_channel}" disable="{disable_fields}" limit="1" status="not closed"}
{embed="includes/document_head" url_title="{url_title}"}
{/exp:channel:entries}
{if:elseif segment_2 == ""}
{embed="includes/document_head" title="Case Studies"}
{/if}This is at the top of the index of a template group called “casestudies.” At the bottom of the page, I run the if/else statement again to embed the casestudy-view.html page which outputs the individual case-study entries. Also, I am using NSM Better Meta in my “document_head.html” file with the following code:
{exp:nsm_better_meta:template}So far it works fine, but I feel like there could be a better way of writing this. Thanks!