Now i can chan the load more text via the ranslation interface but is the same for al my paginated views. I want to change it with "load more news" or "load more tweets" per view

Thanks

Comments

ericduran’s picture

Cool, I don't see why we can't do this.

Thanks for the feature request.

andremolnar’s picture

I'll have a patch for this up today.

andremolnar’s picture

StatusFileSize
new2.58 KB

Sorry this took longer to get to than I assumed.

But here is the patch.

andre

ericduran’s picture

Status: Active » Needs work
+++ b/views_plugin_pager_load_more.incundefined
@@ -89,8 +100,19 @@ class views_plugin_pager_load_more extends views_plugin_pager_full {
+    if(array_key_exists('more_button_text', $this->options)){
+      $vars['more_button_text'] = $this->options['more_button_text'];
+    }
+    else {
+      $vars['more_button_text'] = t('Load more');

None os this is needed. Instead set up a variable in the option_definition and then you can $this->options instead of checking if it exist or anything.

andremolnar’s picture

Status: Needs work » Needs review
StatusFileSize
new0 bytes

I had included that because there were cases when the item wasn't in the array causing a php notice.

Looks like that was only because I hadn't declared the option properly. Thanks for the feedback.

Attached patch cleans this up.

ksenzee’s picture

Status: Needs review » Needs work

Patch in #5 is 0 bytes.

andremolnar’s picture

StatusFileSize
new2.65 KB

rerolling

ericduran’s picture

+++ b/views_load_more.moduleundefined
@@ -79,4 +79,4 @@ function theme_views_load_more_pager($vars) {
+}

Lets add the new line at the end of the file.

+++ b/views_plugin_pager_load_more.incundefined
@@ -20,11 +20,26 @@ class views_plugin_pager_load_more extends views_plugin_pager_full {
+    $form['items_per_page']['#weight'] = -10;

I didn't really test the patch, but why the -10 weight?

+++ b/views_plugin_pager_load_more.incundefined
@@ -20,11 +20,26 @@ class views_plugin_pager_load_more extends views_plugin_pager_full {
+    //provide an option for users to specify the text used on the more button

This should be a sentance, starting with a Cap and Ending with a .

andremolnar’s picture

StatusFileSize
new2.67 KB

The changing of weight is all about keeping number of items at the top of the list and then wedging in the new field after that but before all the other default views pager fields.

Reroll based on feedback.

ericduran’s picture

Status: Needs work » Fixed

I made some small options like settings the weight to -2 and -1, no need for -10.

Also changed the text from Rename More Link, to More link text.

http://drupalcode.org/project/views_load_more.git/commit/def848f

Thanks.

Status: Fixed » Closed (fixed)

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