This question may be related to a resolved thread.
Hi,
I need help displaying a single entry!
To display a single entry, I make use of the comment_url_title_auto_path feature as suggested in the above thread and other threads. This approach is successful for one channel (people) but not another channel (horses). Both channels have several entries.
Here are some relevant Channel Preferences for the two channels People and Horses:
People
Channel URL = http://mysite/community
Comment Page URL = http://mysite/community
Horses
Channel URL = http://mysite/community/horses
Comment Page URL = http://mysite/community/horses
The index page http://mysite/community uses conditional statements that depend on the segment variables to embed various templates. On that index page there are two types of links:
{exp:channel:entries channel="people"}
<a href="http://{comment_url_title_auto_path}" title="Member Profile">{title}</a>
{/exp:channel:entries}
{exp:channel:entries channel="horses"}
<a href="http://{comment_url_title_auto_path}" title="Horse Profile">{title}</a>
{/exp:channel:entries}The first points to something like http://mysite/community/example-person. The second points to something like http://mysite/community/horses/example-horse.
Results for http://mysite/community/example-person:
Here, segment_2 does not equal “horses”, so the site embeds a template that uses this tag
{exp:channel:entries channel="people" limit="1" require_entry="yes"}
Member Profile content
{/exp:channel:entries}As expected, the member profile content is displayed.
Results for http://mysite/community/horses/example-horse:
Here, segment_2 equals “horses”, so the site embeds a template that uses this tag
{exp:channel:entries channel="horses" limit="1" require_entry="yes"}
Horse Profile content
{if no_results}
Sorry, we got nuthin on this horse…
{/if}
{/exp:channel:entries}Unexpectedly, the no_results content is displayed. Removing the require_entry and limit parameters will display all entries for the channel horses.
Any help is appreciated!
Thanks,
Luke