Using a tag in pagination instead of a span

Permalink
Hi,

I want to use a tag in pagination instead of a span tag. I have a custom template in /blocks/page_list/templates/... but the system always put "span" tag in a page. Now it looks like this:

<span class="current numbers">
    <strong>1</strong></span>
 <span class=" numbers"><a href="/drbeyza/?ccm_paging_p_b28=2" >2</a>   </span>
  <span class=" numbers"><a href="/drbeyza/?ccm_paging_p_b28=3" >3</a></span>


What i want to have is just "a" tags with "readmore" class. No spans. How can i change the custom template to make it?

 
memomem replied on at Permalink Reply
I couldn't find the solution. Page List automatically adds "span" tag, but i want to add only "a" tag. Is there any tutorial for it?

Thanks
mnakalay replied on at Permalink Reply
mnakalay
Hello,
I am not sure you're using C5 latest version because this code you are showing looks nothing like what page_list shows.

All you have to do is go to the concrete/blocks/page_list folder and copy the file view.php

Go to your folder blocks/page_list/templates and paste the file here.

rename it to be name_of_your_template.php

Notice the _ between words and no capital letters.

Edit that file and where it shows pagination just delete the span tags.

Don't forget to apply the template to your block by putting the page in edit mode, clicking on the block, selecting "templates" and selecting the right template from there.

If it's still not working attach your template file to your next message so we can have a look.

Good luck
memomem replied on at Permalink Reply 1 Attachment
Hi,

My Concrete5 version is 5.6.2.1 but even if i delete the span tags, in page source i see the span tags. I've attached the template file.

Thanks
mnakalay replied on at Permalink Reply
mnakalay
Your template seems fine. Are you sure you DID apply it to the block?
In edit mode, click on the block, select templates, select your template from the list and save ?
memomem replied on at Permalink Reply
Yes i did select the custom template and save it. But still got span tags in it. Well how can i add class attributes to "a" tag in $paginator->getPages('a') method? I may be handle this situation with it..

Thanks
mnakalay replied on at Permalink Reply
mnakalay
ok I checked and as it is you only have 1 option other than span.

the function getPages will accept a 'li' tag and use it. For any other tag it will simply revert to span (I know it's very limited)

you can do
$paginator->getPages('li')

and you will see spans disappear and are replaced by lis. But if you try anything else like
$paginator->getPages('div')

It will revert back to spans.

The only way you can change that is if you override the pagination helper and modify the getPages function.