How to supply an image to create and apply a dynamic content based color scheme? - material-design

The Material 3 Design guidelines describes the option of theming based on content (instead of theming based on the current wallpaper of the user). See below for the section:
https://m3.material.io/styles/color/dynamic-color/user-generated-color#8af550b9-a19e-4e9f-bb0a-7f611fed5d0f
Now applying a dynamic theme to an activity on android works with:
DynamicColors.applyToActivityIfAvailable(this);
But how do you:
Generate a theme based on content (preferably using a view or an image)?
Apply that generated theme?
Are there methods available for this?

Related

How to customize blog portlet in liferay

I am new to liferay and using liferay-ce-portal-7.0-ga3 i have placed a blog and able to write contents in it. i want to change the blog portlet design by adding thumbnail preview to it . My current view is it has either title,abstract and full content view. How could i customize to get blog view
You can customize Liferay's appearance through Application Display Templates (ADT). Unfortunately there's no sample for the OOTB appearances, but when you go to your site's (or the global site's) Configuration area, you can find/edit/create ADTs there. Depending on the markup and CSS, as well as your typical image size etc., the actual ADT you write would be different, thus impossible to include anything here.
The editor however, has some autocomplete and some predefined entries/fields, that should give you a starting point. E.g. when you just open a blank editor and hit the "Blog Entries" field, you'll end up with
<#-- Application display templates can be used to modify
the look of a specific application. Please use the
left panel to quickly add commonly used variables.
Autocomplete is also available and can be invoked
by typing "${". -->
<#if entries?has_content>
<#list entries as curBlogEntry>
${curBlogEntry.title}
</#list>
</#if>
You'll find what you can do with BlogsEntry in it's javadoc, make sure to follow the BlogsEntryModel superclass link as well to see more.
I'll have to leave the exercise to generate proper markup and styling to you though.

AlloyUI: how to customize DiagramNode with no icons but multiple labels or attributes to be shown

I am building a simple flow chart editor using AlloyUI, following this example, and I want to customize it more, in a way that there is no icon but names and attributes can be shown together in a svg container. If there is any similar example, or any suggestions of doing this?

How to create Layout Based on Layer in Orchard

I am trying to create a different layout for a sub-section of my website using Orchard.
Let's say I wanted to give www.site.com/Shop a different layout from the rest of the website; how would I go about doing this?
I have tried looking for a way to do this using layers but have got stuck.
There are several ways to achieve different layout, since I don't know your specific needs I'll throw in some extra possible routes
Use url shape alternate (I guess you need this one)
You have to enable Url Alternates module and it lets you create shape alternates based on url. For example if your page is www.site.com/shop you can then create view under your theme Layout-url-Shop.cshtml and it will be used instead of default Layout.cshtml on your shop.
Orchard documentantion: URL and Widget Alternates
Use 1.x or wait for 1.9
There you can define dynamically different layout per content item aka page. But I find it good only for content not the base layout which is present in layout.cshtml
Create minisite
How to create a minisite inside your Orchard website

Orchard CMS - injecting css classes into navigation / editing navigation HTML

I have a site laid out in HTML/CSS - based on Twitter Bootstrap.
I have created a new template in a new orchard instance.
I have a navigation that requires some classes from bootstrap applied to the .
The Orchard Layout uses this for navigation:
#Display(Model.Navigation)
How can I edit the HTML it outputs - and / or add some classes to the ul that's rendered in the navigation by Orchard?
Thanks.
That line in Layout.cshtml is showing the navigation zone, which is one of the widget zones.
In a standard Orchard setup a Menu Widget gets placed in that zone. You can check on the Widgets page in the admin. This doesn't directly show the menu widget though. This is done by another template.
In most cases the easiest way to find out which templates are being used is to use the Shape Tracing tool, which is part of the Orchard Designer Tools. There's an intro to Shape Tracing in the Orchard Documentation.
There are several layers of menu templates and it is a bit tricky to find these in the shape tracing tool.
The templates relevant to menus that you may need to include in your theme are:
MenuItemLink.cshtml
MenuItemLink-ContentMenuItem.cshtml
MenuItem.cshtml
If you can't find them in the shape tracing tool, then do a file search in your solution and copy these files to your theme.
One option could be to use Vandelay.Classy module and add classes to your content item http://orchardproject.net/gallery/List/Modules/Orchard.Module.Vandelay.Industries
Other could be to create a alternate template for Navigation Shape. you can designer tools to create alternate.
http://orchardproject.net/gallery/List/Modules/Orchard.Module.Vandelay.Industries

Use image buttons for pagination - Drupal

The default pagination in drupal is great, but the text links are used
<<first <previous 6 7 next> last>>
But I need to use forward and backward image buttons instead of text links. Can anyone point me in the right direction?
Depending on what portions of the pager you're interested in replacing with images, you may be able to use CSS background images, without having to override the theme function. However, in the default pager output, not all the links may have unique classes.
That said, if you're using Drupal's default pager, you can override the theme_pager function to add your image links.
If you're using the Views module, you may be using a different theming function. When in doubt, you should be able to use the Theme Developer module to find which function or template file is outputting the part of the page you're interested in theming. Theme Developer will also tell you what suggestions you can use to override the output.

Resources