Search

Hmmm too bad, maybe an idea for a new extension? Datasource multiple sort.

Thanks anyway Nick.

I’m wondering which is the better way to structure URL’s for pagination & single entries:

/articles/1/ for page 1 /articles/entry-title/ for individual article

or

/articles/1/ for page 1 /articles/view/entry-title/ for individual article

or

/articles/page/1 for page 1 /articles/view/entry-title for individual article

Does anyone have any suggestions?

I find using two separate pages is cleanest.

/articles/:page
/articles/view/:handle

Otherwise you shoe-horn two types of parameter (a page number an entry handle) into a single parameter, which is confusing for:

  • users — “Is that an article with a title of “2” or is it page 2?
  • yourself — you have to check if the parameter is a number in your XSLT and display accordingly
  • Symphony — attaching lots of data sources to a page can lead to redundancy and they can execute when you don’t need them, which can be a performance penalty

yo, i will have to look at this! ive written some nice xslt pagers which take advantage of a complete push style template approach. just need to see what the paging element looks like first see how they compare!

Sam

update: hmm cant find it :/

Thanks Nick, I was thinking along the same lines. One other question though, would the /articles/ page essentially be the same as /articles/1/ ?

Yep.

Ok, thanks!

Does anyone know why this doesn’t work together with jQuery?
I use a script that makes a image carousel. When I use the pagination script the carousel doesn’t show correctly anymore.

It seems like the jQuery is turned off.

Have you checked your browser’s console for errors?

Inside the Firefox error console I only found a few css warnings, but no errors.

A while ago I had the same problem with a loginbox that also works with jQuery. It seems like jQuery is not functional when the pagination is showed.

As long as your page source looks like it should, this doesn’t make sense. How should an XSL template interfere with jQuery?

This utility has nothing to do with JavaScript so I don’t see that it would be conflicting. Your problem lies elsewhere…

I have a problem,i´m testing this on a localhost,

i´ve created de navigation with no problems, the only thing is this:

my call template :

<xsl:call-template name="pagination">
        <xsl:with-param name="pagination" select="/data/frontpage/pagination" />
        <xsl:with-param name="display-number" select="'10'" />
        <xsl:with-param name="pagination-url" select="'inicio/$'" />
 </xsl:call-template>

Note that pagination url is “inicio/$”, so when i go to the second page, and check the url of the pagination it becomes something like this:

inicio/2/inicio/3

What i´m doing wrong?

Always prepend $root to your urls!

<xsl:call-template name="pagination">
        <xsl:with-param name="pagination" select="/data/frontpage/pagination" />
        <xsl:with-param name="display-number" select="'10'" />
        <xsl:with-param name="pagination-url" select="concat($root, '/inicio/$')" />
 </xsl:call-template>

That solved, thank you.

I´m having a problem using two url parameters.

My site have a section that displays products, wicth are saparated by categories and subcategories, i use only one DS with 2 parameters $categories and $subcategories. So when i go to any of the categories e displays all the products that are in that categorie no matter the subcategorie the products belong.

What would be the best way to use the pagination in this case?

Currently i´ve tryed this:

<xsl:call-template name="pagination">
        <xsl:with-param name="pagination" select="produtos/pagination" />
        <xsl:with-param name="display-number" select="'10'" />
        <xsl:with-param name="pagination-url" select="concat($root, '/categoria/', $categoria ,'/$')" />
    </xsl:call-template>

i know this would not work when the second parameter is in place, but even on the categorie page it does not work, i always get a empty result page.

I do have a DS for produtos, and the pagination is included:

<produtos>
        <pagination total-entries="11" total-pages="2" entries-per-page="6" current-page="1" />
        <section id="9" handle="produtos">Produtos</section>
        <entry id="62">
            <categoria>
                <item id="8" handle="materiais-eletricos" section-handle="categorias" section-name="Categorias">Materiais Elétricos</item>
            </categoria>
            <nome-do-produto handle="resistencia-lorenzetti-evolution-e-outros">Resistência Lorenzetti Evolution e Outros</nome-do-produto>
            <sub-categoria>
                <item id="46" handle="chuveiros" section-handle="sub-categoria" section-name="Sub categoria">Chuveiros</item>
            </sub-categoria>
            <imagem-do-produto-1 size="1 KB" path="/uploads" type="image/gif">
                <filename>resistencias_verde.gif</filename>
                <meta creation="2011-03-28T13:47:56-03:00" width="48" height="100" />
            </imagem-do-produto-1>
            <preco handle="1800">18,00</preco>
            <marca>
                <item id="45" handle="lorenzetti" section-handle="marcas" section-name="Marcas">Lorenzetti</item>
            </marca>
        </entry>
        <entry id="61">
            <categoria>
                <item id="8" handle="materiais-eletricos" section-handle="categorias" section-name="Categorias">Materiais Elétricos</item>
            </categoria>
            <nome-do-produto handle="resistencia-lorenzetti-multitemperaturas">Resistência Lorenzetti Multitemperaturas</nome-do-produto>
            <sub-categoria>
                <item id="58" handle="resistencia" section-handle="sub-categoria" section-name="Sub categoria">Resistência</item>
            </sub-categoria>
            <imagem-do-produto-1 size="1 KB" path="/uploads" type="image/gif">
                <filename>resistencias_amarela.gif</filename>
                <meta creation="2011-03-28T13:43:29-03:00" width="48" height="100" />
            </imagem-do-produto-1>
            <preco handle="1800">18,00</preco>
            <marca>
                <item id="45" handle="lorenzetti" section-handle="marcas" section-name="Marcas">Lorenzetti</item>
            </marca>
        </entry>
        <entry id="60">
            <categoria>
                <item id="8" handle="materiais-eletricos" section-handle="categorias" section-name="Categorias">Materiais Elétricos</item>
            </categoria>
            <nome-do-produto handle="resistencia-lorenzetti-advanced-e-advanced-turbo">Resistência Lorenzetti Advanced e Advanced Turbo</nome-do-produto>
            <sub-categoria>
                <item id="58" handle="resistencia" section-handle="sub-categoria" section-name="Sub categoria">Resistência</item>
            </sub-categoria>
            <imagem-do-produto-1 size="1 KB" path="/uploads" type="image/gif">
                <filename>resistencias_advanced.gif</filename>
                <meta creation="2011-03-28T13:37:49-03:00" width="48" height="100" />
            </imagem-do-produto-1>
            <preco handle="1690">16,90</preco>
            <marca>
                <item id="45" handle="lorenzetti" section-handle="marcas" section-name="Marcas">Lorenzetti</item>
            </marca>
        </entry>
        <entry id="59">
            <categoria>
                <item id="8" handle="materiais-eletricos" section-handle="categorias" section-name="Categorias">Materiais Elétricos</item>
            </categoria>
            <nome-do-produto handle="resistencia-lorenzetti-varios-modelos">Resistência Lorenzetti Varios Modelos</nome-do-produto>
            <sub-categoria>
                <item id="58" handle="resistencia" section-handle="sub-categoria" section-name="Sub categoria">Resistência</item>
            </sub-categoria>
            <preco handle="950">9,50</preco>
            <marca>
                <item id="45" handle="lorenzetti" section-handle="marcas" section-name="Marcas">Lorenzetti</item>
            </marca>
        </entry>
        <entry id="57">
            <categoria>
                <item id="8" handle="materiais-eletricos" section-handle="categorias" section-name="Categorias">Materiais Elétricos</item>
            </categoria>
            <nome-do-produto handle="chuveiro-zagonel-master-luxo-127v-ou-220v">Chuveiro Zagonel Master Luxo 127v ou 220v</nome-do-produto>
            <sub-categoria>
                <item id="46" handle="chuveiros" section-handle="sub-categoria" section-name="Sub categoria">Chuveiros</item>
            </sub-categoria>
            <imagem-do-produto-1 size="359 KB" path="/uploads" type="image/jpeg">
                <filename>master_luxo.jpg</filename>
                <meta creation="2011-03-28T13:11:02-03:00" width="650" height="650" />
            </imagem-do-produto-1>
            <preco handle="9690">96,90</preco>
            <marca>
                <item id="56" handle="zagonel" section-handle="marcas" section-name="Marcas">Zagonel</item>
            </marca>
        </entry>
        <entry id="55">
            <categoria>
                <item id="8" handle="materiais-eletricos" section-handle="categorias" section-name="Categorias">Materiais Elétricos</item>
            </categoria>
            <nome-do-produto handle="chuveiro-sintex-nova-ducha-127v">Chuveiro Sintex Nova Ducha 127v</nome-do-produto>
            <sub-categoria>
                <item id="46" handle="chuveiros" section-handle="sub-categoria" section-name="Sub categoria">Chuveiros</item>
            </sub-categoria>
            <imagem-do-produto-1 size="70 KB" path="/uploads" type="image/jpeg">
                <filename>1_nova-ducha1.jpg</filename>
                <meta creation="2011-03-28T11:47:25-03:00" width="411" height="450" />
            </imagem-do-produto-1>
            <preco handle="2250">22,50</preco>
            <marca>
                <item id="54" handle="sintex" section-handle="marcas" section-name="Marcas">Sintex</item>
            </marca>
        </entry>
    </produtos>

Any idea of what i could do to make this work?

Does anyone know of a nice way to 'concat' the $url-params?

I was may be thinking of a string replace on $current-url parameter, but I don't think it would work.

This is what I end up with:

<xsl:with-param name="pagination-url" select="concat( $root, '/collections/search-case/results/$/', '?reference=', $url-reference, '&#38;date-of-birth=', $url-date-of-birth, '&#38;collector=', $url-collector, '&#38;first-name=', $url-first-name, '&#38;test-type=', $url-test-type, '&#38;status=', $url-status, '&#38;surname=', $url-surname, '&#38;location=', $url-location, '&#38;collection-date-from=', $url-collection-date-from )"/>

Is this possible to use pagination and tag-filter ?

My Page Settings:

URL-Parameter: tag/page-number

My DS-Settings:

Filter Results: Filter Article by Field Tags: {$tag}

Sorting and Limiting: Sort By = System ID

Paginate results, limiting to 10 entries per page. - Return page {$page-number}

My Template Call:

<xsl:call-template name="pagination">

<xsl:with-param name="url" select="concat('/articles/',$tag,'/$')"/>

<xsl:with-param name="pagination" select="articlelist/pagination" />

</xsl:call-template>

My URL's:

Listpage: domain.com/article/

Listpage Pagination: domain.com/article/2/

Article Tag: domain.com/article/tagname/

Article Tag pagination: domain.com/article/tagname/2/

have someone a idea ?

Suggestion for CSS - change line 32:

ul.pagination li a.page:hover {

to:

ul.pagination li a.page:hover, ul.pagination li a.page:focus {

(Good for keyboard navigators.)

Thanks for this utility - just used it for the first time. :-)

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details