Module: CamaleonCms::Frontend::SiteHelper
- Included in:
- ApplicationHelper
- Defined in:
- app/helpers/camaleon_cms/frontend/site_helper.rb
Instance Method Summary collapse
-
#is_ajax? ⇒ Boolean
check if current section visited is for ajax.
-
#is_category? ⇒ Boolean
check if current section visited is for category.
-
#is_home? ⇒ Boolean
**************** section is a? ****************# check if current section visited is home page.
-
#is_page? ⇒ Boolean
check if current section visited is for post.
-
#is_post_tag? ⇒ Boolean
check if current section visited is for post tag.
-
#is_post_type? ⇒ Boolean
check if current section visited is for post type.
-
#is_profile? ⇒ Boolean
check if current section visited is for post.
-
#is_search? ⇒ Boolean
check if current section visited is for search.
-
#site_current_path ⇒ Object
return current url visited as path localhost:9001/category/cat-post-2 => /category/cat-post-2.
-
#site_current_url ⇒ Object
return full current visited url.
-
#the_head(seo_attrs = {}, show_seo = true) ⇒ Object
show custom assets added by plugins show respond js and html5shiv seo_attrs: Custom attributes for seo in Hash format show_seo: (Boolean) control to append or not the seo attributes.
Instance Method Details
#is_ajax? ⇒ Boolean
check if current section visited is for ajax
30 31 32 |
# File 'app/helpers/camaleon_cms/frontend/site_helper.rb', line 30 def is_ajax? @cama_visited_ajax.present? end |
#is_category? ⇒ Boolean
check if current section visited is for category
50 51 52 |
# File 'app/helpers/camaleon_cms/frontend/site_helper.rb', line 50 def is_category? @cama_visited_category.present? end |
#is_home? ⇒ Boolean
**************** section is a? ****************# check if current section visited is home page
15 16 17 |
# File 'app/helpers/camaleon_cms/frontend/site_helper.rb', line 15 def is_home? @cama_visited_home.present? end |
#is_page? ⇒ Boolean
check if current section visited is for post
20 21 22 |
# File 'app/helpers/camaleon_cms/frontend/site_helper.rb', line 20 def is_page? @cama_visited_post.present? end |
#is_post_tag? ⇒ Boolean
check if current section visited is for post tag
45 46 47 |
# File 'app/helpers/camaleon_cms/frontend/site_helper.rb', line 45 def is_post_tag? @cama_visited_tag.present? end |
#is_post_type? ⇒ Boolean
check if current section visited is for post type
40 41 42 |
# File 'app/helpers/camaleon_cms/frontend/site_helper.rb', line 40 def is_post_type? @cama_visited_post_type.present? end |
#is_profile? ⇒ Boolean
check if current section visited is for post
25 26 27 |
# File 'app/helpers/camaleon_cms/frontend/site_helper.rb', line 25 def is_profile? @cama_visited_profile.present? end |
#is_search? ⇒ Boolean
check if current section visited is for search
35 36 37 |
# File 'app/helpers/camaleon_cms/frontend/site_helper.rb', line 35 def is_search? @cama_visited_search.present? end |
#site_current_path ⇒ Object
return current url visited as path localhost:9001/category/cat-post-2 => /category/cat-post-2
9 10 11 |
# File 'app/helpers/camaleon_cms/frontend/site_helper.rb', line 9 def site_current_path @_site_current_path ||= site_current_url.sub(cama_root_url(locale: nil), "/") end |
#site_current_url ⇒ Object
return full current visited url
3 4 5 |
# File 'app/helpers/camaleon_cms/frontend/site_helper.rb', line 3 def site_current_url request.original_url end |
#the_head(seo_attrs = {}, show_seo = true) ⇒ Object
show custom assets added by plugins show respond js and html5shiv seo_attrs: Custom attributes for seo in Hash format show_seo: (Boolean) control to append or not the seo attributes
60 61 62 63 64 |
# File 'app/helpers/camaleon_cms/frontend/site_helper.rb', line 60 def the_head(seo_attrs = {}, show_seo = true) js = "<script>var ROOT_URL = '#{cama_root_url}'; var LANGUAGE = '#{I18n.locale}'; </script>".html_safe js += cama_draw_pre_asset_contents ( || "") + "\n" + (cama_the_seo(seo_attrs)) + "\n" + js + "\n" + cama_draw_custom_assets end |