Module: CamaleonCms::Frontend::SiteHelper
- Included in:
- ApplicationHelper
- Defined in:
- app/helpers/camaleon_cms/frontend/site_helper.rb
Overview
Camaleon CMS is a content management system
Copyright (C) 2015 by Owen Peredo Diaz
Email: [email protected]
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Affero General Public License (GPLv3) for more details.
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
38 39 40 |
# File 'app/helpers/camaleon_cms/frontend/site_helper.rb', line 38 def is_ajax? @cama_visited_ajax.present? end |
#is_category? ⇒ Boolean
check if current section visited is for category
58 59 60 |
# File 'app/helpers/camaleon_cms/frontend/site_helper.rb', line 58 def is_category? @cama_visited_category.present? end |
#is_home? ⇒ Boolean
**************** section is a? ****************# check if current section visited is home page
23 24 25 |
# File 'app/helpers/camaleon_cms/frontend/site_helper.rb', line 23 def is_home? @cama_visited_home.present? end |
#is_page? ⇒ Boolean
check if current section visited is for post
28 29 30 |
# File 'app/helpers/camaleon_cms/frontend/site_helper.rb', line 28 def is_page? @cama_visited_post.present? end |
#is_post_tag? ⇒ Boolean
check if current section visited is for post tag
53 54 55 |
# File 'app/helpers/camaleon_cms/frontend/site_helper.rb', line 53 def is_post_tag? @cama_visited_tag.present? end |
#is_post_type? ⇒ Boolean
check if current section visited is for post type
48 49 50 |
# File 'app/helpers/camaleon_cms/frontend/site_helper.rb', line 48 def is_post_type? @cama_visited_post_type.present? end |
#is_profile? ⇒ Boolean
check if current section visited is for post
33 34 35 |
# File 'app/helpers/camaleon_cms/frontend/site_helper.rb', line 33 def is_profile? @cama_visited_profile.present? end |
#is_search? ⇒ Boolean
check if current section visited is for search
43 44 45 |
# File 'app/helpers/camaleon_cms/frontend/site_helper.rb', line 43 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
17 18 19 |
# File 'app/helpers/camaleon_cms/frontend/site_helper.rb', line 17 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
11 12 13 |
# File 'app/helpers/camaleon_cms/frontend/site_helper.rb', line 11 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
68 69 70 71 72 |
# File 'app/helpers/camaleon_cms/frontend/site_helper.rb', line 68 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 |