Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Clean Theme to avoid creating duplicate main_menu #276

Merged
merged 2 commits into from
Jan 6, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/apps/themes/new/custom_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ def theme_custom_on_install_theme(theme)
group.add_manual_field({"name"=>"Footer text", "slug"=>"theme_custom_footer_text"},{field_key: "editor", translate: true})
end

theme.site.nav_menus.create(name: "Main Menu", slug: "main_menu")
unless theme.site.nav_menus.where(slug: "main_menu").any?
theme.site.nav_menus.create(name: "Main Menu", slug: "main_menu")
end
end

def theme_custom_on_uninstall_theme(theme)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ def themeKey_settings(theme)
# here your code on save settings for current site, by default params[:theme_fields] is auto saved into theme
# Also, you can save your extra values added in admin/settings.html.erb
# sample: theme.set_meta("my_key", params[:my_value])
theme.set_field_values(params[:field_options])
end

# callback called after theme installed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<!-- META SECTION -->
<title>My theme</title>
<title><%= current_site.the_title %></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
Expand Down