Skip to content

EM-1049: Table Issues #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Or if you're installing from a Gemfile include it as
gem 'cortex-snippets-client`, '~> 1.0.4'
```

And then run
And then run

```ruby
bundle install
Expand Down Expand Up @@ -51,7 +51,7 @@ Use of this gem is generally split into two categories: Snippets and Webpages

**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.

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

### Snippets

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


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

Expand Down
2 changes: 1 addition & 1 deletion lib/cortex/snippets/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Cortex
module Snippets
VERSION = '1.0.4'
VERSION = '1.1.1'
end
end
8 changes: 8 additions & 0 deletions lib/cortex/snippets/webpage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ def dynamic_yield
}
end

def tables_widget_data
JSON.parse(@webpage[:tables_widget_json] || 'null', quirks_mode: true)
end

def tables_widget_data_for(section_name)
tables_widget_data&.[](section_name) || []
end

def snippets
@webpage[:snippets]
end
Expand Down