Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Custom Layout Update file selectable generally available in all categories, products and cms pages. #26901

Open
gcampedelli opened this issue Feb 17, 2020 · 9 comments
Labels
feature request Issue: ready for confirmation Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: ready for grooming Reported on 2.3.4 Indicates original Magento version for the Issue report. Severity: S2 Major restrictions or short-term circumventions are required until a fix is available.

Comments

@gcampedelli
Copy link

gcampedelli commented Feb 17, 2020

Description (*)

Currently in version 2.3.4 Custom Layout Update has been removed to improve security which is great. But to add an update you have to create a xml file in relevant theme directory Magento_Cms, Magento_Catalog using this termination:

catalog_category_view_selectable_<Category ID>_<Layout Update Name>.xml
catalog_product_view_selectable_<Product SKU>_<Layout Update Name>.xml
cms_page_view_selectable_<CMS Page Identifier>_<Layout Update Name>.xml

a) I tried this feature in using this termination "cms_page_view_selectable_mylandingpage_custom.xml"

b) It would be nice if we declare a file with custom layout update and it is generally available to be selected in all pages, categories and products.

Expected behavior (*)

a) Update Dev Docs to make it clear in which folder files have to be saved. => Magento_Cms for pages and Magento_Catalog for categories and products.
b) Have custom layout updates generally available for all pages, categories and products, so user can select and update layout without creating many files with same code over and over. For example:

catalog_category_view_selectable_<All Categories>_<Layout Update Name 1>.xml
catalog_category_view_selectable_<All Categories>_<Layout Update Name 2>.xml
cms_page_view_selectable_<All CMS Pages>_<Layout Update Name 1>.xml
cms_page_view_selectable_<All CMS Pages>_<Layout Update Name 2>.xml

and keep the current feature which is also great

Benefits

=> I think it would improve usability. Users can have a generally available custom layout update and specific available custom layout updates

Additional information

It would save time if user wants only to repeat an already made custom layout update.

@m2-assistant
Copy link

m2-assistant bot commented Feb 17, 2020

Hi @gcampedelli. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

@gcampedelli do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Feb 17, 2020
@engcom-Bravo engcom-Bravo self-assigned this Mar 24, 2020
@magento magento deleted a comment from m2-assistant bot Mar 24, 2020
@engcom-Bravo
Copy link
Contributor

engcom-Bravo commented Mar 24, 2020

@sdzhepa Please, move this issue to the appropriate feature request repo.

Thank you

@in-session
Copy link
Contributor

in-session commented May 31, 2020

Is there anything news on this topic?

At least it would then be possible to output basically different layouts in the frontend, I think this would even be very important.

catalog_product_view_selectable_<All Products Pages>_<Layout Update Name 1>.xml
catalog_product_view_selectable_<All Products Pages>_<Layout Update Name 2>.xml

@hewgim
Copy link

hewgim commented Sep 3, 2020

Any news on this. The ability to have reusable layout updates for category, product and cms pages would be extremely useful

@sidolov sidolov added this to Ready for Grooming in Low Priority Backlog Sep 24, 2020
@m2-community-project m2-community-project bot moved this from Ready for Grooming to Dev In Progress in Low Priority Backlog Sep 24, 2020
@in-session
Copy link
Contributor

in-session commented Oct 4, 2020

At least it would then be possible to output basically different layouts in the frontend, I think this would even be very important.

catalog_product_view_selectable_<All Products Pages>_<Layout Update Name 1>.xml
catalog_product_view_selectable_<All Products Pages>_<Layout Update Name 2>.xml

In fact, I think it would make more sense to show these not for all products, but for the individual product types.

catalog_product_view_type_<type>_selectable_<Layout Name>.xml

Example:

catalog_product_view_type_bundle_selectable_Layout1.xml
catalog_product_view_type_bundle_selectable_Layout2.xml

Benefits
This has the advantage that a simple layout update can be made on all types. This would give you a global layout for all products and you could also adapt it directly to the type.

catalog_product_view_type_single_selectable_Layout1.xml
catalog_product_view_type_configurable_selectable_Layout1.xml
catalog_product_view_type_grouped_selectable_Layout1.xml
catalog_product_view_type_bundle_selectable_Layout1.xml
catalog_product_view_type_virtual_selectable_Layout1.xml
catalog_product_view_type_downloadable_selectable_Layout1.xml

@ghost ghost unassigned engcom-Bravo Oct 8, 2020
@sidolov sidolov added this to Ready for Confirmation in Issue Confirmation and Triage Board Oct 20, 2020
@ghost ghost removed this from Ready for QA in Community Backlog Oct 20, 2020
@ghost ghost removed this from Dev In Progress in Low Priority Backlog Oct 20, 2020
@ghost ghost added Issue: ready for confirmation and removed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed labels Oct 20, 2020
@sivaschenko sivaschenko added Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Severity: S2 Major restrictions or short-term circumventions are required until a fix is available. labels Nov 6, 2020
@m2-community-project m2-community-project bot added this to Ready for Grooming in Feature Requests Backlog Nov 6, 2020
@m2-community-project m2-community-project bot removed this from Ready for Confirmation in Issue Confirmation and Triage Board Nov 6, 2020
@magento-engcom-team magento-engcom-team added the Reported on 2.3.4 Indicates original Magento version for the Issue report. label Nov 13, 2020
@yangshuqiugithub
Copy link

yangshuqiugithub commented Nov 26, 2021

After all this discussion, why don't I see a solution

@griffinsbridge
Copy link

After all this discussion, why don't I see a solution

Because this is Magento :/

@jlenzstaysafe
Copy link

How are you not going to let people reuse design layout updates? Like, come on... Use common sense... Who wants to create duplicate files and issue more deployments?

@gabrielgts
Copy link

gabrielgts commented Jun 6, 2023

I created this guy here for now : https://github.com/gabrielgts/magento2-selected-layout

Then I will try to make an MR with the functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issue: ready for confirmation Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: ready for grooming Reported on 2.3.4 Indicates original Magento version for the Issue report. Severity: S2 Major restrictions or short-term circumventions are required until a fix is available.
Projects
Feature Requests Backlog
  
Ready for Grooming
Development

No branches or pull requests