Skip to content

admin area resources

mmx edited this page Sep 28, 2018 · 1 revision

Resources

Resource is a piece of content (string) which can be translated.

Manage resources

  • go to Admin area -> Resources

Add new resource

  • go to Admin area -> Resources

  • click New

  • form

Resource form

Resource:

  • name - should be only English letters
  • description - any text to describe it
  • Content - value for the resource in different languages

View usage of the resource

You can see views (templates) where the resource is used.

Use resource in view

  • use resource name
  • its value will be automatically translated for the current language
=::Optimacms::Resource.resource_name

or using helper

=msg.resource_name

example:

# app/views/shared/_footer.html.haml

=msg.footer_copyright

where 'footer_copyright' is name of the resource.

Clone this wiki locally