Integration of HTML within Liferay #199202
-
🏷️ Discussion TypeQuestion 💬 Feature/Topic AreaCode Search and Navigation BodyTrying to convert figma html file into liferay |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
|
Hi, There is usually no direct one-click conversion from a Figma-exported HTML file into Liferay. The better approach is to break the exported design into Liferay-friendly parts. A practical process would be:
Then paste the cleaned HTML into the fragment HTML area, CSS into the CSS area, and JavaScript into the JS area.
So the short answer is: clean the Figma HTML, divide it into reusable sections, convert those sections into Liferay fragments, upload assets into Liferay, and then adjust the CSS/JS for responsiveness and Liferay compatibility. Also, mention your Liferay version, for example 7.4/DXP version, because the best method can depend on whether you are using fragments, themes, or client extensions. |
Beta Was this translation helpful? Give feedback.
-
|
Adding another approach — especially if you're on Liferay DXP 7.4+ or Liferay Portal 7.4 GA: Using Client Extensions (Modern Approach)Client Extensions are the recommended modern way to integrate custom frontend code into Liferay without touching the core theme. This is especially useful when migrating Figma-exported HTML/CSS/JS. 1. Custom Element Client Extension # client-extension.yaml
type: customElement
name: my-figma-widget
htmlElementName: my-figma-widget
urls:
- /index.js
- cssURLs:
- - /index.css
- ```
Then build your Figma HTML/CSS/JS into a standard Web Component:
```js
class MyFigmaWidget extends HTMLElement {
connectedCallback() {
this.innerHTML = `
<!-- Your cleaned Figma HTML here -->
<div class="hero-section">...</div>
`;
}
}
customElements.define('my-figma-widget', MyFigmaWidget);2. CSS Client Extension # client-extension.yaml
type: themeCSS
name: figma-design-styles3. Static Content Client Extension (IFrame / Remote App) Key Advantage of Client Extensions over Fragments for this use case:
Quick Decision Guide:
What version of Liferay are you using? The approach may differ slightly between 7.3, 7.4, or DXP 2024.x (Quarterly Release). |
Beta Was this translation helpful? Give feedback.
Thank you for your valuable explanation