Move refactor path shortcuts

Answered

Hey,

I am working with Magnolia CMS and there are path shortcuts like this:

rootFolder:folder/folder/file
light-module:components/hero/hero

The original path would look like this:

light-module/dialogs/components/hero/hero

Is there a way to change these paths when I move the files, like with normal paths?

 

Thank you in advance

1
5 comments

Hi,

Is this convention specific to Magnolia?

How does your project tree look like in IntelliJ IDEA? At which point of the 'Move' refactoring process exactly are you having a problem?

Is there a publicly available project where I can check this?

0

Hi Arina,

yes it is specific to Magnolia, but of course I don't know all CMS. :)

I Magnolia there are three parts to a component like a hero.

There is the dialog, where you define all the fields for the backend.
The template script, this ist just the template in Freemarker.
The template definition, here you connect the dialog and the template script.

I don't have a public project, but it would look like this:

├── light-module
│ ├── dialogs
│ ├── components
│ ├── hero.yaml
│ ├── templates
│ ├── hero.yaml
│ ├── hero.ftl

dialogs/components/hero.yaml

label: Hero Wrapper
form:
properties:
image:
!include:/light-module/includes/fields/image.yaml
footerLayout:
$type: defaultEditorActionLayout

templates/hero.yaml

templateScript: /light-module/templates/components/hero.ftl
dialog: light-module:components/hero
renderType: freemarker
title: Hero

templates/hero.ftl

<div class="hero">
Some freemarker stuff
</div>


I am currently refactoring a project and my problem is that if I would put e.g. the file dialogs/components/hero.yaml in a separate folder like dialogs/components/hero/hero.yaml I have to change it manually in all template definitions where this file is referenced. And of course this would be easier if IntelliJ would notice this itself.

0

Thanks for clarifying.

I think there was a request somewhere on our issue tracker to make this possible. Let me find it and get back to you with the latest on its status.

0

Couldn't find a general ticket for this, so created one specifically for YAML and another one as a meta issue:

Feel free to vote and/or leave comments for both of them.

0

We just launched a plugin that detects the module pattern (for java and light module modules) and links the resources accordingly:

https://plugins.jetbrains.com/plugin/23556-magnolia-cms-integration

0

Please sign in to leave a comment.