ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

problems using paginate and url segments

February 14, 2011 6:32pm

Subscribe [4]
  • #1 / Feb 14, 2011 6:32pm

    zhangfei

    62 posts

    hello,

    I have a little problem using this code on the index of a template group Blog in conjonction with the {paginate}:

    {if segment_2 == ""}
    {embed="blog/main"}
    {if:else}
    {embed="blog/post"}
    {/if}

    If I however take the code in blog/main and paste it in the index of the template group Blog it works just fine.

    Is there a way to get those two working together ?

    I use this to get cleaner URLs. and be able to use the permalink with the number if you know what I mean instead of title_permalink.

    Best regards

  • #2 / Feb 15, 2011 9:23am

    Sue Crocker

    26054 posts

    Hi, zhangfei.

    Can you tell us which version/build of EE2.x you’re using? See EEWiki:// HowTo Determine My EE Version

    What kinds of urls are you attempting to work with?

  • #3 / Feb 15, 2011 11:50am

    zhangfei

    62 posts

    Hey sue,

    I’m using EE 2.1.3 build 20101220 the latest I think.

    I’m trying to get the urls as follows :

    this : http://wugong.fr/blog/post-title

    instead of this : http://wugong.fr/blog/single/post-title

    and accessory want to use short url as follow : http://wugong.fr/blog/123 where 123 is the post ID.

    regards

  • #4 / Feb 15, 2011 5:03pm

    Marcus Neto

    1005 posts

    zhangfei, you should be able to get your urls structure the way you want them without the use of embeds. For instance if you use a title_permalink directed back at the blog/index template then it should display the article and the URL structure would be http://example.com/blog/post_title_here.

    If I am misunderstanding what you are trying to do then post code from your index, main and paginate so we can more accurately see what is going on.

  • #5 / Feb 15, 2011 5:56pm

    zhangfei

    62 posts

    Hey marcus,

    Yes I could do that but the thing is that my single post page is a bit different than the index one. I could use conditional all over the index but would rather not.

    Is there any reason why an exp channel entries loop would not display on the single page nor index page ? the channel is not the same as the blog one.

  • #6 / Feb 16, 2011 4:00am

    John Henry Donovan

    12339 posts

    zhangfei,

    Try adding a dynamic=“no” to your channel:entries tag

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases