Here’s a little dilemma I’ve got. I’m hoping to use 1 template to handle both section and subsection pages. For example, if my URL is:
http://address.com/template_group
...I want to display the section content. However, if the URL is:
http://address.com/template_group/url_title
...I want to display subsection (page) content.
I was hoping to do something like this:
{if segment_2}{!-- display a subsection page --}
{exp:channel:entries
channel="mychannel"
disable="categories|member_data|pagination"
dynamic="yes"
limit="1"
require_entry="yes"
}
{if no_results}{redirect='error'}{/if}
{title} etc…
{/exp:channel:entries}
{if:else} {!-- display section page --}
{exp:channel:entries
channel="mychannel"
disable="categories|member_data|pagination"
dynamic="no"
limit="1"
}
{title} etc…
{/exp:channel:entries}
{/if}However for some reason the {redirect} tag is kicking in when I try the URL http://address.com/template_group and I don’t get my section page. Any ideas?
Thnx