Hide 'previous' on page 1 of pagination
I'm using the pagination on the page list block and I would like to hide the 'previous' link when users are on page 1 of the list, but have it appear again when on page 2, 3 etc. More of an aesthetic than functionality problem :)
I'd also like to remove the default <strong> tags that surround the current page number, I can edit the classes and css using a duplicate version of the file in my blocks directory, but it seems like the strong tag is added elsewhere?
I've been looking through but couldn't find an answer to either of these, any help would be much appreciated.
have a look at the view.php of the block, the strong tag should live there. Duplicate it to the templates folder and make your edits.
This might help (scroll down to custom view templates)
I'm actually already using a duplicate file in the templates folder (page list teasers add on) to customise the pagination, what I can't see is how the strong links are added or how to hide the 'previous' tab?
Here is the pagination code I'm looking at
<?php if ($showPagination): ?> <div id="pagination"> <div class="ccm-spacer"></div> <div class="page-list-pagination"> <span class="pagination-left"><?php echo $paginator->getPrevious('' . t('Previous')); ?></span> <?php echo $paginator->getPages(); ?> <span class="pagination-right"><?php echo $paginator->getNext(t('Next') . ''); ?></span> </div> </div> <?php endif; ?>
Since I am not a PHP guy, I don't know if this will work, but I would think it would.
edit: It looks like the "previous" link is generated in this php too, so I guess what you need to do is override the pagination.php helper. Apparently overriding helpers wasn't possible, but a post athttp://www.concrete5.org/community/forums/customizing_c5/include-pa... suggests that this can now be done.
That link you sent is out of date I think, I was able to modify the pagination.php file by duplicating it from concrete/core/helpers/ over to mysite/helpers/ without doing the other stuff mentioned there. Though being a bit new to this I may have done this incorrectly.
I removed the <strong> tags from pagination.php. Getting rid of the 'previous' link can be done through css as the pagination.php file wraps the inactive link in a span class - <ltgray> though you can change the name of this class in the pagination.php if you wish.