Skip to content

Fix to include an else to display a "static block" only #9450

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

Closed
wants to merge 1 commit into from
Closed

Fix to include an else to display a "static block" only #9450

wants to merge 1 commit into from

Conversation

nathanchick
Copy link

@nathanchick nathanchick commented Apr 28, 2017

Description

Whilst working, we noticed that when we set the category to show static block only nothing showed on the fronted. When taking a look at the view file we noticed this was not included.

@magento-cicd2
Copy link
Contributor

magento-cicd2 commented Apr 28, 2017

CLA assistant check
All committers have signed the CLA.

@ishakhsuvarov ishakhsuvarov self-assigned this May 2, 2017
@ishakhsuvarov ishakhsuvarov added this to the May 2017 milestone May 2, 2017
@ishakhsuvarov
Copy link
Contributor

Hi @nathanchick
I have tried to reproduce the issue you have described on the latest develop branch and did not succeed. Could you please provide detailed steps for manual testing?

Additionally, Catalog/view/frontend/templates/category/products.phtml already contains pretty same logic. Please check if it is what you have been looking for.
Thank you.

@nathanchick
Copy link
Author

The contents of the file does not contain the else I have added.

If it is not in content mode or is in mixed it will show products otherwise nothing.

So if the admin panel is set to 'Static Block' only it will not show the static block that has been selected on the product list page.

Additionally, Catalog/view/frontend/templates/category/products.phtml already contains pretty same logic. Please check if it is what you have been looking for.

Please check the diff you will see what has been added and what it is currently missing.

@okorshenko okorshenko modified the milestones: May 2017, June 2017 Jun 1, 2017
@ishakhsuvarov
Copy link
Contributor

@nathanchick Could you please provide exact steps you follow to reproduce the problem?
We can not achieve the same result as you describing.
Thank you!

@nathanchick
Copy link
Author

@ishakhsuvarov Yeah sure, it is only a small oversight but does need adding to the core.

  1. Login to the admin.
  2. Create a static block.
  3. Navigate to: 'Products' > 'Categories'.
  4. Expand 'Display Settings'.
  5. Select 'Static block only'.
  6. Select your new static block in 'Add CMS Block'.
  7. Save

Expected result
You see your static block on the frontend

Actual result
No static block is shown

The reason why
As you can see the code does not yet include a needed else block, which I have added.

https://github.com/magento/magento2/blob/develop/app/code/Magento/Catalog/view/frontend/templates/category/products.phtml

I hope this is enough, I really can't explain this any further. As I said the issue is really small but I thought it is still needed.

@korostii
Copy link
Contributor

Hi @nathanchick,
There seems to be a separate cms.phtml block included nearby which is supposed to do render that part. Are you sure you haven't removed any of its ancestors in your theme or something like that?

@ishakhsuvarov
Copy link
Contributor

@nathanchick We still can not reproduce this problem with the develop branch. All of the possible Display Settings work as expected. Could you please provide more details and check the comment above?

@okorshenko okorshenko modified the milestones: June 2017, July 2017 Jul 2, 2017
@nathanchick nathanchick closed this Jul 3, 2017
magento-devops-reposync-svc pushed a commit that referenced this pull request Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants