I use the same URL in two different places in a template. The URL is actually calculated using entry_id and channel_short_name. What I’d like to do is this:
{exp:channel:entries channel="channel1|channel2|channel3"}
{assign_variable:post_url="/index.php/pages/{channel_short_name}_detail/{entry_id}"}
<a href="http://{post_url}">{title}</a>
<!-- other uses of {post_url} later -->
{/exp:channel:entries}From what I’ve heard, assign_variable won’t work inside the channel entries tag. I don’t think PHP will work either, because I need to evaluate the PHP expression that sets the variable after the entry variables have been evaluated, but before the {post_url} variable is evaluated. Do I have that right?
Is this EE’s way of telling me I’m doing it wrong? The above looks so much cleaner than when I repeat the URL everywhere, but maybe there’s a better way.
Fritz