Kirill Artamonov
Kirill Artamonov

Reputation: 11

How to add a custom java module into magnolia CMS?

I have created a minimal web app with maven following the tutorial

I want to add my own Java components into the webapp. I found these guides: guide1 and guide2

But I still cannot make a page in Pages App using templates from links above (just do not have that templates)

What am I doing wrong? Should I try smth else? Thanks.

Upvotes: 1

Views: 603

Answers (1)

Jan
Jan

Reputation: 4369

There are 2 types of templates that Magnolia supports if you want to use it to render content as well as supply it. There is a page template that is associated with over page and then there is a component template that is used to render components within the page. Each page can have only one page template associated with them while it can contain multiple components of different type and multiple instances of those components as well.

From what I can see, your first guide will only create structure for templates in the generated module, but not actual templates. And your second guide will only create templating function and component template to demonstrate that function, but not a page template.

So first, you should check that in your module structure, somewhere under /src/main/resources/<your module name>/templates you have subfolder called pages and in that folder you have defined page template. And second, you might want to follow this guide for creating and registering page template.

Or if you want to skip java module altogether and do it just as a light module you can follow the guide here.

Upvotes: 1

Related Questions