Module: Integral::ApplicationHelper
- Includes:
- BlogHelper, GalleryHelper, SocialHelper, SupportHelper
- Defined in:
- app/helpers/integral/application_helper.rb
Overview
Base Frontend Helper
Instance Method Summary collapse
-
#google_tag_manager(type = :script) ⇒ String
Frontend Google Tag Manager Snippet.
-
#main_menu_list ⇒ Integal::List
Main menu list as defined in settings area.
- #render_block_list(block_list) ⇒ Object
- #render_blocks(content) ⇒ Object
- #render_breadcrumbs? ⇒ Boolean
-
#render_json_ld ⇒ String
Javascript snippet containing LD-JSON.
-
#render_list(list, opts = {}) ⇒ String
HTML generated by rendering list.
-
#site_title ⇒ String
Configurable Website title.
Methods included from GalleryHelper
#render_gallery, #render_thumb_gallery
Methods included from BlogHelper
#display_most_read_posts_widget?, #display_newsletter_signup_widget?, #display_popular_posts_widget?, #display_post_categories_widget?, #display_recent_posts_widget?, #display_share_widget?, #display_similar_posts_widget?, #featured_categories, #most_read_posts, #render_post_as_json_ld, #render_posts_as_json_ld
Methods included from SocialHelper
#facebook_share_url, #facebook_url, #github_url, #instagram_url, #linkedin_share_url, #linkedin_url, #mail_share_url, #twitter_share_url, #twitter_url, #youtube_url
Methods included from SupportHelper
#anchor_to, #display_media_query_indicator?, #icon, #method_missing, #respond_to?
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Integral::SupportHelper
Instance Method Details
#google_tag_manager(type = :script) ⇒ String
Frontend Google Tag Manager Snippet
53 54 55 |
# File 'app/helpers/integral/application_helper.rb', line 53 def google_tag_manager(type = :script) GoogleTagManager.render(Settings.google_tag_manager_id, type) end |
#main_menu_list ⇒ Integal::List
Returns main menu list as defined in settings area.
42 43 44 45 |
# File 'app/helpers/integral/application_helper.rb', line 42 def id = Integral::Settings.send('main_menu_list_id') @main_menu_list ||= Integral::List.find_by_id(id) end |
#render_block_list(block_list) ⇒ Object
16 17 18 19 20 |
# File 'app/helpers/integral/application_helper.rb', line 16 def render_block_list(block_list) Rails.cache.fetch block_list do ::BlockEditor::BlockListRenderer.render(block_list.content) end end |
#render_blocks(content) ⇒ Object
22 23 24 |
# File 'app/helpers/integral/application_helper.rb', line 22 def render_blocks(content) ::BlockEditor::BlockListRenderer.render(content) end |
#render_breadcrumbs? ⇒ Boolean
47 48 49 |
# File 'app/helpers/integral/application_helper.rb', line 47 def true end |
#render_json_ld ⇒ String
Returns Javascript snippet containing LD-JSON.
10 11 12 13 14 |
# File 'app/helpers/integral/application_helper.rb', line 10 def render_json_ld content_tag 'script', type: 'application/ld+json' do yield.to_json.html_safe end end |
#render_list(list, opts = {}) ⇒ String
Returns HTML generated by rendering list.
33 34 35 36 37 38 39 |
# File 'app/helpers/integral/application_helper.rb', line 33 def render_list(list, opts = {}) opts.reverse_merge!( renderer: Integral::ListRenderer ) opts[:renderer].render(list, opts).html_safe end |
#site_title ⇒ String
Returns Configurable Website title.
58 59 60 |
# File 'app/helpers/integral/application_helper.rb', line 58 def site_title Settings.website_title end |