Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To have different types of origin sounds cumbersome at first sight - but actually it is a very handy feature. Let's give you some recommendations which resource type to use in which case.

Bestpractice

During development - use file based or classpath based resources. These files are easier to create, maintain and diff when you work within a team.

Use JCR based resource to "override" an existing source or to add an additional resource within a running Magnolia system in production. This can be done with the Resource Files app.

Referencing resources

Web resources

...

The Resource Files app displays resources (CSS, JavaScript, template scripts, YAML configuration files) from all origins and allows you to edit JCR resources.

...

  1. Select a classpath or file system resource and click Edit file.
     
  2. Edit the resource file and save.
     
  3. The file is now JCR based and can be published.
     
    A check mark in the Overrides column indicates that the new JCR file overrides another resource on the file system or classpath. 

    Info

    Removing the hotfix

    Please note that if you have an active subscriber, applying the Delete file action to the hotfixed resource will only mark the resource for deletion. It will not restore the original resource. To fully restore the function of the original resource, you need to publish it after deleting it.

Publishing resources

JCR based resources can be published. When publishing such a resource - its parent folder (actually all ancestor folders) are published automatically as well.

...

Info
iconfalse
titleBest practice
Multiexcerpt
MultiExcerptNameUse a dedicated CSS pre-processor

New Web technologies such as Syntactically Awesome Style Sheets (Sass) and Less have largely replaced the need to do FreeMarker pre-processing for CSS files. You can now accomplish the same with a dedicated CSS pre-processor. We recommend that you start using such new technologies. Magnolia provides the /resources path (without dot) as a legacy option to support older projects.

Notes to legacy users

Magnolia 5.4 harmonized the loading and referencing of resources. You should start using the new origins and loading order.

...