Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make easy to customize default pagination #2304

Closed
wants to merge 1 commit into from
Closed

Make easy to customize default pagination #2304

wants to merge 1 commit into from

Conversation

hissy
Copy link
Contributor

@hissy hissy commented Apr 21, 2015

Customizing pagination in a page list template is currently difficult. This change provides options to Pagination#renderDefaultView method.

Customization example:

<?php if ($showPagination): ?>
    <?php
    $pagination = $list->getPagination();
    if ($pagination->getTotalPages() > 1) {
        echo $pagination->renderDefaultView([
            'prev_message' => '&laquo;',
            'next_message' => '&raquo;',
            'css_active_class' => 'current-item',
            'css_prev_class' => 'prev-item',
            'css_next_class' => 'next-item',
            'css_container_class' => 'ccm-pagination'
        ]);
    }
    ?>
<?php endif; ?>

Related forum post:
http://www.concrete5.org/community/forums/5-7-discussion/page-list-pagination-styling/

@katzueno
Copy link
Contributor

+1

@aembler
Copy link
Member

aembler commented Apr 27, 2015

I have improved the way this works and incorporated something similar to this. Check out the latest commit. You can pass arguments into the renderDefaultView but it's easier to swap out the default view without having to worry about setting up route collections for the pagination library, etc... I've also separated pagination into "application" and "dashboard" contexts so you can swap out pagination on the front-end while keeping the backend bootstrap3-driven.

@aembler aembler closed this Apr 27, 2015
@hissy hissy deleted the feature/customize-pagination branch April 27, 2015 20:12
@hissy
Copy link
Contributor Author

hissy commented Apr 27, 2015

Great! Glad to hear that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants