AEM: Responsive Grid does not show layout mode - aem

I posted AEM related question in Adobe forums but I have still not able to resolve the configuration problems.
One is that I would like to show ruler and responsive emulator menu at the top of editor.html
Second is that I would like to components to have customizable with. For example, if you drop text component on a page at editor.html, you can adjust the width of the component with drugging blue dot on the side.
The original question in Adobe forum has my current configuration which is not quite working with screenshot and details.
Original question: https://forums.adobe.com/thread/2376694
Would anybody help me resolving the issue that I have?

There's several things you need to do to enable the ruler and layouting mode in AEM.
Ruler (Emulator)
make sure /libs/wcm/mobile/components/simulator/simulator.jsp is in the head of your page
register the page component with a MobileEmulatorProvider. For example:
com.day.cq.wcm.mobile.core.impl.MobileEmulatorProvider-alias.xml:
mobile.resourceTypes=[geometrixx-media/components/page]
add the cq:deviceGroup property to the root content node (i.e. /etc/mobile/groups/responsive)
Note: the ruler will not show up unless the page is treated as “responsive”. The “emulators” property must not be blank at http://localhost:4502/libs/wcm/core/content/pageinfo.json?path=<path to page>
Layouting Mode
add the cq:responsive node to the root content node (just grab it from geometrixx-media). For example:
<cq:responsive jcr:primaryType="nt:unstructured">
<breakpoints jcr:primaryType="nt:unstructured">
<phone jcr:primaryType="nt:unstructured" title="{String}Phone" width="{Decimal}768"/>
<tablet jcr:primaryType="nt:unstructured" title="{String}Tablet" width="{Decimal}1200"/>
</breakpoints>
</cq:responsive>
if not inheriting from the foundation page component, add /libs/foundation/components/page/cq:infoProviders/responsive node to page component
change the "par" parsys to be of type wcm/foundation/components/responsivegrid
include the responsive css client lib in the project (see below)
More info: https://docs.adobe.com/docs/en/aem/6-2/author/page-authoring/responsive-layout.html

Related

How to add the new unity uxml(via ui builder) to game screen?

I installed the new Unity UI Builder. Everything works just fine...
But how do I add the uxml to my scene or how do I attache it to camera?
I tried to drag and drop the uxml to camera and I searched for a component, but I couldn't find anything... Is there any official documentation?
You must use an gameObject with PanelRenderer.cs attached to it:
For now, I only know you have to set UXML file and USS file. In play mode, by magic (I still don't understand how unity does it), it will render.
In the Github project you can see how things are for now. UIElementsUniteCPH2019RuntimeDemo
EDIT:
The project linked above uses UI Builder 0.8.
Runtime support is still not available using the packet manager.
You can add the preview version to your project by adding the following line to your manifest.json (it's located in the projects Packages-folder)
"com.unity.ui.runtime": "0.0.4-preview"
You may want to check whether a newer version is available.
Keep in mind that the preview version is intended for previews only. The api and workflow might change with newer versions.
Once runtime support is enabled you can use the Panel Renderer as described above.
In Unity 2021.2, when you add a UI Document to the hierarchy, a PanelSettings asset is automatically created and assigned to the that UI Document.
Simply add your uxml file to the UI Document -- there is no Panel Renderer component anymore.
Even though the UI Builder offers a preview of the menu over the actual game scene, there is no way to use that menu in a game using Unity's functionality or packages. To do that we need to use the code that comes with the demo by Damian Campeanu from Unite Copenhagen 2019 that you can find here: https://github.com/Unity-Technologies/UIElementsUniteCPH2019RuntimeDemo.
The demo has following structure.
Structure of the project
The files that we are interested in are located in Assets/UIRuntime folder. Simply copy this folder into Assets folder of your project.
After copying the the folder,create empty game object, and add two components in the inspector. Panel Scaler and Panel Renderer.
Game menu object with panel scaler and panel renderer components
Panel Scaller is responsible for scalling your menu for the display. Choose "Constant Physical Size" and 96 for both Reference and Fallback DPI. Those are the values from the original demo and 96 DPI is a typical pixel density for most computer screens (it is different on mobiles and high density screens).
Panel Renderer is the place where you will set your UXML and USS (Unity Style Sheet) files (Uxml and Unity Style Sheet fields. Leave the last two of fields empty, and tick the "Enable Live Updates" checkbox. This will enable you to show the updates in the game viewport as you make them.
I wanted to comment under existing answer by Pablo but I'm new so I can't.

How to set up a TypoScript Playground in Typo 3?

How can one play around with TypoScript code shown in documentations about TypoScript?
Tested with a local Typo3 test instance, Typo3 version 9.5.5, Official Introduction Package installed.
In the backend, create a new page in the tree. Rightclick -> enable it (the red overlay should disappear). Make sure it is selected in the tree.
Click on the blue Template button on the left. Usually it will show you the blue No Template message.
Make sure on the top Info/Modify is selected from the drop down.
Click the gray + (New record) button under the drop down.
On the bottom, click Edit the whole template record.
Optionally give it a speaking template and website title, like 'Playaround' and 'Play Around'.
Optionally, under tab Options -> Clear, select Constants and Setup - this will clear everything this Template has inherited from parent templates, but will also disable the debug infos at the bottom of the frontend for this page (if you have installed the Official Introduction Package).
Under the tab General -> text entry Setup, enter the following TypoScript:
page = PAGE
page.10 = TEXT
page.10.value = Hello World
press the Save and then the View button.
A new tab opens, showing you the frontend for your page, printing the text 'Hello World'.
Now you can play around with the code examples given in eg. the TypoScript Reference.
Funnily enough, I just found out that Typoscript is by definition not a programming language, but a configuration description. That's why Typo3 is needed as a substructure for this, I think. There seem to be online demos of Typo3 on the net, but I don't know whether they are up to date and whether you can test TypoScript there. Therefore access local containers / installations as suggested. Or if the possibility exists a dev subdomain.

why do we need to inherit parbase component for all image components

According to Adobe's documentation for AEM development, we should inherit parbase component for all image rendering components.
Could anyone please share a rationale behind this necessity? and also Could anyone please point to other alternatives to this (if any)
Please have a loo at the Adobe AEM Forum Post:- http://help-forums.adobe.com/content/adobeforums/en/experience-manager-forum/adobe-experience-manager.topic.html/forum__3vh2-why_do_we_needtoin.html
Parbase is just a component from which you extend to get some OOTB functionality.
If I can say in technical language, Parbase is a key component as it allows components to inherit attributes from other components, similar to subclasses in object oriented languages such as Java.
For example, when you open the /libs/foundation/components/text node in the CRX Explorer, you see that it has a property named sling:resourceSuperType, which references the parbase component. The parbase here defines tree scripts to render images, titles, and so on, so that all components subclassed from this parbase can use this script.
While creating your own components, you don't need to add 'parbase' as a supertype, unless your components need to be enabled with drag-drop in a parsys.
AFAIK, the parbase component is never used explicitly, but only facilitates the rendering of a component when added in the Parsys.
"The parbase allows components to inherit attributes from other components"
If you check under "/libs/foundation/components", most of the authorable and draggable components have 'parbase' set as their 'sling:resourceSuperType' so that they can inherit the image and text rendering properties when added to a Paragraph system (Parsys Component).
Documentation link:- https://docs.adobe.com/docs/en/cq/5-6-1/wcm/default_components/designmode.html#parbase
I hope this helps.
Thanks and Regards
Kautuk Sahni
parbase has a img.GET.java file which will handle all requests that have the 'img' selector. If you call 'component.img.png' the image will be handled. If you don't inherit from parbase you'd have two options: implement the img.GET.java for your component or save in the component the resource type for the image. I usually do the later when I have a component which store the image data in sub-nodes.
If I want to save the image in a sub-node called image, this is what I add in dialog.xml:
<image
jcr:primaryType="cq:Widget"
cropParameter="./image/imageCrop"
ddGroups="[media]"
fileNameParameter="./image/fileName"
fileReferenceParameter="./image/fileReference"
mapParameter="./image/imageMap"
name="./image/file"
requestSuffix="/image.img.png"
rotateParameter="./image/imageRotate"
title="Image"
xtype="html5smartimage">
<items jcr:primaryType="cq:WidgetCollection">
<restype
jcr:primaryType="cq:Widget"
ignoreData="{Boolean}true"
name="./image/sling:resourceType"
value="/libs/foundation/components/image"
xtype="hidden"/>
</items>
</image>
this approach is discussed, for example, here: AEM Page Image in Page Properties Doesn't Apply a sling:resourceType

AEM Page Image in Page Properties Doesn't Apply a sling:resourceType

Using Adobe Experience Manager 5.6.1 (AEM) (Formerly CQ5) I am trying to create a new tab similar to the Image tab in Page Properties. It would be titled "Logo".
I basically just copied the Image tab to create a logo tab and renamed the paths to reflect the logo purpose. For instance, I set the fileReferenceParamater to ./logo/fileReference and requestSuffix to /logo.img.png.
When I edit the properties, I can drag an image into the tab just as I can with the "Image" tab, however, the image never appears there. I am guessing this is because the default image handler is not picking up the request. The error is:
Cannot serve request to
/content/my-site/home-page/en_us/jcr:content/logo.img.png in
org.apache.sling.servlets.get.DefaultGetServlet
When I looked at the content node there was no sling:resourceType. When I added a resource type of foundation/components/adaptiveimage then it worked. However, I noticed that the "Image" node didn't have a sling:resourceType. I guess the img.png.java servlet in the foundation page is handling that request.
I tried creating a logo.img.png.jsp file in my page component to handle the request, but that didn't seem to work.
How can I get AEM to either add the sling:resourceType or to handle the request?
I was facing the similar problem and I found a simpler way to resolve. All you need to do is to add a hidden xtype under the your logo image as below:
<yourlogo
jcr:primaryType="cq:Widget"
<-- other properties -->
xtype="html5smartimage">
<items jcr:primaryType="cq:WidgetCollection">
<resType
jcr:primaryType="cq:Widget"
ignoreData="{Boolean}true"
name="./logo/sling:resourceType"
value="foundation/components/image"
xtype="hidden"/>
</items>
</yourlogo>
Well, after some time experimenting, this is what I ended up doing to get this to work. If there is an easier way, I would be happy to know it.
First, I copied the /libs/foundation/components/page/img.png.java file and added it to my compiled package with some modifications.
#SlingServlet(
resourceTypes = "sling/servlet/default",
selectors = "imgnode",
extensions = {"png","jpg","jpeg","gif"},
methods = "GET"
)
public class SimpleImageServlet extends AbstractImageServlet {
Where img.png.java had the following line:
Image image = new Image(c.resource, "image");
I changed it to:
Image image = new Image(c.resource);
This relies on SCR annotations to generate the OSGi configuration so that this servlet will handle image requests having the imgnode selector. Instead of looking for a child image node it just expects the current resource to be an image.
Second, I added a component to the body.jsp overlay of the page component, like so.
<cq:include path="logo" resourceType="/apps/my-site/components/logo" />
This maps the logo path to a component for rendering.
Third, within the logo.jsp on the component I set the selector to imgnode rather than img.
Image img = new Image(resourcePage, "logo");
img.setSelector("imgnode");
I believe this step would be similar if the adaptiveimage were overlayed. You just need to render out URLs that include the imgnode selector.
Fourth, I setup the logo image dialog tab in page properties to use the expected requestSuffix and set the other properties to point to the logo sub-node.
Examples:
requestSuffix = "/logo.imgnode.png"
fileReferenceParameter = "./logo/fileReference"
Fifth, I made sure that the image dialog tab for the /apps/my-site/components/logo component pointed to itself.
Examples:
requestSuffix = ".imgnode.png"
fileReferenceParameter = "./fileReference"
Now whether it is in page properties, component editing, or final rendering, the image is handled appropriately.
this is a bit of a nuisance with using the image widget controls--only the image component nicely handles the data, and the servlet that handles ".img" is tied to the image component resourceType.
the easiest thing is to just use the value of the fileReference property instead of referencing the image as part of the page. since you're using assets from DAM, this is a reasonable approach.
this doesn't address the issue with a user uploading an image directly. i wanted to suggest having a hidden field like "./logo/sling:resourceType", but testing that locally resulted in an error when trying to save the dialog.
another approach is the following:
<sling:include resourceType="foundation/components/adaptiveimage" resource="${resource.path}/logo" />
(assuming resource is jcr:content). this is effectively the same as adding a sling:resourceType, but there are at least 2 downsides:
the image becomes authorable at that point as opposed to in the dialog
this method only works for rendering a normal tag. it won't work for any sort of background image

Windows Store App: Eliminates GridView styles and use only for hub page layout

I try to make a Windows Store App (Metro) hub page which has four different templates with GridView.
I referenced link in Creating hub page with different controls in Windows 8 page and it works fine.
But GridView has a default style which interacts with touch(and mouse) activity.
It grayed when hover, and shows click interaction.
My question is, how to disable those behaviors?
I tried to dig with Blend but hard to find the place to be customized.
Sorry I don't know MS Blend
But in visual studio please follow below instruction :
right click on your grid
go to Edit Additional Template
click on 'Edit Generated Item Container(ItemContainerStyle)' > 'Edit a Copy...'
go to XAML code and remove the PointerOver content from your code. the code should be like the following
//some code here
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="PointerOverPressed"/>
<VisualState x:Name="Disabled">
//continue