Liferay theme reset to default - liferay

I don't know if I'm the only one to have this problem, I'm developing a liferay theme using the plugin sdk and eclipse. I have a theme based on classic, when I turn off eclipse and turn on again I found that all changes on custom.css are gone and reset to default classic theme.

this was my fault I was making changes on docroot/custom.css directly, I should put the on _diff/.

You have to done your custom css in _diff/css/custom.css ok
when you create the theme your _diff folder is empty so you just take all css folder, template folder, js folder and images folder form classic theme and place in _diff folder then modify in _diff/css/custom.css file
Have look into following site for more info about liferay Liferay Savvy

Related

how to correctly upload a WAR file to the file system in Liferay 7.3.5

Using Liferay 7.3.5, i am consistently running into issues regarding theme deploy.
I am trying to upload a theme to my server using the instructions given in the following guide:
https://learn.liferay.com/dxp/latest/en/system-administration/installing-and-managing-apps/installing-apps.html
When i try uploading apps via the file system and into the deploy folder, the file appears to vanish and nothing happens. I have since been uploading it directly to the WAR folder, but i am now running into some issues when a theme is deployed that way.
I expect the theme to be uploaded and working properly, the CSS to be applied to the page(s) and the liferay menu to be intact.
Uploading the theme appears to go well and the theme shows inside the list you can choose from. Inside the list however, the theme doesn’t display a thumbnail.
Problems started once i uploaded multiple themes to the same liferay server.
On the site pages, the CSS is not properly applied and looks broken as if there isn’t any theme applied. The edit page button on the top right is invisible, as are the rest of the menu items.
Publishing the site or reselecting the theme do not resolve the issues, nor did a redeploy of the theme.
Does anybody know how to correctly upload a WAR file to the file system in Liferay 7.3.5, or am i overlooking something else?
UPDATE 22/09/2022
so i have narrowed down the issue a bit. When i first upload a theme to my war folder is works fine. However when deploying a another theme, the first one breaks.
I doesn't really matter which of the theme's i use as it seems to do it for all of them, I created a github with two simple theme war files. If you want to reproduce the issue.
https://github.com/Lincolnmyth/theme
All you have to do is follow the normal steps and upload the theme. Turn the server on, and check if it works. Then turn it back off again to add another one. You'll then start seeing issues in the first theme.
Such as liferay buttons changing the same colour as the background and the css from the theme not working. So for example, the januari theme should change the navbar and add a picture about it. If you upload the other theme however this doesn't work anymore.
I hope this works as a reproducible example

How to change the logo in the URL of a liferay portal?

I want to change this liferay logo to one of my own. How do i do it? I do not want to create a new theme, but make changes in the existing WELCOME theme of liferay.
Just put your custom favicon.ico file in the docroot/_diffs/images folder of your theme, if you are working on one.
If you’re not then create one using classic as the parent theme so you don’t need to customize it in any way to have the standard look and feel.

Editing multiple themes in Liferay already deployed on the server

I'm still familiarizing myself with Liferay. I currently have liferay 6.1, running on Glassfish on a linux server. Right now, I'm trying to edit and view the edits of multiple themes that I have downloaded and included in my themes location of a deployed Liferay instance.
My question is, what is the directory convention and best practices for theme customization. I've added the themes through the Liferay GUI itself but for more custom editing I'm directly editing CSS files in the themes/ directory.
I'm having trouble finding information regarding the build and directory information. How does liferay know which theme is active at a given time? Is this reflected in the directory? Is there an 'Current Theme' folder? Is there an easy way to easily swap out themes that I'm editing? Should I be using the __diff directory or is this only used when editing from the GUI?
You shouldn't edit a deployed theme in the appserver's directory. If you edit/develop a theme, you're typically editing files in the _diffs folder. Each theme is built as "the difference" to a base theme, typically one of Liferay's _styled or _unstyled themes. Everything that is different from them (typically you start with css/custom.css goes into the _diffs folder. Upon build (and prior to deployment) everything gets merged and subsequently used by Liferay.
There's no "current" theme, as Liferay can have a theme per page, or per site (e.g. Liferay can maintain many sites - and pages - each with their own theme). You choose the active theme per site or page in the page administration (Manage/Page, select Look&Feel).
Please read more in the Developer's Guide and Wiki.
Also, the 6.1 branch (if you're speaking of CE) is discontinued, you might want to upgrade to 6.2 unless you're using Enterprise Edition, which is still supported for a few years.

CSS to Liferay theme

I have a css web design and I want to converted in Liferay theme. Is this possible?
I am using Liferay 6.1 Ga2 with Tomcat 7 and Liferay SDK for java.
Any advice will be appreciated!
Thanks in advance
If you have css designs then you can use it in your theme. But make sure that if you are using any liferay OOB portlets then you have to customize those OOB portlets CSS as well.
afaik,Direct conversion of css designs into liferay css structure is not possible.
From someone who has a background as a Web Designer who learned Liferay. You need to extend the basic theme and start customizing it. You do this by creating a theme through the liferay SDK. Then it copies all the files into /docroot/diffs/*
In there you will see a css folder, in there you will see a custom.css file, That is the file you want to add your css properties to. It has highest/last priority to set elements and attributes.
If you want to customize the template engine, you need to look at the velocity templates under /docroot/diffs/templates. If you're new to it, make a copy of the file you're playing with so you don't have to blow it all away and start over if you mess up. But basically Velocity is very easy to learn. If you want to embed images directly in velocity from liferay via your theme via the /docroot/diffs/images/custom/ folder, here is a piece of code that will work.
<img src="$themeDisplay.getPathThemeImages()/custom/image_name.png" id="logo" />
I recommend though to keep the portal_normal.vm as similar to the default portal_normal.vm because then upgrading will be easier down the road.

Help on DotNetNuke

Does any body know how can i change the layout of a dotnetnuke website. I need to modify the standard layout
You can use a custom skin or modify the default skin that comes with the DNN installation. The default skin files are in [Website]\Portals_default\Skins\MinimalExtropy\ where [Website] is your DNN web site folder. If you are new to skinning and have a lot of questions, I am sure that the DNN forums will be helpful - DNN Skinning forums
You can do that by editing the CSS. I had similar issue, for which I used " inspect element" in google chrome that helped me in recognizing div elements and css properties. You can find css in portals_default\Skins\DarkKnight (or your own skin name) \skin.css
If your wanting to do anything outside of the CSS (ie, turn off the search bar on a page); then you have to have full access to the site -- open the site via FTP or download all the files, then you can modify the 'default' page, or the skin file you want to change. my suggestion is to make a 'copy' of the skin default page you want to change, give it a new name, and then save it back to the server. When you go to change the 'skin' theme from the 'site manager' you will see your new skin page listed as an option. Modifying from the CMS does not allow you to modify the actual 'page', only its 'parts'. There is also a starter kit available for Visual Studio, google "DNN Starter Kit" which you can create custom modules, skins and containers.

Resources