-
Notifications
You must be signed in to change notification settings - Fork 367
Fix/custom layout build #5672
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix/custom layout build #5672
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,7 @@ | |
|
|
||
| - `authenticationendpoint` | ||
| - `accountrecoveryendpoint` | ||
| - `x509certificateauthenticationendpoint` | ||
|
Check failure on line 9 in en/includes/guides/branding/add-custom-layouts.md
|
||
|
|
||
| ## General components of the UI | ||
|
|
||
|
|
@@ -19,7 +19,7 @@ | |
| This section explains the special syntax that you can use to create a custom layout. | ||
|
|
||
| - **Condition block** | ||
|
|
||
|
Check failure on line 22 in en/includes/guides/branding/add-custom-layouts.md
|
||
| This is similar to an `IF` block. In the following example, the condition block will activate or deactivate according to the value of the `isPolicyPage` variable. | ||
|
|
||
| ```html hl_lines="1 17" | ||
|
|
@@ -43,13 +43,13 @@ | |
| {{/isPolicyPage}} | ||
| {% endraw %} | ||
| ``` | ||
|
|
||
|
Check failure on line 46 in en/includes/guides/branding/add-custom-layouts.md
|
||
| - If the value of `isPolicyPage` is `true` or any non-empty string, then the content inside the block will be executed. | ||
|
Check failure on line 47 in en/includes/guides/branding/add-custom-layouts.md
|
||
| - For all other values including `null` and `undefined`, the content of the block will not be executed. | ||
|
Check failure on line 48 in en/includes/guides/branding/add-custom-layouts.md
|
||
|
|
||
| - **Not Condition Block** | ||
|
|
||
| This is similar to an `IF` block but with a NOT condition. | ||
|
Check failure on line 52 in en/includes/guides/branding/add-custom-layouts.md
|
||
|
|
||
| ```html hl_lines="1 12" | ||
| {% raw %} | ||
|
|
@@ -68,8 +68,8 @@ | |
| {% endraw %} | ||
|
|
||
| ``` | ||
|
|
||
|
Check failure on line 71 in en/includes/guides/branding/add-custom-layouts.md
|
||
| - If the value of `isPolicyPage` is `false`, an empty string, `null` or `undefined`, the content inside the block will be executed. | ||
|
Check failure on line 72 in en/includes/guides/branding/add-custom-layouts.md
|
||
| - For all other values, the content of the block will not be executed. | ||
|
|
||
| - **Component Syntax** | ||
|
|
@@ -167,11 +167,23 @@ | |
|
|
||
| ### Step 3: Add a custom layout design | ||
|
|
||
| To add a custom layout to the login page: | ||
| Prerequisites | ||
| - `NodeJS v20.x` | ||
| - `npm v8.x` | ||
| - `PNPM v8.x ` | ||
| - `yarn v1.22.x` | ||
| - `JDK 11` | ||
|
|
||
| !!! note | ||
| Make sure the build server has an active Internet connection to download dependencies while building. | ||
|
|
||
| !!! tip | ||
| Go through the [troubleshooting guides]([https://wso2.github.io/using-maven.html](https://github.com/wso2/identity-apps/blob/master/docs/TROUBLESHOOTING.md)). | ||
|
|
||
| To add a custom layout to the login page: | ||
| 1. Navigate to `webapps/authenticationendpoint/extensions/layouts/custom/carbon.super/` and follow the instructions provided below: | ||
|
|
||
| 1. Copy the code snippet from the [html file](https://github.com/wso2/docs-is/tree/master/en/identity-server/{{is_version}}/docs/assets/code-samples/body.html){target="_blank"} into the `body.html` file. | ||
|
Check warning on line 186 in en/includes/guides/branding/add-custom-layouts.md
|
||
|
|
||
| 2. Copy the code snippet from the [css file](https://github.com/wso2/docs-is/tree/master/en/identity-server/{{is_version}}/docs/assets/code-samples/style.css){target="_blank"} into the `styles.css` file. | ||
|
|
||
|
|
@@ -199,7 +211,7 @@ | |
| Select **Custom** layout as the **Login Layout** and click **Save & Publish** to apply the branding configurations. | ||
|
|
||
| !!! tip | ||
| If the server stops working after the changes are added, restart the server before verifying the changes. | ||
| If the server stops working after the changes are added, restart the server before verifying the changes. | ||
|
Check warning on line 214 in en/includes/guides/branding/add-custom-layouts.md
|
||
|
|
||
| 5. Refresh the browser and check out the added custom layout. | ||
|
|
||
|
|
@@ -208,6 +220,6 @@ | |
|
|
||
| Use the following best practices when creating a custom layout: | ||
|
|
||
| - Add a prefix for the new CSS classes so that the newly added classes will not conflict with existing classes. | ||
|
Check failure on line 223 in en/includes/guides/branding/add-custom-layouts.md
|
||
|
|
||
| - In your development environment, be sure to add the `cache="false"` flag as a parameter in the `<layout:main>` tag of all pages that require testing with the custom layout. With this flag in place, the layouts will compile at runtime eliminating the need to manually recompile layouts. Remember to remove this flag in the production environment. | ||
| - In your development environment, be sure to add the `cache="false"` flag as a parameter in the `<layout:main>` tag of all pages that require testing with the custom layout. With this flag in place, the layouts will compile at runtime eliminating the need to manually recompile layouts. Remember to remove this flag in the production environment. | ||
|
Check warning on line 225 in en/includes/guides/branding/add-custom-layouts.md
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you verify that the repository builds successfully with all of these package managers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
identity-appsonly works withpnpm.Can we have a screenshot of a successful build to confirm your changes are working?
@drsamitha
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the responses! I’m honestly not confident about this PR yet and I think this is also not enough for address the issue. Could you please suggest some instructions or a guide to help make the fix?
Also, what if we additionally add two separate scripts for Windows and Linux to the documentation section that automate the confusing copy-pasting and build steps? That should help reduce dependency failure errors, right? For now i use this basic script,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only with the pnpm.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did u mean Screenshots of custom layout builds?

if so, Identity apps successfully build the custom layout pages.
PS - browser messed up the theme
TBH, i cant remember why i have included the other package managers.