Foren

Authentication Theme inherit ?

thumbnail
Soukaina HAJI, geändert vor 9 Jahren.

Authentication Theme inherit ?

Regular Member Beiträge: 195 Beitrittsdatum: 17.06.14 Neueste Beiträge
I was told that the theme that we create for liferay6.2 has got to inherit from the default theme of liferay
Someone please explain to me
thank you
thumbnail
Pankaj Kathiriya, geändert vor 9 Jahren.

RE: Authentication Theme inherit ?

Liferay Master Beiträge: 722 Beitrittsdatum: 05.08.10 Neueste Beiträge
Liferay's custom theme works on concept of differnce to parent base theme, that means you will create custom theme on top of parent base theme by making/adding changes with respect to parent theme.

Please refer https://www.liferay.com/documentation/liferay-portal/6.2/development/-/ai/creating-liferay-themes-liferay-portal-6-2-dev-guide-09-en for more details.
thumbnail
M J, geändert vor 9 Jahren.

RE: Authentication Theme inherit ?

Regular Member Beiträge: 184 Beitrittsdatum: 01.03.13 Neueste Beiträge
You should create your theme based on Theme Parent: "classic" and Theme framework: "Velocity" (not the default Freemarker). Anything else would give you lot of griefs.
thumbnail
Soukaina HAJI, geändert vor 9 Jahren.

RE: Authentication Theme inherit ?

Regular Member Beiträge: 195 Beitrittsdatum: 17.06.14 Neueste Beiträge
Ok and how should I do it ? which properties file ?
thank you
thumbnail
Jack Bakker, geändert vor 9 Jahren.

RE: Authentication Theme inherit ?

Liferay Master Beiträge: 978 Beitrittsdatum: 03.01.10 Neueste Beiträge
Hi Soukaina, check first https://www.liferay.com/documentation/liferay-portal/6.2/development/-/ai/creating-liferay-themes-liferay-portal-6-2-dev-guide-09-en

you don't have to start with classic and velocity but for people new to theme dev it might be a good place to start
thumbnail
Olaf Kock, geändert vor 9 Jahren.

RE: Authentication Theme inherit ? (Antwort)

Liferay Legend Beiträge: 6403 Beitrittsdatum: 23.09.08 Neueste Beiträge
M J:
You should create your theme based on Theme Parent: "classic" and Theme framework: "Velocity" (not the default Freemarker). Anything else would give you lot of griefs.


You should not base your theme on classic. Classic is meant to be a full theme, there's no assumption of keeping it stable and extendable. Instead, build your own theme based on either _unstyled or _styled - those are the two themes that are meant for extension. _styled is the default one if you're just creating a new theme. You'll find the parent theme referenced in build.xml if you use Ant and the Plugins SDK for your theme.

An alternative to base on classic is to copy over classic's custom.css and use it as the basis for your own theme. Classic might change without notice - and you're on the safe side if you have copied a single version. Nobody will care if there's anything based on classic and breaks when classic changes.

What gives you a lot of griefs always depends on your experience: Velocity used to be the default up to Liferay 6.1 - you'll find the most samples on this language. Freemarker is where Liferay goes now. One of the reasons is errorhandling: It doesn't exist in Velocity - so if you have an error in your template, you can easily get an empty page without any content and no error message. Velocity has the lowest barrier of entry but can be unintuitive to debug. Choose your poison: Readily available sample code vs. more powerful language & debugging features.
thumbnail
Jack Bakker, geändert vor 9 Jahren.

RE: Authentication Theme inherit ? (Antwort)

Liferay Master Beiträge: 978 Beitrittsdatum: 03.01.10 Neueste Beiträge
Hey Olaf,

To learn about classic theme, I created a new mytest-theme in Liferay IDE based on classic with velocity, then I copied over tomcat*/webapps/ROOT/themes/_diffs into mytest-theme/docroot/_diffs (replacing the empty _diffs folder that was there). Then I started 'fiddling'.

While I understand that basing a new theme on _unstyled or _styled with freemarker is best practice ; what risk is there in doing the above as a learning experiment ?

Thanks
thumbnail
Olaf Kock, geändert vor 9 Jahren.

RE: Authentication Theme inherit ? (Antwort)

Liferay Legend Beiträge: 6403 Beitrittsdatum: 23.09.08 Neueste Beiträge
It's fine as a learning experiment. However, you shouldn't expect stability of the classic theme. It might be changed without notice, breaking your own theme in the process. However, to experiment with it I'm recommending the way that you describe: Inherit from _styled and copy the classic theme's css, js etc. into your own theme to make it yours - and start fiddling from there.

You're free to build your own base theme, and it's commonly done. However, with this, you're expecting it to be extended and will be careful when you change something in the shared base theme. With classic, nobody assumes any other theme depending on it. So if a bugfix would move some padding into a different class (for example), it could easily break your own theme. Granted, you could always copy the previous version's classic theme at that time, but this suddenly appearing weirdness is what keeps people from upgrading because they fear that random things fail. (because people commonly depend on implementation details instead of abstractions)
thumbnail
Soukaina HAJI, geändert vor 9 Jahren.

RE: Authentication Theme inherit ?

Regular Member Beiträge: 195 Beitrittsdatum: 17.06.14 Neueste Beiträge
Ok thank you,
Im gonna tell u what I did , hope my method is right :
I copied all css files from classic to my theme and i started modifying css file and templates , and for the pom.xml i added the property
<parenttheme>classic</parenttheme>

Please tell me it's right !!
Anonymous Anonymous, geändert vor 9 Jahren.

RE: Authentication Theme inherit ?

Regular Member Beiträge: 127 Beitrittsdatum: 16.09.19 Neueste Beiträge
Hi soukaina

what you are doing is the right one ,if u add any new css then u have to modify the main.css ...there u have to import the css file which u added ..as i know u can modify the portal_nornal.vm and navigation.vm ....here u can do complete customization


Enayath
thumbnail
Olaf Kock, geändert vor 9 Jahren.

RE: Authentication Theme inherit ? (Antwort)

Liferay Legend Beiträge: 6403 Beitrittsdatum: 23.09.08 Neueste Beiträge
IMHO _styled should be good enough if you copied over all of classic's CSS- template- and other custom files