Module: CamaleonCms::Frontend::ApplicationHelper
- Includes:
- ContentSelectHelper, NavMenuHelper, SeoHelper, SiteHelper
- Included in:
- CamaleonCms::FrontendController
- Defined in:
- app/helpers/camaleon_cms/frontend/application_helper.rb
Instance Method Summary collapse
-
#cama_url_to_fixed(url_to, *args) ⇒ Object
fix for url_to or url_path or any other who need add automatically current locale in the url sample: cama_url_to_fixed(“root_url”, data: “asdasd”, y: 12) => localhost/fr?data=asdasd&y=12 note: if current locale is the default language, then locale is not added in the url.
-
#verify_front_visibility(active_record) ⇒ Object
add where conditionals to filter private/hidden/expired/drafts/unpublished note: only for post records.
Instance Method Details
#cama_url_to_fixed(url_to, *args) ⇒ Object
fix for url_to or url_path or any other who need add automatically current locale in the url sample: cama_url_to_fixed(“root_url”, data: “asdasd”, y: 12)
> localhost/fr?data=asdasd&y=12
note: if current locale is the default language, then locale is not added in the url
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'app/helpers/camaleon_cms/frontend/application_helper.rb', line 20 def cama_url_to_fixed(url_to, *args) = args. if request.present? if .include?(:locale) && [:locale] == false .delete(:locale) else [:locale] = I18n.locale if ![:locale].present? && current_site.get_languages.size > 1 end [:locale] = nil if [:locale].present? && current_site.get_languages.first.to_s == [:locale].to_s end .delete(:format) if PluginRoutes.system_info["skip_format_url"].present? send(url_to.gsub('-', '_'), *(args << )) end |
#verify_front_visibility(active_record) ⇒ Object
add where conditionals to filter private/hidden/expired/drafts/unpublished note: only for post records
9 10 11 12 13 14 |
# File 'app/helpers/camaleon_cms/frontend/application_helper.rb', line 9 def verify_front_visibility(active_record) active_record = active_record.visible_frontend r = {active_record: active_record} hooks_run("filter_post", r) r[:active_record] end |