Skip to main content
Commonmark migration
Source Link

mysite.it/blog/all Which shows all the articles But it does not work for mysite.it/blog/view/hello_world showing the article

 

mysite.it/blog/view/hello_world works fine because the segment_1: blog is an EE template group. The related entries content will be displayed.

 

mysite.it/blog/view/hello_world doesn't work because segment_2: view is not a template group, is not processed, so 404 error message.

I'm using conditional tags to solve this URL problem, it's working fine.

Templates routes could help you too, less verbose that many conditional tags:

https://docs.expressionengine.com/latest/cp/design/routes.html https://docs.expressionengine.com/latest/urls/template_routes.html .

If the segment_2 (view) and you want to associate it with an entry, is not a EE template groups you could use the conditional tags:

{if segment_1 =="blog" && segment_2 =="view" && segment_3 !=""}

If this condition is false, the second will be called:

 {if:elseif segment_1 == "blog"  && segment_2 !="" && segment_3 =="" }

you can use too:

 {if:elseif segment_1 == "blog"  && segment_2 =="all" && segment_3 ==""}

The template code:

{if segment_1 =="blog" && segment_2 =="view" && segment_3 !=""}
        {exp:channel:entries channel="your_channel" url_title="{segment_x}"}
                ........
        {/exp:channel:entries}

  

{if:elseif segment_1 == "blog"  && segment_2 !="" && segment_3 =="" }
        {exp:channel:entries channel="you_channel" url_title="{segment_x}"}
                ........
        {/exp:channel:entries}

{/if}

If needed, you can associate the url_title, with one of the segment (segment_1, segment_2...). https://docs.expressionengine.com/latest/channel/channel_entries.html#url-title

mysite.it/blog/all Which shows all the articles But it does not work for mysite.it/blog/view/hello_world showing the article

 

mysite.it/blog/view/hello_world works fine because the segment_1: blog is an EE template group. The related entries content will be displayed.

 

mysite.it/blog/view/hello_world doesn't work because segment_2: view is not a template group, is not processed, so 404 error message.

I'm using conditional tags to solve this URL problem, it's working fine.

Templates routes could help you too, less verbose that many conditional tags:

https://docs.expressionengine.com/latest/cp/design/routes.html https://docs.expressionengine.com/latest/urls/template_routes.html .

If the segment_2 (view) and you want to associate it with an entry, is not a EE template groups you could use the conditional tags:

{if segment_1 =="blog" && segment_2 =="view" && segment_3 !=""}

If this condition is false, the second will be called:

 {if:elseif segment_1 == "blog"  && segment_2 !="" && segment_3 =="" }

you can use too:

 {if:elseif segment_1 == "blog"  && segment_2 =="all" && segment_3 ==""}

The template code:

{if segment_1 =="blog" && segment_2 =="view" && segment_3 !=""}
        {exp:channel:entries channel="your_channel" url_title="{segment_x}"}
                ........
        {/exp:channel:entries}

  

{if:elseif segment_1 == "blog"  && segment_2 !="" && segment_3 =="" }
        {exp:channel:entries channel="you_channel" url_title="{segment_x}"}
                ........
        {/exp:channel:entries}

{/if}

If needed, you can associate the url_title, with one of the segment (segment_1, segment_2...). https://docs.expressionengine.com/latest/channel/channel_entries.html#url-title

mysite.it/blog/all Which shows all the articles But it does not work for mysite.it/blog/view/hello_world showing the article

mysite.it/blog/view/hello_world works fine because the segment_1: blog is an EE template group. The related entries content will be displayed.

mysite.it/blog/view/hello_world doesn't work because segment_2: view is not a template group, is not processed, so 404 error message.

I'm using conditional tags to solve this URL problem, it's working fine.

Templates routes could help you too, less verbose that many conditional tags:

https://docs.expressionengine.com/latest/cp/design/routes.html https://docs.expressionengine.com/latest/urls/template_routes.html .

If the segment_2 (view) and you want to associate it with an entry, is not a EE template groups you could use the conditional tags:

{if segment_1 =="blog" && segment_2 =="view" && segment_3 !=""}

If this condition is false, the second will be called:

 {if:elseif segment_1 == "blog"  && segment_2 !="" && segment_3 =="" }

you can use too:

 {if:elseif segment_1 == "blog"  && segment_2 =="all" && segment_3 ==""}

The template code:

{if segment_1 =="blog" && segment_2 =="view" && segment_3 !=""}
        {exp:channel:entries channel="your_channel" url_title="{segment_x}"}
                ........
        {/exp:channel:entries}

  

{if:elseif segment_1 == "blog"  && segment_2 !="" && segment_3 =="" }
        {exp:channel:entries channel="you_channel" url_title="{segment_x}"}
                ........
        {/exp:channel:entries}

{/if}

If needed, you can associate the url_title, with one of the segment (segment_1, segment_2...). https://docs.expressionengine.com/latest/channel/channel_entries.html#url-title

answer update
Source Link
Stéphane
  • 885
  • 7
  • 16

mysite.it/blog/all Which shows all the articles But it does not work for mysite.it/blog/view/hello_world showing the article

mysite.it/blog/view/hello_world works fine because the segment_1: blog is an EE template group. The related entries content will be displayed.

mysite.it/blog/view/hello_world doesn't work because segment_2: view is not a template group, is not processed, so 404 error message.

I'm using conditional tags to solve this URL problem, it's working fine.

Templates routes could help you too, less verbose that many conditional tags:

https://docs.expressionengine.com/latest/cp/design/routes.html https://docs.expressionengine.com/latest/urls/template_routes.html .

If the segment_2 (view) and you want to associate it with an entry, is not a EE template groups you could use the conditional tags:

{if segment_1 =="blog" && segment_2 =="view" && segment_3 !=""}

If this condition is false, the second will be called:

 {if:elseif segment_1 == "blog"  && segment_2 !="" && segment_3 =="" }

you can use too:

 {if:elseif segment_1 == "blog"  && segment_2 =="all" && segment_3 ==""}

The template code:

{if segment_1 =="blog" && segment_2 =="view" && segment_3 !=""}
        {exp:channel:entries channel="your_channel" url_title="{segment_x}"}
                ........
        {/exp:channel:entries}

  

{if:elseif segment_1 == "blog"  && segment_2 !="" && segment_3 =="" }
        {exp:channel:entries channel="you_channel" url_title="{segment_x}"}
                ........
        {/exp:channel:entries}

{/if}

If needed, you can associate the url_title, with one of the segment (segment_1, segment_2...). https://docs.expressionengine.com/latest/channel/channel_entries.html#url-title

mysite.it/blog/all Which shows all the articles But it does not work for mysite.it/blog/view/hello_world showing the article

mysite.it/blog/view/hello_world works fine because the segment_1: blog is an EE template group. The related entries content will be displayed.

mysite.it/blog/view/hello_world doesn't work because segment_2: view is not a template group, is not processed, so 404 error message.

I'm using conditional tags to solve this URL problem, it's working fine.

Templates routes could help you too, less verbose that many conditional tags:

https://docs.expressionengine.com/latest/cp/design/routes.html https://docs.expressionengine.com/latest/urls/template_routes.html .

mysite.it/blog/all Which shows all the articles But it does not work for mysite.it/blog/view/hello_world showing the article

mysite.it/blog/view/hello_world works fine because the segment_1: blog is an EE template group. The related entries content will be displayed.

mysite.it/blog/view/hello_world doesn't work because segment_2: view is not a template group, is not processed, so 404 error message.

I'm using conditional tags to solve this URL problem, it's working fine.

Templates routes could help you too, less verbose that many conditional tags:

https://docs.expressionengine.com/latest/cp/design/routes.html https://docs.expressionengine.com/latest/urls/template_routes.html .

If the segment_2 (view) and you want to associate it with an entry, is not a EE template groups you could use the conditional tags:

{if segment_1 =="blog" && segment_2 =="view" && segment_3 !=""}

If this condition is false, the second will be called:

 {if:elseif segment_1 == "blog"  && segment_2 !="" && segment_3 =="" }

you can use too:

 {if:elseif segment_1 == "blog"  && segment_2 =="all" && segment_3 ==""}

The template code:

{if segment_1 =="blog" && segment_2 =="view" && segment_3 !=""}
        {exp:channel:entries channel="your_channel" url_title="{segment_x}"}
                ........
        {/exp:channel:entries}

  

{if:elseif segment_1 == "blog"  && segment_2 !="" && segment_3 =="" }
        {exp:channel:entries channel="you_channel" url_title="{segment_x}"}
                ........
        {/exp:channel:entries}

{/if}

If needed, you can associate the url_title, with one of the segment (segment_1, segment_2...). https://docs.expressionengine.com/latest/channel/channel_entries.html#url-title

corrected spelling
Source Link
Stéphane
  • 885
  • 7
  • 16

segment_2 view is not a template group is mysite.it/blog/all Which shows all the articles But it does not processedwork for mysite.it/blog/view/hello_world showing the article

 

itmysite.it/blog/view/hello_world works withfine because the segment_1: blog because it'sis an EE template group. The related entries content will be displayed.

mysite.it/blog/view/hello_world doesn't work because segment_2: view is not a template group, is not processed, so 404 error message.

Partial templates are not processed, so it will give a 404 error. In this case i'm I'm using conditional tags (same template model as yours)to solve this URL problem, it's working fine.

Templates routes could help you too, less verbose that many conditional tags:

https://docs.expressionengine.com/latest/cp/design/routes.html https://docs.expressionengine.com/latest/urls/template_routes.html .

segment_2 view is not a template group is not processed

it works with segment_1 blog because it's an EE template group.

Partial templates are not processed, so it will give a 404 error. In this case i'm using conditional tags (same template model as yours), it's working fine.

Templates routes could help you too, less verbose that many conditional tags:

https://docs.expressionengine.com/latest/cp/design/routes.html https://docs.expressionengine.com/latest/urls/template_routes.html .

mysite.it/blog/all Which shows all the articles But it does not work for mysite.it/blog/view/hello_world showing the article

 

mysite.it/blog/view/hello_world works fine because the segment_1: blog is an EE template group. The related entries content will be displayed.

mysite.it/blog/view/hello_world doesn't work because segment_2: view is not a template group, is not processed, so 404 error message.

I'm using conditional tags to solve this URL problem, it's working fine.

Templates routes could help you too, less verbose that many conditional tags:

https://docs.expressionengine.com/latest/cp/design/routes.html https://docs.expressionengine.com/latest/urls/template_routes.html .

Source Link
Stéphane
  • 885
  • 7
  • 16
Loading