We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Channel URL Structure

How Do I?

Peak Creative's avatar
Peak Creative
6 posts
6 years ago
Peak Creative's avatar Peak Creative

Hello,

I don’t use EE very much, so I’m hoping someone can help me. I had a channel that was set up for testing purposes and worked great. The channel was Resources and the structure worked like this:

For the listing page: /resources

For the single listings: /resources/single/<dynamic name of resource channel post>

This seemed to work great because the channel was at the root. However, now the channel needs to live somewhere else:

/the-journey/resources/

/the-journey/resources/single/<dynamic name of resource channel post>

I cannot get the single channel pages to resolve at that URL. I’ve tried updating the channel’s URL settings various ways. Is there a way to do this?

       
stefanos's avatar
stefanos
57 posts
6 years ago
stefanos's avatar stefanos

You could try using the EE condicional.tags.

{if segment_1 =="the-journey" && segment_3 =="single" && segment_4!=""}

{exp:channel:entries channel="xx'" url_title="segment_4"} …………. {/exp:channel:entries}

{/if}

       
Peak Creative's avatar
Peak Creative
6 posts
6 years ago
Peak Creative's avatar Peak Creative

Thanks, Stefanos. Unfortunately, I already am using that. It seemed to work before. But once I moved the page one level down, it just gives a 404 page for any page that is:

/the-journey/resources/single/[entry-title]

My template for single is:

{embed="site/_header" prefix="resources" channel="resources"}
{exp:channel:entries url_title="{segment_4}"}
...all the code
{/exp:channel:entries}

But it seems like the problem is related to the routing of the channel.?

       
Paul Bailey's avatar
Paul Bailey
63 posts
6 years ago
Paul Bailey's avatar Paul Bailey

You might have a look at using a template route here. What you’re doing should be pretty straight-forward. The template route for the single-entry template would be something like:

/the-journey/resources/single/{resource:alpha_dash}

with ‘Require all variables’ enabled. Then, the channel entries tag would be something like:

{exp:channel:entries channel="resources" dynamic="no" url_title="{segment:resource}"}
{/exp:channel:entries}
       
stefanos's avatar
stefanos
57 posts
6 years ago
stefanos's avatar stefanos

Hi Paul,

Nice solution, lighter that a lot of conditional tags.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.