How to update magento 2 checkout layout? - magento2

I am trying to update my checkout layout to use two columns, so the checkout fields are in the left column and the cart summary is in the right column.
In my checkout_index_index.xml, I have created two containers like:
<container htmlTag="div" htmlClass="checkout-main col-md-6">
</container>
<container htmlTag="div" htmlClass="checkout-aside col-md-6">
</container>
I am unsure how I can move the elements/items within the onepage.phtml into the correct columns?
Can anyone please advise how it is possible to update the checkout layout?
checkout_index_index.xml
http://cnhv.co/1bq62

If you want to move the element inside XML, you can add before or after inside <container> parameter.
So your codes can modify like this:
<container htmlTag="div" htmlClass="checkout-main col-md-6" before="<block_name>">
</container>
<container htmlTag="div" htmlClass="checkout-aside col-md-6" after="<block_name>">
</container>
Depends on where you want to place, you can use before or after respectively. Remember to clear cache after any edits take effect.
Ref: http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/xml-instructions.html#fedg_layout_xml-instruc_ex_mv

Related

How to Add additional columns to links page to ExternalLink types

How to add columns to ExternalLink on the "Links" page on Azure DevOps Workitem ?
Answered : Not Possible see answer below
Pull Request is not like Code Review Request, it's not a work item
type, we cannot see it from the exported process template. So, I don't
think we can customize the columns like the common work item types. –
Andy Li-MSFT
after going through the following links
link1
link2
and trying the workaround discussed here
I have failed to add more columns to links of the type externallink
i have added the following code as described:
<Page Label="Links" LayoutMode="FirstColumnWide">
<Section>
<Group Label="links">
<Control Type="LinksControl" Name="links">
<LinksControlOptions>
<LinkFilters>
<ExternalLinkFilter Type="Build" />
<ExternalLinkFilter Type="Integrated in build" />
<ExternalLinkFilter Type="Pull Request" />
<ExternalLinkFilter Type="Branch" />
<ExternalLinkFilter Type="Fixed in Commit" />
<ExternalLinkFilter Type="Fixed in Changeset" />
<ExternalLinkFilter Type="Source Code File" />
<ExternalLinkFilter Type="Found in build" />
<ExternalLinkFilter Type="GitHub Pull Request" />
<ExternalLinkFilter Type="GitHub Commit" />
</LinkFilters>
<Columns>
<Column Name="System.State" />
<Column Name="System.ChangedDate" />
<Column Name="System.PullRequest.IsFork" />
</Columns>
</LinksControlOptions>
</Control>
</Group>
</Section>
</Page>
But the results still show only the original columns.
The problem is that the field/column you added (<Column Name="System.PullRequest.IsFork" />) is not a valid work item filed/column. The workaround is only available for work item types due to the columns depend on work item fields.
You need to add a valid work item field/column here. We can get all the available work item fields by calling the Get Work Item REST API with parameter $expand=Fields added in the URL from a specific work item.
GET https://{instance}/{collection}/{project}/_apis/wit/workitems/{id}?$expand=Fields&api-version=4.1
For example, the following screenshots shows all the available fields for my Task work item. (It depends on how you defined the fields, if you defined a custom field, you can also see it from the response body.):
After that, we can add the columns (System.CreatedBy and Microsoft.VSTS.Common.Priority for example in this sample)
Then check the behavior in a Task work item:
Please note that, Pull Requests is not a work item type. We cannot get valid work item fields by calling the Pull Requests REST API. In this case, I don't think we can customize the columns like the common work item types.

Move 1st column header to each row in certain width

Whenever the browser size goes below Desktop width, I want my responsive table to hide the column headers and instead place them in the same row as its corresponding values for each entry.
Here is a visual example of what I want:
Desktop width
Below desktop width
It seemed to me that the way to achieve this behavior was by adding...
minScreenWidth="desktop"
demandPopin="true"
...to the <Column> tag, but this does not work for the 1st column.
So my question is: How to (nicely) implement that behavior for the 1st column?
Here's my minimal example code (I changed the Table.view.xml of this example):
<Table items="{/ProductCollection}">
<columns>
<Column>
<Text text="Supplier" />
</Column>
</columns>
<ColumnListItem>
<Label text="{SupplierName}" />
</ColumnListItem>
</Table>
Responsive table doesn't allow pushing all column headers to the items. From the API reference:
The sap.m.Table control requires at least one visible sap.m.Column in the columns aggregation, therefore applications must avoid configuring all columns to be shown in the pop-in. If such a conflict is detected, then the table prevents one column from moving to the pop-in.
You'll have to add at least one more column so that the 1st column does pop-in.
Related GitHub issue: https://github.com/SAP/openui5/issues/1396

Why table column headers change their width&

I open one table in the dialog window. And it looks like this:
Normal table
But if I close the dialog and reopen it, table column headers becomes more narrow like this:
Strange table
When I resize column width, headers become normal.
I use code from example SAPUI5 Explored | Grid Table
(sapui5.hana.ondemand.com/explored.html#/sample/sap.ui.table.sample.Basic/code/View.view.xml)
<t:Table
rows="Data>/Table}"
class="sapUiSmallMargin"
selectionMode="None"
enableSelectAll="false"
visibleRowCount="17">
<t:columns>
<t:Column
showFilterMenuEntry="false"
showSortMenuEntry="false"
width="3rem">
<Label text="Num" />
<t:template>
<Text text="{Data>Row}"/>
</t:template>
</t:Column>
...
And I can't understand, what is the problem.
Any ideas?
I have come across this myself as well in certain browsers (Chrome), but not in others (such as IE11).
I believe that this is a browser-specific SAPUI5 rendering problem, and not a mistake in your coding.
If you do not set the width of the column manually, it will probably work just fine. If this is unacceptable, your could manually have the table to rerender once (just like what happens when you drag the width of the column).

Is it possible to define a form for a single row in a panelgrid?

Is it somehow possible to have a form for a single row in a panelGrid? If I just put the specific columns in a form-Tag they are (of course) rendered in one single column of my parent panelGrid.
Is there a possibility to solve this problem? It does not matter if a solution use the jsf-tag or the primefaces-tag
I am using Mojarra 2.1.26 and Primefaces 4.0
use partial process/update.
if your requirement is to send only data in specific row (and not sending other http parameters, even if they are not processed) add partialSubmit feature:
<h:form>
<p:panelGrid id="grid">
<p:row id="row1">
<p:column>
<p:inputText value="#{someBean.someProperty}"/>
</p:column>
<p:column>
<p:inputText value="#{someBean.anotherProperty}"/>
</p:column>
</p:row>
<!-- other rows -->
</p:panelGrid>
<p:commandButton action="#{someBean.someAction}" process="#this row1"
update="grid" partialSubmit="true" value="submit"/>
</h:form>
this behave the same (almost) as having a form just for row1.
note that you have to update grid because p:panelgrid renders its child components on its own.
however your desired behavior (exactly) is not possible using plain html either.

XDT Transform: InsertBefore - Locator Condition is ignored

I have a web.config file in which I need to either insert the <configSections /> element or manipulate children of that node if it already exists.
If it already exists I don't want to insert it again (obviously, as it is only allowed to exist once).
Normally, that would not be a problem, however:
If this element is in a configuration file, it must be the first child element of the element.
Source: MSDN.
So if I use xdt:Transform="InsertIfMissing" the <configSections /> element will always be inserted after any existing child elements (and there are always some), violating the above restriction of it having to be the first child element of <configuration />
I attempted to make this work in the following way:
<configSections
xdt:Transform="InsertBefore(/configuration/*[1])"
xdt:Locator="Condition(not(.))" />
Which works perfect, if the <configSections /> element doesn't already exist. However, the condition I've specified seems to be ignored.
In fact, I've tried a few conditions like:
Condition(not(/configuration[configSections]))
Condition(/configuration[configSections] = false())
Condition(not(/configuration/configSections))
Condition(/configuration/configSections = false())
Finally, out of desperation, I tried:
Condition(true() = false())
It still inserted the <configSections /> element.
It is important to note that I'm trying to include this in a NuGet package, so I will be unable to use a custom transform (like the one AppHarbor uses).
Is there any other clever way to get my element in the right place only if it doesn't yet exist?
To test this out, use AppHarbors config transform tester. Replace the Web.config with the following:
<?xml version="1.0"?>
<configuration>
<configSections>
<section name="initialSection" />
</configSections>
</configuration>
And Web.Debug.config with the following:
<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<configSections
xdt:Transform="InsertBefore(/configuration/*[1])"
xdt:Locator="Condition(true() = false())" />
<configSections>
<section name="mySection" xdt:Transform="Insert" />
</configSections>
</configuration>
The result will show two <configSections /> elements, the one containing "mySection" being the first, as specified in the InsertBefore Transform.
Why was the Locator Condition not taken into account?
So after facing the same issue, I came up with a solution. It's not pretty nor elegant, but it works. (At least on my machine)
I just split the logic into 3 different statements. First, I add an empty configSections at the correct position (first). Then I insert the new config to the last configSections, which would be the new one if it is the only one, or a previously existing one otherwise.
Lastly I remove any empty configSections elemnt which might exist. I'm using RemoveAll for no good reason, you should probably use Remove.
The overall code looks like so:
<configSections xdt:Transform="InsertBefore(/configuration/*[1])" />
<configSections xdt:Locator="XPath(/configuration/configSections[last()])">
<section name="initialSection" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing" />
</configSections>
<configSections xdt:Transform="RemoveAll" xdt:Locator="Condition(count(*)=0)" />
The question which still remains unanswered is why Locator conditions are not taken into account for InsertBefore. Or why I can't handle an empty match set for InsertBefore, because that would allowed me to do fun things such as
//configuration/*[position()=1 and not(local-name()='configSections')]
Which to be honest is a much clearer way of doing what I want to achieve.