Happen that I need to keep the same structure of the old site, due to many external links.
I have to keep a permalink structure like this to display a list of people in our company:
/people/or /people/index.htm
and a permalink structure like this to display details of a given person.
/people/person_name or /people/person_name/index.htm
I have a template group named “people” and I handle everything via the index.html template.
The first condition is this:
{if segment_2 == "index.htm" OR segment_2 == ""}
>> display the fixed page with company description and a dynamic code that list people
{exp:channel:entries channel="people"}
<a href="http://{path=people/{url_title}}" target="_blank" rel="noopener">" alt=</a>
<strong>{title}</strong>
{/exp:channel:entries}
{/if}
in this case everything work fine if you specify /index.htm on the url, but if you have a permalink like http://www.example.com/people/ you get all person details.
this is the second condition, to handle a single person specification:
{if segment_2 != "index.htm" OR segment_2 != "" }
if I’m under a single person url, for example /people/person_name everything works fine. If I have /people/person_name/index.htm
I don’t get anything.
This is the code for the second condition:
{if segment_2 != "index.htm" OR segment_2 != "" }
{exp:channel:entries channel="people" entry_id="{segment_3}"}
{people_fields}
{/exp:channel:entries}
{/if}
what is wrong?