Import/create a new template in Magnolia - magnolia

I am following these steps: https://documentation.magnolia-cms.com/display/DOCS/Creating+a+page+template. I'm stopped at creating a page definition.
Magnolia does not see my helloWorld.jsp template. I'm using the Enterprise Edition (free trial) if it matters. I watched all tutorials, but I can not find the answer.

Yes, it probably matters.
When you are using EE, you can have defined multiple sites in single server and you don't necessarily want to have each template available in each site you define. So you need to tell Magnolia for which site you want to enable this template. To enable this template for all sites, go to STK group in AdminCentral and open SiteDefinitons app there. In Site Definitions, go to /default/templates/availability/templates and register your template there by creating Node named helloWorld with property id set to value templating:pages/helloWorld (ID is always in format module-name:path-to-template-from-templates-folder)
HTH,
Jan

Related

Magnolia Page Template not registering

I watched a Tutorial from Magnolia here is the link: [https://www.youtube.com/watch?v=qdDb-oYt18k].
During watching it I followed his orders. I also read the hello world tutorial in the documentation. That is, I installed magnolia with cli and created a light module and a page. Everything was created with cli so there is no way that my module could have any errors. I restarted my tomcat server and entered the admin panel. First off my module is not shown in the resource folder, neither is it shown in the page template selection menu.
What exactly could this be?
As per comments under the question,solution to this issue was to ensure property in magnolia.properties file denoting folder with light modules points to correct directory.
When in doubt always use absolute path.

Symfony: Multiple similar bundles with one master?

Let's say I have created a news portal bundle "NewsBundle" with articles, tags, events, lots of relations, quite huge and complex.
Now I want to copy this numerous times and create a Fashion News Portal, Car News Portal, Dog News portal and so on each available though an own domain. The portals differ only in templates, translations and assets. As I want to implement complex reporting, I want all the stuff in a single database and would flag all entities with the respective portal.
My question: How so I organize the code?
First I figured out, I could use routing to have the same application but different bundles for each domain.
Then I found out, that I could extend my master bundle. But it seems as this works only once.
As I did all the routing with annotations, it look like it does not work to inherit the routes from the master?
One of the hardest questions is where to put the portal switch. Somewhere I need to set a variable that tells whether its the fashion or dogs portal, so I can filter the content in all repositories accordingly.
I did that in the app.php which is for sure worst practise.
In the end I want to be able to roll out new portals easily without duplicate code.
Any ideas are much appreciated.
Greetings from Hamburg,
Boris
You need to keep your NewsBundle in your application, and to have a number of bundles revolving around it, one for each portal you intend to create.
There is no real need for bundle inheritance here. Your portal bundles depends on the NewsBundle but don't inherit from it.
Routing configuration, templating, and other behaviours related to a specific portal should go in the related bundle. There is a Resources folder in each bundle ; this is where you will need to put specific routing, translation, configuration and templates.
app/config/routing.yml is the central routing conf file where you will need to reference all other routing.yml file.
As for the switch, well, I can't answer that in detail but I think it should be set up in your server application apache or nginx (or other...).
Your problem can be solved via different environments. Each of your portal is a different environment. You can set up your web server to point different front-controllers depending on the domain requested.
Example:
For domain news.domain.com your front-controller would be web/app_news.php. And it will contain line:
$kernel = new AppKernel('news', false);
It will automatically load config from app/config/config_news.yml. In that config you can specify all specific parameters for your portal. You need then just implement your special loader for resources like translations that will load resources from the path specified in config_news.yml.

Magnolia form module templates are missing in new page wizard

I'm building a site starting from the magnolia empty webapp with maven.
All is ok but now I'm now writing the contact page of the site. I'd like to use the magnolia mail module for this. So I installed the mail module and the form module.
Problem:
After installing the form module in magnolia 5.4, the template called "Form" does not appear in the template selection when creating a new page in the pages app.
As it seems from the Documentation, it should be there.
Details:
Other templates, created by me with yaml and freemarker, correctly appear (and i can use them correctly).
The mail module is up and running and configured: i can send a mail to myself with the "verify setting" page, using a template i made, but i'd like to create a contact module for my site.
I installed the module with maven like:
dependency: groupId:info.magnolia, artifactId:magnolia-module-form , version:2.3
and installed it with the usual steps (installed module, wait , correctly completed without messages, started magnolia)
I DO NOT have STK installed since i'm using MTE... and i've other modules installed (resources, site, mail, MTE, DAM, etc...)
Am I missing something or doing something wrong? :|
Otherwise, Can the magnolia mail module simply be used standalone without the form module to send out a email, may be pointing a hand-written form to somewhere?
Or, best option imho: can I make a new form template with yaml? I can't find docs about it.
Thank you!.
Edit: I tried to install the STK along with MTE (I correctly updated to magnolia 5.4.1) but it relies on data-module 2.3.6 (which i don't have in my dependencies and which i don't use) so it won't install the STK. Also , installing STK just for a form template seems overkill to me. I'd prefere to understand how to insert a form in one of my templates.
Preinstalled templates are for STK. If you want to use Magnolia without STK, then you need to write template yourself, but in exchange have much more freedom in what you can do with that template. Once you create and register template you should be able to use it.
Re STK - latest version doesn't have any dependency on data module - see module descriptor. Either I'm blind or there is no such dependency. :D
HTH,
Jan

How to implement an RSS feed of a site within alfresco share?

I am still learning alfresco and trying to get the feed dashlets to display a custom feed in share. The end goal is to have some sort of workflow in which the editing of certain components on a site site page within alfresco generate a feed element which will then be picked up by the feed dashlet. For now to test I created an xml feed file and put it in a document space in a collaborative site that was set to public and put its link in the feeds dashlet config but that doesn't work. Is there anyway to implement the functionality I'm after?
There are 2 options:
Create your own Dashlet. The current RSS-Feed Dashlet connects to the http connector(share-config-custom.xml), this is an external connector for which authentication is required. So copy the RSS-Feed Dashlet and rip this part out.
According to this JIRA enhancement , in Alfresco Enterprise 4.1.4 you can read internal Share Feeds! So this means you probably won't have to do any customization. So grap the SVN/GIT source of Enterprise tree and use Alfresco's code to build the Dashlet or extend/override it.

ASP MVC Sitemap with MvcSiteMap

MvcSiteMap - https://github.com/maartenba/MvcSiteMapProvider [originally at: http://mvcsitemap.codeplex.com/]
Is it possible to create such links in a sitemap with MvcSitemap?
I can create a simple sitemap but not one with the link below..
www. ... .com / Eventname / groupID /Tasks/ Details/ taskID
Eventname, groupID, TaskID are dynamic.
If not is there another solution for my problem?
I know this answer comes a little late, but I've just picked up on MvcSitemap myself in the last week and am using it as per the OP's question in my own project.
It's certainly achievable. You can define sitemap nodes by creating a custom node provider, within which you pass in the route values for each node, based on the custom route you mentioned. Even version 1 of MvcSiteMap allowed for dynamic nodes, but v2.0 seems a lot more flexible - and it supports MVC2 Areas.
Have a look at the project wiki entry on defining sitemap nodes in code. The sample project is pretty good too. If you only have SQL Express installed, you may need to grab the DB files from the original MVCMusicStore project as the DB files included with the MvcSiteMap sample will only work on paid versions of SQL server.

Resources