Adding layout templates to WebSphere Portal theme ear - websphere-portal

Question: How do I refer to my layout files form the changeLayout.json and layout.json files if the layout-template files are held in a theme ear/ear?
Background:
I'm developing a custom theme with custom layouts in Portal v8. I'm using the ear method for the theme deployment,s o I've got everything segregated into MyThemeDynamic.war and MyThemeStatic.war I've added my layout files to MyThemeStatic.war/themes/MyTheme/layout-templates
When I set the default layout template in the XMLAccess import, I can successfully see my custom layout.
But If I try to change the layout, it reverts back to the Portal 8.0 theme defaults.
I've tried several ways of referring to my layout files from layout.json.
I saw this: http://tinyurl.com/ch2nczp
but it prevents the default theme from working properly, and I want to keep both the default and this new custom theme.
I've also tried adding references to the xml access, as suggested here: https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14909102&#14909102
I feel like I'm close, but I'm missing something.

I combined static and dynamic theme assets into a single war file following these instructions:
http://www-10.lotus.com/ldd/portalwiki.nsf/dx/Create_a_custom_theme_without_WebDAV_with_8.0
That was ultimately what worked.

Related

How to change Keycloak logo on the Admin console page in keycloak.v2 theme

I am trying to find a way to replace Keycloak image on the Admin console page using Keycloak.v2 theme which is the default theme starting from Keycloak 19.
Note that replacing themes\keycloak.v2\account\resources\public\logo.svg didn't really help.
In Keycloak, one of the ways you can change the Keycloak logo is by overriding a theme. The benefit of doing it this way over forking and building the entire keycloak-admin-ui repo is you can control and focus only on customizing the components you want, cutting down the size of your new theme and reducing unnecessary duplication.
For your specific use-case (tested in Keycloak 20.0.1), I did the following to change the Keycloak Logo on the Admin Console Page:
Per the Theme Guide for Keycloak, custom themes can be added to keycloak by placing them into /opt/keycloak/themes. After Keycloak starts the theme can then be selected in the Realm Settings. Therefore, I created a new folder in /opt/keycloak/themes for my custom theme, called myCustomTheme.
The new folder will contain the theme definition for different parts of Keycloak. Since we only care about changing the logo in the Admin Console, we create a folder in /opt/keycloak/theme/myCustomTheme for overriding the Admin Console Theme. Per the defined set of theme types, this folder should be called admin. This is so that when you are selecting themes in Realm Settings within the Admin Console, the MyCustomTheme option will be listed under the Admin Console section (see images below).
Inside of /opt/keycloak/theme/myCustomTheme/admin is where the theme overriding begins. A configuration file called theme.properties should be created. This file is the first thing read by Keycloak when loading your theme and contains information about the theme environment. For more detailed information, see the description of Theme Properties.
Since we are overriding the keycloak.v2 theme, we add the parent field to the properties file, specifying the base theme we are inheriting from. We set it to keycloak.v2, so that myCustomTheme will inherit the keycloak.v2 theme for all of its components unless we are overriding something specific.
parent=keycloak.v2
This next step required a bit of exploration and trial-and-error of how the default keycloak.v2 theme is structured, but I found that the place where the Keycloak logo is defined for keycloak.v2 is in keycloak.v2/admin/resources/logo.svg. Therefore, for myCustomTheme, all one would have to do to use a custom logo that overrides the default keycloak.v2 one is add a resources folder to /opt/keycloak/theme/myCustomTheme/admin and add the custom SVG image as a file called logo.svg.
Note that this is different than what the Keycloak Docs suggest, which has you creating the same resources folder but also an img folder inside of it which would contain your images. I suspect this has to do with the fact that we are overriding an image instead of adding one, and the keycloak.v2 theme code does not follow its own guide and instead places its logo in resources instead of resources/img.
Start Keycloak, go to the Admin Console, sign in and go to Realm Settings > Themes > Admin Console theme, and select myCustomTheme. Refresh and you should see your icon change now.
Below is the results of doing the above, showing my resulting folder structure and the Before/After of replacing the Keycloak logo with some random SVG I got from public domain:
Folder structure: https://ibb.co/h9kZqb3
Before/After: https://ibb.co/cJ6t434
The new admin UI (starting from keycloak 19) has been delivered through keycloak-admin-ui.jar. In order to customize any UI components, it has to be done by forking this repo and build on your own.

Preview Theme functionality in Cakephp3

In my AppController i'm assigning the active theme like this:
$this->viewBuilder()->theme($this->Themes->active_theme());
I've created a page which shows all my themes (I'm using a json file for this), i want to add a preview theme functionality to every theme in my page just like wordpress, drupal etc.
I'm not sure how to can i temporarily load a theme using app controller for previewing purpose.
Any help on how this functionality works and how can i do it in Cakephp would save my day.
In your preview function, call $this->viewBuilder()->theme($previewTheme);? Seems pretty straight-forward, am I missing something?

CakePHP - Letting the User Select the Layout

Im working on a CakePHP application that will display a DVD collection. I would like to include a Dropdpwn Menu where the user can select their on view/colour scheme. Nothing fancy, it just needs to either change the layout file for the CSS file. Either will work.
Any tips? Can't seem to figure it out.
Regards,
Jon
Use Themes to switch either layout, css, or both.
In your AppController.php add:
$this->theme = 'Fancy';
This will look for your default layout in App/View/Themed/Fancy/default.ctp. You choose what you want to customize with a theme. If you don't have a special layout file for the Fancy theme, CakePHP will default to App/View/Layouts/default.ctp. Likewise, you can choose to provide a special stylesheet in your theme which would go in App/View/Themed/Fancy/webroot/css/default.css and if not CakePHP would use App/View/webroot/css/default.css.
You can set the user's theme selection to a Cookie so it's remembered.
You didn't say which version of CakePHP you're using, but the solution will be similar in either 2.x or 3. The above links are to the 2.x Cookbook.

Wordpress: theme folder level issue

I have installed a theme like this:
wp-content/themes/themename-main/themename-theme
Installation worked fine, I began editing my site, that was good. But, I faced a problem with navbar menu that didn't display my menus, so I went to the theme provider site, and they said that theme must be installed as follow:
wp-content/themes/themename-theme and not wp-content/themes/themename-main/themename-theme
So I decided to move wp-content/themes/themename-main/themename-theme
to themes folder and reinstall my theme. Since I've done this, it has messed up with images and content, that disappeared.
How can I solved that ? I just changed the folder level of themename-theme in wp-content/themes
Big thanks in advance
If you revert back to another theme, does the issue still persist?
If the images and content are back in place and are showing then it is most likely a theme issue.
if you have any knowledge of CSS then I would suggest that you go to the stylesheet and look for the .navbar or .navigation depending on what they are using.
(Could also be #navbar or #navigation)
if you menu's aren't showing then it will be in the Stylesheet where it hides the lower level tears. Check for code set to display:none or visibility:hidden and change those attributes and see if the menu shows.
Removing sections of css code and then re-adding them will not mess your site out as long as you place it back correctly.
This sounds like a Stylesheet error to me and if so then the only one that can help you are the Devs.
Also if you have another site then you can try and test it there and see if it has the same problem which will determine a fault with the theme.

Drupal 7: How to create a "shippable" theme?

I'm creating a new Drupal theme for news web sites, which needs some fields to be added to the Article content type to work. For example, the theme will change the header image into something science-related when the user is viewing an article tagged with the term "Science" of a taxonomy called "Section".
I have set up the "Section" vocabulary and added it as a field to my Article content type manually, but the theme I'm making should be "shippable" to end customers, meaning that someone should be able to download it and install it without manually creating taxonomies and fields.
The theme must in some way notify the user that it depends on the Taxonomies module, and, when installed, the theme must create the relevant taxonomies and add fields for it to the "Article" content type.
What is the best way to accomplish this in Drupal 7? The only way I can think of is to create a specific "installer module" for my theme, that officially depends on Taxonomies and are able to add the right fields to Article etc, but there must be a more robust and "standard" way to accomplish this?
Making a theme depend on modules isn't very "standard". Themes only deal with the display, while modules deal with function. If you're making this theme only for this client, I wouldn't bother trying to integrate the two. Now if you're wanting to keep this for down the road, then it's like an installation profile, or themes you would see on ThemeForest that come bundled with a database.
I'd recommend moving any non-theme parts (like content type, fields, etc) into a feature using the Features module. It will help you keep your functionality separate from the theme. If you want to add custom CSS into the feature, just use the drupal_add_css() hook the in .module file that gets generated.

Resources