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

Add Custom field #319

Closed
Seaborg opened this issue Jan 28, 2016 · 3 comments
Closed

Add Custom field #319

Seaborg opened this issue Jan 28, 2016 · 3 comments

Comments

@Seaborg
Copy link

Seaborg commented Jan 28, 2016

Hi, Just started using Camaleon-CMS so far I like it but there's very little documentation, i.e. how can I add a custom field?

@colinblaise
Copy link

In the backend. Go to Settings -> Custom Fields.

I've found some issues with Custom Fields for the Menu. I'm working on getting those fixed.

@Seaborg
Copy link
Author

Seaborg commented Jan 29, 2016

Thanks. Haven't reached to menus just yet, but I need to create a Custom Group of Fields
Multiple Links with Labels so I can have a list, current url field doesn't have a Label.

tried to open helper like so:

CamaleonCms::Admin::CustomFieldsHelper.class_eval do
  def cf_get_items
    items = {}

items[:link] = {
  key: 'link',
  label: 'Link',
  options: {
    required: true,
    multiple: true,
    translate: true,
    default_value: true,
    show_frontend: true
  },
  extra_fields:[
    {
      type: 'url',
      key: 'url',
      label: 'Link Url',
    }
  ]
}

and then created a view in:
/app/views/camaleon_cms/admin/settings/custom_fields/fields/_link.html.erb

but not sure what's preferred way, don't want to have a bug after the future Camaleon upgrades. It would be super useful if you could create a groups of given fields, i.e. group of URL + TEXT BOX + TEXT AREA, I appreciate your work.

@owen2345
Copy link
Owner

Fixed custom field problems for menus! now all fields works well for menus and also added a new function for advanced menus:
https://github.com/owen2345/camaleon-cms/blob/master/app/helpers/camaleon_cms/frontend/nav_menu_helper.rb#L119

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants