Message Boards

I fear I've to develop my own theme for language support and cookie warning

thumbnail
Andre Kreienbring, modified 3 Years ago.

I fear I've to develop my own theme for language support and cookie warning

Regular Member Posts: 152 Join Date: 12/18/06 Recent Posts

I hope that someone has a better idea to achive what I need with version 7.3.5 GA6

1.
Language support for Guest users: I would like the Language Portlet to be in the main upper menu right beside the Login button. Currently it seems I need to include this portlet on every page... :-(  There's this LR7 article how to achive that, but it seems outdated. The taglibs used there are probably not working anymore.

2.
I need the users to accept cookies to be compliant with the law. 'liferay.dev' itself has this in the footer. Another thing that goes to the theme, correct? I've seen some market place addons...

And if my fear is the way to go: What's the easiest way? Copy the 'frontend-theme' module from source and then do the necessary adjustments?

Any hint is welcome...


 

thumbnail
Fredi B, modified 3 Years ago.

RE: I fear I've to develop my own theme for language support and cookie war

Junior Member Posts: 69 Join Date: 4/1/20 Recent Posts

Regarding the Cookie Warning I would create a simple mvc portlet and include this in the freemarker template of your theme. 

If you have not created a theme so far I guess the best way to do it is - like you already said - to copy a liferay theme and make the adjustments you need. 

thumbnail
Andre Kreienbring, modified 3 Years ago.

RE: I fear I've to develop my own theme for language support and cookie war

Regular Member Posts: 152 Join Date: 12/18/06 Recent Posts

Thanks for answering, Fredi.

But it looks like I need some more advice...

I'm using Liferay IDE 3.9 with Eclipse on Windows and created a new Liferay Module project like described in this old blog post.

The resulting module structure looks like this:

The structure of the classic theme in the portal sources looks like this:

Looks quite different...
I tried two ways to copy the images, css, templates and WEB-INF folder to my new theme.

  1. Remove everything under webapp and copy the 4 folders there
  2. Remove the main folder and copy the 4 folders to the src folder

However, both ways do not work. Because building (Gradle Task) and deploying (copy WAR to deploy) works, but results in a look thats clearly missing some css styling.

There must be some trick I don't know of...

 

 

thumbnail
Fredi B, modified 3 Years ago.

RE: RE: I fear I've to develop my own theme for language support and cookie

Junior Member Posts: 69 Join Date: 4/1/20 Recent Posts

Yes, you are a right and like the new forum - the new Liferay IDE is kind of a mess und totally unreliable.

Regarding your theme - we also still use "old themes" that are WARs and deploy them via Gradle deploy-Task.

In 7.2 it was possible to deploy them via Add/Remove - this is now sadly not possible anymore.

 

MAybe you try this to create a theme for 7.3:

https://lifedev-solutions.blogspot.com/2020/02/creating-themes-for-liferay-73.html 

Creating theme with npm & yeoman like described there is - I guess - the way Liferay wants us to do this now. (Enable more frontend-dev to work in Liferay-Projects)

thumbnail
Andre Kreienbring, modified 3 Years ago.

RE: I fear I've to develop my own theme for language support and cookie war

Regular Member Posts: 152 Join Date: 12/18/06 Recent Posts

Thanks! The link you posted and the method described there is working! Regarding the copy of the classic theme: The best way to achive that is to unpack the deployed theme war (from the osgi folder) make your changes and build it with gulb again.

However, if you have only small changes, it might even be simpler to unpack - change - repack the original theme. Because I think one has to do the same work on every release of liferay again anyway.

BUT: making Liferay compliant with the European Law, regarding the cookie rules..., thats kind of a challenge that might be worth a blog post!

The reason is that in Europe we are basically not allowed to place a cookie in the browser without the consent of the user! Plus: the user must have the possibility to reject cookies permanently!

The only exception to this rule are cookies that are 'necessary' to offer the service at all.

But Liferay places cookies for the Session (JSESSION), the guest language (GUEST_LANGUAGE_ID) and the ability to store cookies (COOKIE_SUPPORT) on every visit on the page. To argue that the latter two are 'necessary' is at least.... critical.

Disabling this via portlet.properties is not really an option as this is a per user decision!

The support of Google Analytics, the standard way Liferay supports  it (which is outdated anyway), is also not allowed because of the same reason. For me some specific Javascript and a lot of user information was needed to be compliant with the law.

However! If someone is curious how I solved this: https://www.indie-smarthome.com