I have a need for a "blog/news" section that has some entries that go from the index to a standard entry blog template, and some that just link to an outside site from the index template. Does EE have a simple way to do this?


What I'd do is set up a field (eg blog_offsite_url) to store an optional offsite URL.

Then in your link from the blog index page, use a conditional like this.

{if blog_offsite_url}
    <a href="{blog_offsite_url}">More</a>
    <a href="/blog/post/{url_title}">More</a>

To be thorough, you should put a conditional in the detail template (in this case blog/post) to redirect the user to the offsite blog URL when that has been provided.

I like using rsan's HTTP Header plugin for that.

{if blog_offsite_url}
    {exp:http_header status="301" location="{offssite_blog_url}" terminate="yes"}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.