We wanted the first and last links in the pager be visible (as in this below image), but somehow they were not appearing by default.

First and Last links in pager

After lots of views fiddling and troubleshooting, we reliazed that these links were showing up for other themes and NOT showing up for the Bootstrap theme, let along for our Wetkit Bootstrap based sub-theme.

It seems that the Bootstrap theme has the first and last links commented out in the pager.func.php file located here (/profiles/wetkit/themes/bootstrap/templates/system/pager-func.php). Once we uncommented out the necessary lines for first and last and cleared the cache, the links appeared and are working normally!

We then copied that file into our sub-theme and updated the function name to use our sub-theme hook and all is good now.

Not sure if this is a bug or a "works as designed", but in the hopes of saving others some time, I thought I should report this because it was a bit difficult to find/figure out.

Comments

jayson’s picture

FYI: There is a comment inside the pager.func.php file that states:
// @todo add theme setting for this.

So we are to assume that this was on the "todo" list, but hasn't been addressed yet.

sylus’s picture

Project: Web Experience Toolkit (7.x) » Bootstrap

Thanks for the very detailed and concise issue report it greatly helps me when reviewing issues.

I looked into this and I believe what the maintainer for the bootstrap base theme intended is this would be an opt in option from the theme but that the functionality just hasn't been added yet as there have been much more pressing issues.

I'll move this issue to the bootstrap queue as I couldn't find an existing issue to mark this as a duplicate but will mark as a lower priority.

sylus’s picture

Priority: Normal » Minor
markhalliwell’s picture

Title: First and Last links in pagination (views pager) missing in Bootstrap theme » First and last pagination links missing
Version: 7.x-2.x-dev » 7.x-3.x-dev
Component: User interface » Templates
Category: Support request » Bug report
Priority: Minor » Normal

Hm. IIRC, someone had fixed this in the 8.x branch, but never got backported. Also, I think this was originally to just show the first and last if they were actually necessary, but somehow they ended up being commented out entirely. The temporarily solution is to, indeed, copy this over to your sub-theme and just re-enable them.

Regardless, this does need to be addressed.

Marking issue appropriately.

rcodina’s picture

Thanks Mark for your workaround suggestion! However, I finally copied the boostrap_pager function from pager.func.php to template.php of my bootstrap subtheme. Then, I uncommented first and last buttons. I wish this gets solved officially ASAP!

ñull’s picture

Category: Bug report » Feature request
Issue tags: +Todo List

Thanks for the hint. For people less instructed here is the work around in steps.

  • I copied the function bootstrap_pager from sites/all/themes/bootstrap/theme/system/pager.func.php
  • sites/all/themes/mysubtheme/template.php and renamed the function to mysubtheme_pager
  • In the function I removed double slashed // that were in front of php code. I left the // @todo add theme setting for this. where they were.
  • I refreshed my theme registry cache

Since this is commented in the source with  @todo add theme setting for this, I cannot consider this a bug, but rather a missing feature. I therefore marked it as such with a Todo List" tag.

 

markhalliwell’s picture

Category: Feature request » Bug report
Issue tags: -Todo List
bisw’s picture

Thanks @jayson, its save a lot of time.

markhalliwell’s picture

Assigned: Unassigned » markhalliwell
ivan.lewas’s picture

I've gone through the same problem in a project I'm working on so I've made a simple patch that adds the first and last links and also adds a configuration on the theme settings.

wundo’s picture

Status: Active » Needs review
burnsjeremy’s picture

#10 Works great, patched, set theme setting and pager had first and last links displaying and working right.

wundo’s picture

Assigned: markhalliwell » Unassigned

  • wundo committed 98cf2cc on 7.x-3.x authored by ivan.lewas
    Issue #2343721 by ivan.lewas, jayson, markcarver, wundo, ñull,...
wundo’s picture

Status: Needs review » Fixed
markhalliwell’s picture

Status: Fixed » Needs review
+++ b/theme-settings.php
@@ -286,6 +286,21 @@ function bootstrap_form_system_theme_settings_alter(&$form, $form_state, $form_i
+  $form['components']['pager'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('Pager'),
+    '#collapsible' => TRUE,
+    '#collapsed' => TRUE,
+  );

Given the fact that Bootstrap has two different styles: "pagination" and "pager" and the fact that we have incidentally correlated Bootstrap's "pagination" to mean Drupal "pager", I would prefer that the fieldset be labeled "Pagination" to be in-line with the actual Bootstrap component being used here: http://getbootstrap.com/components/#pagination

markhalliwell’s picture

Status: Needs review » Needs work

Err, wrong status

diegohermes’s picture

Status: Needs work » Needs review
StatusFileSize
new440 bytes

I agree with Mark, here is a patch with the label changed.

markhalliwell’s picture

Status: Needs review » Needs work

@diegohermes, thanks for the patch :)

Upon re-reviewing the original patch/commit, I just realized that the default theme setting is missing from bootstrap.info (insert at line 66).

Considering that this is technically a "feature request" (aka addition), I think it's ok that we enable it by default (1).

ivan.lewas’s picture

I agree with @marcarver, here is a patch for adding the default setting.

ivan.lewas’s picture

Status: Needs work » Needs review

Updating status.

markhalliwell’s picture

Status: Needs review » Fixed
grahamvalue’s picture

Subscribing.

Will this fix be available after the next module update?

wundo’s picture

Yes, it's even already available on the dev release.

grahamvalue’s picture

Thank you!
Is there an ETA for the production release?

markhalliwell’s picture

This project is a [base-]theme, not a module. There is no ETA on the next production release (we're all volunteers here). The current "backlog" are these major and critical issues.

grahamvalue’s picture

Sorry! Hope that didn't come across as pushy.
Was just wondering how long it would take to get the first and last buttons.

Have temporarily done the fix from #6.
But have done it on the base theme instead of the sub theme (after backing up the original file) so that next update will overwrite the changes.

Thank you for responding!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.