Closed NySiya closed 7 years ago
Hi @NySiya I integrated this plugin by default: https://github.com/owen2345/camaleon-cms-seo Please test using github version.
Thank so much for this, but right now, my current project is in Camaleon CMS version 2.2.1 and the project is also live on production already. Is it possible if you also integrated this plugin with Camaleon CMS version 2.2.1 ? As I see the Camaleon CMS SEO plugin is available on Camaleon CMS version 2.3 ~ 2.3.6.
@NySiya Added the support, please use github version.
I found this plugin today and activated it. Unfortunately, it killed my site.
Rails 5/Heroku/camaleon updated today.
NoMethodError: undefined method
get_option' for nil:NilClass`
File "/app/app/apps/themes/my_theme/views/layouts/index.html.erb" line 15 in _app_apps_themes_my_theme_views_layouts_index_html_erb__241862089756899672_69953173722620
The line referenced in the above message reads <%= raw the_head %>
Please try again!
Still the same. I just ran bundle update
and nothing changed.
Please try again, if it persist, please send me the full error. Note: use github version
No change yet. Full error:
NoMethodError: undefined method `get_option' for nil:NilClass
- 10 non-project frames
1
File "/app/vendor/bundle/ruby/2.3.0/gems/cama_meta_tag-1.1/app/helpers/plugins/cama_meta_tag/main_helper.rb" line 21 in cama_meta_tag_on_seo
2
File "/app/vendor/bundle/ruby/2.3.0/bundler/gems/camaleon-cms-bcff67c054bf/app/helpers/camaleon_cms/hooks_helper.rb" line 39 in block in _do_hook
3
File "/app/vendor/bundle/ruby/2.3.0/bundler/gems/camaleon-cms-bcff67c054bf/app/helpers/camaleon_cms/hooks_helper.rb" line 33 in each
4
File "/app/vendor/bundle/ruby/2.3.0/bundler/gems/camaleon-cms-bcff67c054bf/app/helpers/camaleon_cms/hooks_helper.rb" line 33 in _do_hook
5
File "/app/vendor/bundle/ruby/2.3.0/bundler/gems/camaleon-cms-bcff67c054bf/app/helpers/camaleon_cms/hooks_helper.rb" line 19 in block in hooks_run
6
File "/app/vendor/bundle/ruby/2.3.0/bundler/gems/camaleon-cms-bcff67c054bf/app/helpers/camaleon_cms/hooks_helper.rb" line 18 in each
7
File "/app/vendor/bundle/ruby/2.3.0/bundler/gems/camaleon-cms-bcff67c054bf/app/helpers/camaleon_cms/hooks_helper.rb" line 18 in hooks_run
8
File "/app/vendor/bundle/ruby/2.3.0/bundler/gems/camaleon-cms-bcff67c054bf/app/helpers/camaleon_cms/frontend/seo_helper.rb" line 81 in cama_build_seo
9
File "/app/vendor/bundle/ruby/2.3.0/bundler/gems/camaleon-cms-bcff67c054bf/app/helpers/camaleon_cms/frontend/seo_helper.rb" line 23 in cama_the_seo
10
File "/app/vendor/bundle/ruby/2.3.0/bundler/gems/camaleon-cms-bcff67c054bf/app/helpers/camaleon_cms/frontend/site_helper.rb" line 63 in the_head
11
File "/app/app/apps/themes/music_house_blog/views/layouts/index.html.erb" line 25 in _app_apps_themes_music_house_blog_views_layouts_index_html_erb__2418485064013817613_70221946493160
could you please send me your file: /app/vendor/bundle/ruby/2.3.0/bundler/gems/camaleon-cms-bcff67c054bf/app/helpers/camaleon_cms/frontend/seo_helper.rb I need to review the version of your code
module CamaleonCms::Frontend::SeoHelper
# add seo attributes to your page
# you can pass custom data to overwrite default data generated by the
system
# return hash of seo attributes used by the_head(...)
def cama_the_seo(data = {})
if is_home?
data2 = {}
elsif is_page?
data2 = {image: @cama_visited_post.the_thumb_url, title:
"#{current_site.the_title}
| #{@cama_visited_post.the_title}", description:
@cama_visited_post.the_excerpt, keyword
s: @cama_visited_post.the_keywords, object: @cama_visited_post }
elsif is_ajax?
data2 = {}
elsif is_search?
data2 = {title: "#{current_site.the_title} | #{ct("search_title",
default: "Search"
)}"}
elsif is_post_type?
data2 = {image: @cama_visited_post_type.the_thumb_url, title:
"#{current_site.the_t
itle} | #{@cama_visited_post_type.the_title}", description:
@cama_visited_post_type.the_e
xcerpt, keywords: @cama_visited_post_type.the_keywords, object:
@cama_visited_post_type }
elsif is_post_tag?
data2 = {title: "#{current_site.the_title} |
#{@cama_visited_tag.the_title}", descr
iption: @cama_visited_tag.the_excerpt, keywords:
@cama_visited_tag.the_keywords, object:
@cama_visited_tag }
elsif is_category?
data2 = {image: @cama_visited_category.the_thumb_url, title:
"#{current_site.the_ti
tle} | #{@cama_visited_category.the_title}", description:
@cama_visited_category.the_exce
rpt, keywords: @cama_visited_category.the_keywords, object:
@cama_visited_category }
else
data2 = {}
end
cama_build_seo(data2.merge(@_cama_seo_setting_values || {}).merge(data))
end
# permit to define seo attributes by code without hooks (check here for
more attributes
: https://github.com/kpumuk/meta-tags)
# @Sample: cama_seo_settings({title: "my custom title", description: "my
descr", keywor
ds: "my keywords", image: 'my img url'})
# This values will be shown within the_head(...)
def cama_seo_settings(options)
@_cama_seo_setting_values ||= {}
@_cama_seo_setting_values = @_cama_seo_setting_values.merge(options)
end
private
# create seo attributes with options + default attributes
def cama_build_seo(options = {})
options[:image] = current_site.get_option("screenshot",
current_site.the_logo) unless
options[:image].present?
options[:title] = current_site.the_title unless options[:title].present?
options[:description] = current_site.the_option("seo_description")
unless options[:de
scription].present?
options[:url] = request.original_url
options[:keywords] = current_site.the_option("keywords") unless
options[:keywords].pr
esent?
s = {
keywords: options[:keywords],
author: current_site.get_option('seo_author'),
icon: current_site.the_icon,
og: {
title: options[:title],
description: options[:description],
type: 'website',
url: options[:url],
image: options[:image]
},
twitter: {
card: 'summary',
title: options[:title],
description: options[:description],
url: options[:url],
image: options[:image],
site: current_site.get_option('twitter_card'),
creator: current_site.get_option('twitter_card'),
domain: request.host
},
alternate: [
{ type: 'application/rss+xml', href: cama_rss_url }
]
}.merge(options.except(:object))
l = current_site.get_languages
if l.size > 1
l.each do |lang|
s[:alternate] << {
href: current_site.the_url(locale: lang),
hreflang: lang
}
end
end
# call all hooks for seo
r = { seo_data: s, object: options[:object] }
hooks_run('seo', r)
r[:seo_data]
end
end
Thank you, fixed! I published the 1.2 version which supports them
Hello @owen2345,
I know that the Meta Tags in Camaleon CMS has been automatically generated from the content on the page. But here is the suggestion, will it be a good idea to allow the user to edit the Meta Tags on each page themselves. As I have developed the project using Camaleon, some users ask if they could edit Meta Tags on each page themselves. Would it be great if I override your auto generated Meta Tag by let the user to edit it themselves?