radiant-find_by_id_tag-extension 1.2.2 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
|
|
1
1
|
module FindById::TagExtensions
|
2
2
|
include Radiant::Taggable
|
3
|
-
|
3
|
+
|
4
4
|
desc %{
|
5
5
|
Inside this tag all page related tags refer to the page found at the @path@ attribute.
|
6
6
|
@path@s may be relative or absolute paths.
|
@@ -28,9 +28,9 @@ module FindById::TagExtensions
|
|
28
28
|
Aggregates the children of multiple paths using the @paths@ or @ids@ attribute.
|
29
29
|
Useful for combining many different sections/categories into a single
|
30
30
|
feed or listing.
|
31
|
-
|
31
|
+
|
32
32
|
*Usage*:
|
33
|
-
|
33
|
+
|
34
34
|
<pre><code><r:aggregate paths="/section1; /section2; /section3"> ... </r:aggregate>
|
35
35
|
<r:aggregate ids="4; 6; 7"> ... </r:aggregate></code></pre>
|
36
36
|
}
|
@@ -45,7 +45,7 @@ module FindById::TagExtensions
|
|
45
45
|
end
|
46
46
|
tag.expand
|
47
47
|
end
|
48
|
-
|
48
|
+
|
49
49
|
desc %{
|
50
50
|
Sets the scope to the individual aggregated page allowing you to
|
51
51
|
iterate through each of the listed paths.
|
@@ -59,8 +59,12 @@ module FindById::TagExtensions
|
|
59
59
|
# tag.locals.aggregated_pages = tag.locals.parent_ids.map {|p| Page.find(p)}
|
60
60
|
# Make this tag accept 'order' params. Ideally this would go in Radiant's standard_tags.rb
|
61
61
|
order = children_find_options(tag).delete(:order)
|
62
|
-
|
63
|
-
|
62
|
+
# if no order param was set, keep the order in which the ids were given
|
63
|
+
if tag.attr['order'].nil?
|
64
|
+
tag.locals.aggregated_pages = tag.locals.parent_ids.map{|pid| Page.find pid}
|
65
|
+
else
|
66
|
+
tag.locals.aggregated_pages = Page.find(tag.locals.parent_ids, :order => order)
|
67
|
+
end
|
64
68
|
tag.locals.aggregated_pages.each do |aggregate_page|
|
65
69
|
tag.locals.page = aggregate_page
|
66
70
|
aggregates << tag.expand
|
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: radiant-find_by_id_tag-extension
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-
|
12
|
+
date: 2018-06-30 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Adds support for an 'id' attribute to r:find
|
15
15
|
email:
|
@@ -19,6 +19,7 @@ extensions: []
|
|
19
19
|
extra_rdoc_files: []
|
20
20
|
files:
|
21
21
|
- radiant-find_by_id_tag-extension-1.0.0.gem
|
22
|
+
- radiant-find_by_id_tag-extension-1.2.2.gem
|
22
23
|
- cucumber.yml
|
23
24
|
- find_by_id_tag_extension.rb
|
24
25
|
- radiant-find_by_id_tag-extension-1.2.0.gem
|