掲示板

Authentication Theme inherit ?

thumbnail
9年前 に Soukaina HAJI によって更新されました。

Authentication Theme inherit ?

Regular Member 投稿: 195 参加年月日: 14/06/17 最新の投稿
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
9年前 に Pankaj Kathiriya によって更新されました。

RE: Authentication Theme inherit ?

Liferay Master 投稿: 722 参加年月日: 10/08/05 最新の投稿
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
9年前 に M J によって更新されました。

RE: Authentication Theme inherit ?

Regular Member 投稿: 184 参加年月日: 13/03/01 最新の投稿
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
9年前 に Soukaina HAJI によって更新されました。

RE: Authentication Theme inherit ?

Regular Member 投稿: 195 参加年月日: 14/06/17 最新の投稿
Ok and how should I do it ? which properties file ?
thank you
thumbnail
9年前 に Jack Bakker によって更新されました。

RE: Authentication Theme inherit ?

Liferay Master 投稿: 978 参加年月日: 10/01/03 最新の投稿
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
9年前 に Olaf Kock によって更新されました。

RE: Authentication Theme inherit ? (回答)

Liferay Legend 投稿: 6403 参加年月日: 08/09/23 最新の投稿
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
9年前 に Jack Bakker によって更新されました。

RE: Authentication Theme inherit ? (回答)

Liferay Master 投稿: 978 参加年月日: 10/01/03 最新の投稿
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
9年前 に Olaf Kock によって更新されました。

RE: Authentication Theme inherit ? (回答)

Liferay Legend 投稿: 6403 参加年月日: 08/09/23 最新の投稿
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
9年前 に Soukaina HAJI によって更新されました。

RE: Authentication Theme inherit ?

Regular Member 投稿: 195 参加年月日: 14/06/17 最新の投稿
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 !!
9年前 に Anonymous Anonymous によって更新されました。

RE: Authentication Theme inherit ?

Regular Member 投稿: 127 参加年月日: 19/09/16 最新の投稿
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
9年前 に Olaf Kock によって更新されました。

RE: Authentication Theme inherit ? (回答)

Liferay Legend 投稿: 6403 参加年月日: 08/09/23 最新の投稿
IMHO _styled should be good enough if you copied over all of classic's CSS- template- and other custom files