Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Alvaro 7 posts 27 karma points
    May 31, 2012 @ 17:34
    Alvaro
    0

    Pagination with friendly url

    Hi!,

    I've just develop a xslt macro in order to enable pagination in a list of elements. I followed the instructions in http://www.nibble.be/?p=11 (the one with page numbers, and buttons).

    My problem is that I need friendly urls instead of inserting he page number in the query string, that's to say, nowadays, the url is, for example, http://127.0.0.1/noticia.aspx?page=2 but this is not valid for me, I need something like http://127.0.0.1/noticia-2.aspx, but I'm quite lost with this.

    Any idea?.

    Thanks!

     

  • Chriztian Steinmeier 2726 posts 8320 karma points MVP 4x admin c-trib
    May 31, 2012 @ 19:06
    Chriztian Steinmeier
    0

    Hi Alvaro,

    I'd recommend you took a look at UrlRewriting - it's built in to Umbraco (the .config file is in /config/UrlRewriting.config) and you can use most of what you've built already.

    /Chriztian 

  • umbracocool 108 posts 197 karma points
    Jun 01, 2012 @ 05:57
    umbracocool
    0

    Hola Alvaro!

    Segú veo eres de habla hispana,

    Bueno lo primero que debes hacer es ir a la siguiente ruta dentro de tu proyecto en umbraco: config/UrlRewriting.config

    Entras a este fichero, si te fijas todo esta comentado, o la mayoria de apartados

    Pon este código: 

    <add name="newsPag" 

    virtualUrl="^~/noticia.aspx/page/([0-9]+)$" 

    rewriteUrlParameter="ExcludeFromClientQueryString"

    redirectMode="Permanent"

    destinationUrl="~/noticia.aspx/?page=$1" 

    ignoreCase="true" />

    Ya con esto obtienes lo que andas buscando, entonces accedes:  http://127.0.0.1/noticia.aspx/page/2 y listo.

    Yo creo que las directivas de este código que he puesto son bastantes claras. Peor siempre tienes lo mejor a mano visita http://www.urlrewriting.net, para mayor infrmación. ¡Buena Suerte!

     

  • Fuji Kusaka 2203 posts 4220 karma points
    Jun 01, 2012 @ 08:36
    Fuji Kusaka
    0

    Hi,

    Have a look at this threat http://our.umbraco.org/forum/core/general/32149-How-to-use-friendly-url , same solution as stated early by Chriztian.

    //fuji

     

  • Alvaro 7 posts 27 karma points
    Jun 01, 2012 @ 09:19
    Alvaro
    0

    I'm going to take a look to all this.

    Thanks to all!!

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies