<?php
$segment2 = $this->EE->uri->segment('2');
$seg = ($segment2 == "") ? ('{segment_1}') : ('{segment_2}');
echo $seg;
?>
{embed ="/_embeds/html-header/"}
TEXT HHERE SHOWS
{exp:channel:entries channel="{segment_1}" url_title="<? echo $seg; ?>" limit="1" disable="trackbacks|pagination|member_data|categories" dynamic="off"}
FROM HERE ON DOESNT
I am not sure why the call to the channel wont work, the channel exists, but nothing is being pulled back.
Probably stating the obvious, but if the PHP isn’t getting parsed the “url_title” parameter would be blank–which wouldn’t return any results from the channel:entries tag. Double-check the PHP parse order?
Or is the channel:entries tag completely killing output?
Edit: The PHP Parsing Stage should be set to “input” to meet your needs. Yes, I’m ashamed that I can never remember that without looking it up.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.