News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

How to add a css class to current page number in pagination?

Started by westis, October 08, 2005, 07:20:12 PM

Previous topic - Next topic

westis

Hi,

I'm trying to modify the css for the pagination. The page numbers that are links are no problem, they are the navPages class. But I am not able to change the formatting for the current page that always is shown within [].

I tried to put a <span> tag around $context['page_index'] in MessageIndex.template.php, but that affects the entire pagination, both the current page and the other pages.

I then tried to look for where the $context['page_index'] is created, which I suppose is in Sources/Display.php. But that's where I got stuck...

Where do I put a class for the current page number?!?

Thankful for any assistance! :-)


Owdy

Try classes

tr.titlebg td

or

tr.catbg td, tr.catbg2 td
Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

westis

Thanks for your reply. :-)

But that class doesn't affect the current page number. I need to change the hard-code somewhere, as I need to get rid of the brackets around the current page number.

The generated code around that area looks like this (the links are cut short to make it easier to read the code):

<table width="100%" cellpadding="3" cellspacing="0" border="0" class="tborder" style="margin-top: 0;">
<tr>
<td align="left" height="26">
<table cellpadding="3" cellspacing="0" width="100%">

<tr>
<td><b>Pages:</b>[<b>1</b>] <a class="navPages" href="board,1.20.html">2</a> </td>
<td align="right" nowrap="nowrap" style="font-size: smaller;">
<a href="markasread"><img src="markread.gif" alt="Mark Topics as Read for this Board" border="0" /></a>
<a href="notifyboardlink" onclick="return confirm('Are you sure you wish to enable notification of new topics for this board?');"><img src="notify.gif" alt="Notify of replies" border="0" /></a>
<a href="post;board=1.0"><img src="new_topic.gif" alt="Start new topic" border="0" /></a>
<a href="post;board=1.0;poll"><img src="new_poll.gif" alt="Post new poll" border="0" /></a>
                                                       </td>
</tr>

</table>
</td>
</tr>
</table>


Thus, the part I need to change is <b>Pages:</b>[<b>1</b>], or rather only the last bit of it: [<b>1</b>]. Where in the code are those brackets added?!? And how can I set a class for the curernt page number, so that I can style it in the css?

AzaToth

That you can't do per theme because it's hardcoded into Sources/Subs.php

westis

Thanks!!!!

That was what I was looking for! Now I was able to add a css class in Sources/Subs.php, so that I can style the current page number. :D

Advertisement: