From 98ed4d49f70db9b92bad8a6b630469e90f190349 Mon Sep 17 00:00:00 2001 From: Chriztian Steinmeier Date: Sat, 9 May 2015 17:24:32 +0200 Subject: [PATCH 1/6] Add test for customApply feature --- paginationhelper/test/CustomApplyTest.xspec | 26 +++++++++++++++ .../PaginationHelperCustomApplySample.xslt | 33 +++++++++++++++++++ .../test/PaginationHelperSample.xslt | 4 +-- .../test/PaginationHelperSortedSample.xslt | 2 +- 4 files changed, 61 insertions(+), 4 deletions(-) create mode 100644 paginationhelper/test/CustomApplyTest.xspec create mode 100644 paginationhelper/test/PaginationHelperCustomApplySample.xslt diff --git a/paginationhelper/test/CustomApplyTest.xspec b/paginationhelper/test/CustomApplyTest.xspec new file mode 100644 index 0000000..5a741eb --- /dev/null +++ b/paginationhelper/test/CustomApplyTest.xspec @@ -0,0 +1,26 @@ + + + + + + + + + + + + +

"James Sawyer" <james.sawyer@4815162342x.com>

+

"Kate Austen" <kate.austen@4815162342x.com>

+

...

+

...

+

"Jack Shepard" <jack.shepard@4815162342x.com>

+
+
+
+ +
diff --git a/paginationhelper/test/PaginationHelperCustomApplySample.xslt b/paginationhelper/test/PaginationHelperCustomApplySample.xslt new file mode 100644 index 0000000..b0f6f7f --- /dev/null +++ b/paginationhelper/test/PaginationHelperCustomApplySample.xslt @@ -0,0 +1,33 @@ + + + + " + + + + + + + + + + + + + + +

+ +

+
+ + +

+
+ + + +
diff --git a/paginationhelper/test/PaginationHelperSample.xslt b/paginationhelper/test/PaginationHelperSample.xslt index cca5233..1567148 100644 --- a/paginationhelper/test/PaginationHelperSample.xslt +++ b/paginationhelper/test/PaginationHelperSample.xslt @@ -21,7 +21,5 @@ - - - \ No newline at end of file + diff --git a/paginationhelper/test/PaginationHelperSortedSample.xslt b/paginationhelper/test/PaginationHelperSortedSample.xslt index 68c7567..bfdc164 100644 --- a/paginationhelper/test/PaginationHelperSortedSample.xslt +++ b/paginationhelper/test/PaginationHelperSortedSample.xslt @@ -24,4 +24,4 @@ - \ No newline at end of file + From 34fcc43cc6a6604b5055fbcd4490ac223c6b028e Mon Sep 17 00:00:00 2001 From: Chriztian Steinmeier Date: Sat, 9 May 2015 17:26:42 +0200 Subject: [PATCH 2/6] Implement *customApply* parameter Makes it possible to have the Pagination Helper call a special template for each "page", where you can then manually apply (and thus use a specific mode or pass parameters) templates to the current page's items --- paginationhelper/_PaginationHelper.xslt | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/paginationhelper/_PaginationHelper.xslt b/paginationhelper/_PaginationHelper.xslt index 5509694..003de09 100644 --- a/paginationhelper/_PaginationHelper.xslt +++ b/paginationhelper/_PaginationHelper.xslt @@ -85,6 +85,9 @@ + + + @@ -117,6 +120,11 @@ + + + + + @@ -364,5 +372,16 @@ + + + + + + - \ No newline at end of file + From 22240f3dcc60cdf0b69398e56d5f17070a3d3a33 Mon Sep 17 00:00:00 2001 From: Chriztian Steinmeier Date: Sat, 9 May 2015 17:26:53 +0200 Subject: [PATCH 3/6] Update versions --- version.ent | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/version.ent b/version.ent index bc7a32f..8addced 100644 --- a/version.ent +++ b/version.ent @@ -1,8 +1,8 @@ - + - + From e4a747989a3419106bacfb5650ec6d6a51c5aeb3 Mon Sep 17 00:00:00 2001 From: Chriztian Steinmeier Date: Sat, 9 May 2015 23:33:34 +0200 Subject: [PATCH 4/6] Describe the customApply option --- paginationhelper/README.md | 28 +++++++++++++++++++++++++ paginationhelper/_PaginationHelper.xslt | 1 - 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/paginationhelper/README.md b/paginationhelper/README.md index 06a80be..11c6533 100644 --- a/paginationhelper/README.md +++ b/paginationhelper/README.md @@ -99,6 +99,34 @@ Because XSLT allows for some very special sorting (e.g., sorting by a substring ``` +## Advanced template handling + +Now *what if* you have to pass a parameter to every item you render in the paginated set? Or maybe your original (un-paginated) output had two modes, e.g. a "list" mode and a "grid" mode? (It could happen :) Can you still just *inject* Pagination Helper into the mix and have everything "just work"? + +Well, you can at least specify that you would like a little bit more control, and that you will in fact personally oversee the specific rendering of each page yourself. Here's how: + +You pass the parameter `customApply` (set to `true()`) and then you modify the named "customApply" template to suit your needs, e.g., to pass an index variable to the item template, you can do this: + +```xslt + + + + + +... + + + + + + + +``` + +*Note: You can take the "customApply" template out of the Pagination Helper file and put it in your main XSLT file to have it survive between updates. Just remember to delete it from the Pagination Helper* + + + ## QueryString options The pager links rendered will include all existing querystring options on the original page (i.e., "page 1"), so if diff --git a/paginationhelper/_PaginationHelper.xslt b/paginationhelper/_PaginationHelper.xslt index 003de09..1d8fc2d 100644 --- a/paginationhelper/_PaginationHelper.xslt +++ b/paginationhelper/_PaginationHelper.xslt @@ -377,7 +377,6 @@ This is the template that's called when you need to customize the call to `` (e.g. to add a specific mode or to pass parameters). The `$currentSelection` parameter holds the current page of items. - *Note:* You need to handle sorting yourself as well. --> From a1c2dbdb1319c62e0001f7e837bc55a4724ea3ea Mon Sep 17 00:00:00 2001 From: Chriztian Steinmeier Date: Sun, 10 May 2015 00:37:01 +0200 Subject: [PATCH 5/6] Change the way customSort is triggered Makes sense to follow same pattern as for the *customApply* functionality --- paginationhelper/README.md | 7 +++---- paginationhelper/_PaginationHelper.xslt | 9 +++++++-- paginationhelper/entities.ent | 2 -- paginationhelper/test/PaginationHelperSortedTest.xspec | 4 ++-- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/paginationhelper/README.md b/paginationhelper/README.md index 11c6533..3bc777c 100644 --- a/paginationhelper/README.md +++ b/paginationhelper/README.md @@ -80,12 +80,12 @@ It won't cover every scenario, e.g. it doesn't do numerical sorting, and you can ### Advanced sorting -Because XSLT allows for some very special sorting (e.g., sorting by a substring of a value or the combined value of two or more values), there need to be a way to support this, so by sending the string **'$CUSTOM'** into the `sortBy` parameter, the helper will execute a named template (**"customSort"**) to perform the sorting, so in that one you can just paste your existing sort statements, e.g.: +Because XSLT allows for some very special sorting (e.g., sorting by a substring of a value or the combined value of two or more values), there need to be a way to support this, so by specifying the `customSort` parameter as `true()`, the helper will execute a named template (**"customSort"**) to perform the sorting, so in that one you can just paste your existing sort statements, e.g.: ```xslt - + ... @@ -123,8 +123,7 @@ You pass the parameter `customApply` (set to `true()`) and then you modify the n ``` -*Note: You can take the "customApply" template out of the Pagination Helper file and put it in your main XSLT file to have it survive between updates. Just remember to delete it from the Pagination Helper* - +*Note: You can take the "customSort" and/or "customApply" templates out of the Pagination Helper file and put them in your main XSLT file to have them survive between updates. Just remember to delete them from the Pagination Helper* ## QueryString options diff --git a/paginationhelper/_PaginationHelper.xslt b/paginationhelper/_PaginationHelper.xslt index 1d8fc2d..22d6827 100644 --- a/paginationhelper/_PaginationHelper.xslt +++ b/paginationhelper/_PaginationHelper.xslt @@ -85,6 +85,9 @@ + + + @@ -108,11 +111,12 @@ - + + @@ -318,10 +322,11 @@ + - + diff --git a/paginationhelper/entities.ent b/paginationhelper/entities.ent index b220eb6..db807db 100644 --- a/paginationhelper/entities.ent +++ b/paginationhelper/entities.ent @@ -1,8 +1,6 @@ - - diff --git a/paginationhelper/test/PaginationHelperSortedTest.xspec b/paginationhelper/test/PaginationHelperSortedTest.xspec index 90a1868..6d23223 100644 --- a/paginationhelper/test/PaginationHelperSortedTest.xspec +++ b/paginationhelper/test/PaginationHelperSortedTest.xspec @@ -163,9 +163,9 @@ - + - +

Hugo Reyes

From 1999e8c7c48acddac27a8dc268b1258af9c3b726 Mon Sep 17 00:00:00 2001 From: Chriztian Steinmeier Date: Sun, 10 May 2015 00:39:34 +0200 Subject: [PATCH 6/6] Build version 1.2.0 --- dist/xslt/helpers/_CalendarHelper.xslt | 2 +- dist/xslt/helpers/_GroupingHelper.xslt | 2 +- dist/xslt/helpers/_MediaHelper.xslt | 2 +- dist/xslt/helpers/_MultiPickerHelper.xslt | 2 +- dist/xslt/helpers/_NavigationHelper.xslt | 2 +- dist/xslt/helpers/_PaginationHelper.xslt | 29 ++++++++++++++++++++--- 6 files changed, 31 insertions(+), 8 deletions(-) diff --git a/dist/xslt/helpers/_CalendarHelper.xslt b/dist/xslt/helpers/_CalendarHelper.xslt index e0d8c9a..f2f5bf7 100644 --- a/dist/xslt/helpers/_CalendarHelper.xslt +++ b/dist/xslt/helpers/_CalendarHelper.xslt @@ -3,7 +3,7 @@ ]> - + diff --git a/dist/xslt/helpers/_GroupingHelper.xslt b/dist/xslt/helpers/_GroupingHelper.xslt index b5139ea..1c25ca0 100644 --- a/dist/xslt/helpers/_GroupingHelper.xslt +++ b/dist/xslt/helpers/_GroupingHelper.xslt @@ -1,5 +1,5 @@ - + diff --git a/dist/xslt/helpers/_MediaHelper.xslt b/dist/xslt/helpers/_MediaHelper.xslt index be96dc4..3cad1c7 100644 --- a/dist/xslt/helpers/_MediaHelper.xslt +++ b/dist/xslt/helpers/_MediaHelper.xslt @@ -8,7 +8,7 @@ Enables simple retrieval of media by handling the GetMedia() call and error-checking --> - + diff --git a/dist/xslt/helpers/_MultiPickerHelper.xslt b/dist/xslt/helpers/_MultiPickerHelper.xslt index c78a329..1d0368d 100644 --- a/dist/xslt/helpers/_MultiPickerHelper.xslt +++ b/dist/xslt/helpers/_MultiPickerHelper.xslt @@ -4,7 +4,7 @@ Helper file for rendering various datatypes that store node ids. --> - + diff --git a/dist/xslt/helpers/_NavigationHelper.xslt b/dist/xslt/helpers/_NavigationHelper.xslt index 0ef72dc..7407a8c 100644 --- a/dist/xslt/helpers/_NavigationHelper.xslt +++ b/dist/xslt/helpers/_NavigationHelper.xslt @@ -3,7 +3,7 @@ ]> - + diff --git a/dist/xslt/helpers/_PaginationHelper.xslt b/dist/xslt/helpers/_PaginationHelper.xslt index ba44959..bb08e0d 100644 --- a/dist/xslt/helpers/_PaginationHelper.xslt +++ b/dist/xslt/helpers/_PaginationHelper.xslt @@ -1,5 +1,5 @@ - + @@ -58,6 +58,12 @@ + + + + + + @@ -78,11 +84,12 @@ - + + @@ -90,6 +97,11 @@
+ + + + + @@ -283,10 +295,11 @@ + - + @@ -337,5 +350,15 @@ + + + + + +