radiant-find_by_id_tag-extension 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -1
- data/app/views/admin/pages/_id_column_td.html.haml +2 -0
- data/app/views/admin/pages/_id_column_th.html.haml +2 -0
- data/app/views/admin/pages/_id_field.html.haml +4 -0
- data/find_by_id_tag_extension.rb +5 -0
- data/lib/radiant-find_by_id_tag-extension.rb +1 -1
- data/radiant-find_by_id_tag-extension-1.1.0.gem +0 -0
- metadata +6 -2
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Find By Id Tag
|
2
2
|
|
3
|
-
This extension allows you to use r:find with an 'id' attribute instead of the usual 'path' attribute. This way the r:find tag will stay intact even if the path of the target page changes.
|
3
|
+
This Radiant CMS extension allows you to use r:find with an 'id' attribute instead of the usual 'path' attribute. This way the r:find tag will stay intact even if the path of the target page changes.
|
4
4
|
An 'ids' attribute was also added to r:aggregate to use instead of 'paths'.
|
5
5
|
|
6
6
|
Important benefit is that this is also much faster than finding a page by path;
|
@@ -11,5 +11,6 @@ Important benefit is that this is also much faster than finding a page by path;
|
|
11
11
|
>> Benchmark.measure { Page.find_by_path('/farm-forestry-model/species/eucalypts/growing-eucalypts-for-timber---videos-and-information/videos/') }
|
12
12
|
=> 0.020000 0.010000 0.030000 ( 0.027044)
|
13
13
|
|
14
|
+
In order to be 'newbie friendly', this extension also allows you to display the page IDs on admin/pages#index and/or admin/pages#edit. In order to do so, set Radiant::Config['expose_page_ids'] to any of 'overview', 'detail' or 'both'. Any other value will hide the ID partials.
|
14
15
|
|
15
16
|
Created by Benny Degezelle for nzffa.org.nz
|
data/find_by_id_tag_extension.rb
CHANGED
@@ -7,5 +7,10 @@ class FindByIdTagExtension < Radiant::Extension
|
|
7
7
|
|
8
8
|
def activate
|
9
9
|
Page.send :include, FindById::TagExtension
|
10
|
+
|
11
|
+
admin.pages.index.add :sitemap_head, "id_column_th", :before => "title_column_header"
|
12
|
+
admin.pages.index.add :node, "id_column_td", :before => "title_column"
|
13
|
+
admin.pages.edit.add :main, "id_field", :before => "edit_form"
|
14
|
+
|
10
15
|
end
|
11
16
|
end
|
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.
|
4
|
+
version: 1.2.0
|
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: 2016-06-
|
12
|
+
date: 2016-06-10 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Adds support for an 'id' attribute to r:find
|
15
15
|
email:
|
@@ -18,12 +18,16 @@ executables: []
|
|
18
18
|
extensions: []
|
19
19
|
extra_rdoc_files: []
|
20
20
|
files:
|
21
|
+
- app/views/admin/pages/_id_column_td.html.haml
|
22
|
+
- app/views/admin/pages/_id_column_th.html.haml
|
23
|
+
- app/views/admin/pages/_id_field.html.haml
|
21
24
|
- cucumber.yml
|
22
25
|
- find_by_id_tag_extension.rb
|
23
26
|
- lib/find_by_id/tag_extension.rb
|
24
27
|
- lib/radiant-find_by_id_tag-extension.rb
|
25
28
|
- lib/tasks/find_by_id_tag_extension_tasks.rake
|
26
29
|
- radiant-find_by_id_tag-extension-1.0.0.gem
|
30
|
+
- radiant-find_by_id_tag-extension-1.1.0.gem
|
27
31
|
- radiant-find_by_id_tag-extension.gemspec
|
28
32
|
- Rakefile
|
29
33
|
- README.md
|