Skip to content
This repository has been archived by the owner on Dec 19, 2019. It is now read-only.

Render category description directives #148

Merged
merged 7 commits into from
Oct 3, 2018

Conversation

rogyar
Copy link
Contributor

@rogyar rogyar commented Aug 5, 2018

Description

This PR improves output for description of a category. Previously we just had a raw output. Now, if you use some directive (upon uploading an image), its contents are rendered

Fixed Issues (if relevant)

  1. GraphQL API returns rendered content for category #135: GraphQL API returns rendered content for category

Manual testing scenarios

  1. Magento installation from 2.3-develop branch (optionally: with sample data installed)
  2. Open a category and upload some image in the category description
  3. Make a GraphQL request with category description included:
{
  category(id: 15) {
    name
    description
  }
}
  1. In the description, you should see full image URL instead of {media url=...}

Please note, not all directives are supported in the category description on the core level. For example, you cannot insert a block like in #140 . It's not the current implementation limitation but core behavior. If you try to insert a block and check the storefront, it's not rendered there as well. All directives that are supported by default template filter (used on storefront) are also supported in the GraphQL response.

@paliarush
Copy link
Contributor

@rogyar Thanks for contribution, changes look good!

@melnikovi
Copy link
Member

@rogyar I can not reproduce issue with not all directives being rendered on 2.3-develop, could you please provide steps you use to reproduce it? Thank you.

@rogyar
Copy link
Contributor Author

rogyar commented Aug 8, 2018

Hi @melnikovi, sure. Within a scope of a product description or short_description we can use different directives including inserting blocks/widgets etc. We cannot do the same with category description due to the core template renderer limitations. For example, if you insert in the product's description the following directive:

{{block id="sale-block"}}

it's rendered on the storefront (also, in the GraphQL response).
At the same time, if you try to insert the same directive into the category's description, it's not rendered on the storefront and the GraphQL response. So, I just put a note that we have some limitations from the template renderer side, which is not a sort of bug but the standard system behavior.

@magento-engcom-team magento-engcom-team added this to the Release: 2.3.1 milestone Oct 1, 2018
@magento-engcom-team magento-engcom-team merged commit cb7a755 into 2.3-develop Oct 3, 2018
magento-engcom-team added a commit that referenced this pull request Nov 22, 2018
…ry/Download #148

 - Merge Pull Request magento-engcom/import-export-improvements#148 from denispapec/import-export-improvements:phpstan-historydownload
 - Merged commits:
   1. b0240f1
   2. 518b4d4
@naydav naydav removed this from the Release: 2.3.1 milestone Dec 7, 2018
@naydav naydav deleted the rendered-html-category branch April 12, 2019 19:36
magento-engcom-team pushed a commit that referenced this pull request Jun 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants