Sha256: d85a1c8b7fd4aefd6c46568b71431499957adb0d0d5df129f6e95d1ebb01ab6f
Contents?: true
Size: 1.05 KB
Versions: 73
Compression:
Stored size: 1.05 KB
Contents
module Themes::ThemeClass::MainHelper def self.included(klass) # klass.helper_method [:my_helper_method] rescue "" # here your methods accessible from views end def themeKey_settings(theme) # callback to save custom values of fields added in my_theme/views/admin/settings.html.erb end # callback called after theme installed def themeKey_on_install_theme(theme) # # Sample Custom Field # unless theme.get_field_groups.where(slug: "fields").any? # group = theme.add_field_group({name: "Main Settings", slug: "fields", description: ""}) # group.add_field({"name"=>"Background color", "slug"=>"bg_color"},{field_key: "colorpicker"}) # group.add_field({"name"=>"Links color", "slug"=>"links_color"},{field_key: "colorpicker"}) # group.add_field({"name"=>"Background image", "slug"=>"bg"},{field_key: "image"}) # end # # Sample Meta Value # theme.set_meta("installed_at", Time.current.to_s) # save a custom value end # callback executed after theme uninstalled def themeKey_on_uninstall_theme(theme) end end
Version data entries
73 entries across 73 versions & 2 rubygems