how can i change the order of two components within the same slot in spartacus? with hybris - spartacus-storefront

I'm trying to modify the default PDP(ProductDetailsPageTemplate) page that comes with Spartacus but I don't know how.
I'm new with Spartacus. I want to do the following:
Change the order of two components
move addToCart button component before the variant component within the summary slot.
I can't get it done. I've tried creating a new custom component but it didn't work, changing the layout-config and nothing.
PDP image:

You can modify the order by changing the position of the cms component in the backoffice.
In the backoffice, navigate to 'WCMS' > 'Content Slot' > 'ProductSummarySlot' for the catalog you are using.
I am assuming it is apparel from the picture, so change the 'Online' catalog if you want it to be rendered right away, or 'Staged' and re-sync the catalog.
From there, under 'properties' and 'components', you can just swap the positioning of 'Product Variant Selector' and 'Product Add To Cart' by dragging them.

Related

In React Admin, how to show SimpleFormIterator's first item by default so users do not have to click the add button the first time?

This is the component:
https://marmelab.com/react-admin/SimpleFormIterator.html
I want the first item to be required, and the user shouldn't be able to delete it.
As far as I understand, there is no built-in way for this component to do this, at this point.
I am wondering if there is a way to create a custom wrapper for this component, that can do this. Maybe render the first item separately within this custom wrapper?
To show the first item by default, you can set the default value to an empty array of objects.
<ArrayInput
source="address"
label="address"
defaultValue={[{}]}
></ArrayInput>

Tabbed Layout For Each Resource

I'd like to change the layout for my resources, so that the page /resource-name shows a card with the tabs "List", "Create", "Edit". I managed to make it "list" under the List tab using dataProvider(), but I can't figure out how to render the Create & Edit components under the relevant tabs. Any advice?
For what I understood you want to have a component with a <TabbedShowLayout> with tabs for list, create and edit on the route /resource? The route /resource is the one RA assumes when a component is provider in the list prop of <Resource>, so if you create a component with a <TabbedShowLayout> an in <Tab> list, put a <List> component, on create and Create component, and for edit an Edit component it might work for what you desire, I have not tested it. However see if is not ideal to use the props create, edit, and list of Resource, with them you can present data and have actions linking to one another.
Maybe your problem is in routing, since create in RA defaults to /resource/create, could you clarify your problem?

How to implement sidebar with settings for each component

I am just getting started with vuejs and after following a course on udemy I feel ready to dig in. To get started I need some pointers.
Take a look at this screenshot:
I have created a component call it example, when I click on the component I need on the left side of the component to show the settings for just that component. If I change those settings they should only be changed for selected component. If I select the second component settings with its own values should then be displayed to the left.
What is best way to do this? Sidebar on the left should only be visible if the component is clicked/selected. So I am guessing that the sidebar component which we can call settings should be a child of example component so that I can comunicate with this when it should be visible or not.
My question is how do I position the child component to the left like I have "mocked up" on the screenshot. Is it possible to copy settings component html into the left sidebar each time I click an example component?
How would you implement something like this?

How to create Framework7 side panel in normal vue?

I'm working with Vue+F7.
Is it possible to create new side panel in Vue, according to my scenario I need something like when app open the first page will come with one left side panel. Now when the user logged in I need to another side panel rather than the first one, because the content I would like to place is different.
If possible can anyone tell me how to create that panel in my example.vue?
Thanks
You can create a component where you sent a Json with the menu data.
For example:
{[
{"name":"name_route1", "route":"#/miRuta1.vue"},
{"name":"name_route2", "route":"#/miRuta1.vue"},
{"name":"name_route3", "route":"#/miRuta1.vue"}
]}
This way you would have the same component (you would use the same panel) but dynamically you would pass the elements that it is going to mount.
you can simply make both panels and show them conditionally based on the loggedIn boolean. with v-show this is very easy. check these out:
v if
v else if
v show

how to display multi level menu using ListViews

I have a set of multilevel data to be display using abovementioned component. Usually in PHP I simply iterate the data to display it as li but coming from web background, I just can't put it all together when using react-native. What is the right way to display a set of menu
FYI, I'm also using react-native-router-flux to manage the router.
If you want to build you own menu, you'll have to customize the renderRow of your ListView. If you take a look at RN's official doc on ListView here, it shows that you can specify a sectionID, for example.
You can then specify how each row renders.
renderRow: function (rowData, sectionID, rowID, highlightRow) => renderable
Takes a data entry from the data source and its ids and should return
a renderable component to be rendered as the row. By default the data
is exactly what was put into the data source, but it's also possible
to provide custom extractors. ListView can be notified when a row is
being highlighted by calling highlightRow(sectionID, rowID). This sets
a boolean value of adjacentRowHighlighted in renderSeparator, allowing
you to control the separators above and below the highlighted row. The
highlighted state of a row can be reset by calling highlightRow(null).
Another option is using open source modules built by the community.
The one closest to your needs I could find is : https://github.com/jaysoo/react-native-menu