Skip to content

Commit 92d8733

Browse files
author
Alex Tharp
authored
Merge pull request #29 from cortex-cms/bugfix/EM-1049-Table-Issues
EM-1049: Table Issues
2 parents 6b5bdeb + 65feb8a commit 92d8733

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Or if you're installing from a Gemfile include it as
1717
gem 'cortex-snippets-client`, '~> 1.0.4'
1818
```
1919
20-
And then run
20+
And then run
2121
2222
```ruby
2323
bundle install
@@ -51,7 +51,7 @@ Use of this gem is generally split into two categories: Snippets and Webpages
5151

5252
**Snippets** refers to blocks of markup that are editable in Cortex IPE and, through the use of this gem, persist into the tenant application. This allows the copy changes made in IPE to replace default blocks on the page and your changes to be shown.
5353

54-
**Webpages** refer to the created webpages themselves, which have several bits of relevant metadata including, but not limited to: title, keywords, and indexing information.
54+
**Webpages** refer to the created webpages themselves, which have several bits of relevant metadata including, but not limited to: title, keywords, and indexing information.
5555

5656
### Snippets
5757

@@ -125,9 +125,10 @@ This will give you a webpage object from your current Cortex Tenant with all of
125125
|noarchive| The noarchive information for the Webpage. Included in `seo_robots`|
126126
|noimageindex| The noimageindex information for the Webpage. Included in `seo_robots`|
127127
|dynamic_yield| A hash of Dynamic Yield information from the current Webpage.|
128+
|tables_widget_data| A hash containing Tables Widget configuration data.|
129+
|tables_widget_data_for| An array (usually) containing table data for a single section.|
128130
|snippets|An array of the associated snippets with the current Webpage.|
129131

130-
131132
1:<br>
132133
The resulting array from `seo_keywords` can be entered into a single keyword meta tag like so:
133134

lib/cortex/snippets/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Cortex
22
module Snippets
3-
VERSION = '1.0.4'
3+
VERSION = '1.1.1'
44
end
55
end

lib/cortex/snippets/webpage.rb

+8
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ def dynamic_yield
5959
}
6060
end
6161

62+
def tables_widget_data
63+
JSON.parse(@webpage[:tables_widget_json] || 'null', quirks_mode: true)
64+
end
65+
66+
def tables_widget_data_for(section_name)
67+
tables_widget_data&.[](section_name) || []
68+
end
69+
6270
def snippets
6371
@webpage[:snippets]
6472
end

0 commit comments

Comments
 (0)