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

EDU-13251 - Configuring templates #1609

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

barbara-celi
Copy link
Contributor

@barbara-celi barbara-celi commented Nov 27, 2024

Types of changes

  • New content (guides, endpoints, app documentation)
  • Improvement (make a documentation even better)
  • Fix (fix a documentation error)
  • Spelling and grammar accuracy (self-explanatory)

EDU-13251

Copy link
Contributor

Preview Links

Open this URL to set up the portal with this branch changes.

You can now access the edited pages with the following URLs:

Copy link
Contributor

Navigation Preview Link

No changes detected in the navigation.json file

---

We call a template your website's page structure.
In this guide, you will learn how to customize your store theme by managing templates, which are the websites page structure. Templates are responsible for declaring `JSON` blocks that, once rendered, define the set of components for your website's pages, such as the home page, product page, search results page, etc.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[style-check] reported by reviewdog 🐶
Found "home page"

Use Style Guide.
💡 Suggestion - Replace with "homepage".

✍ Check the Education Styleguide for more information.


In practice, managing templates is what allows you to build the desired theme for your website by adding or removing blocks according to your store's needs.
<Steps>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
MD033/no-inline-html Inline HTML [Element: Steps]


>⚠ More than simply declare a block in the block list template, notice that you will also need to declare the block in order to set its behavior when rendered as a component. For this purpose, you will need to use the block's props (as shown in the next section) and other child blocks as well to define its configuration (as shown in the Block composition section).
>⚠ More than simply declaring a block in the block list template, you also need to define its behavior when rendered as a component. To do this, use the block's props, as shown in the [Clarifying block naming and properties](#clarifying-block-naming-and-properties) section, and include other child blocks to define its configuration, as detailed in the [Defining the blocks composition](#defining-the-blocks-composition).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
MD051/link-fragments Link fragments should be valid [Context: "Defining the blocks composition"]

## Step 5 - Understanding blocks composition

Now, let's take a look at the `shelf#home` block in the same file (`home.jsonc`):
Still in the `home.jsonc, search for the `shelf#home` block.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
MD038/no-space-in-code Spaces inside code span elements [Context: "home.jsonc, search for the "]


> ℹ️ You can find out which composition a block has by looking at its code in the exporting app's `interfaces.json` file.
As explained in the [Understand block composition](#understand-block-composition) topic, the choice between blocks using a `blocks` or `children` list depends on the *composition* of the blocks being declared.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint] reported by reviewdog 🐶
MD051/link-fragments Link fragments should be valid [Context: "Understand block composition"]

## Step 5 - Understanding blocks composition

Now, let's take a look at the `shelf#home` block in the same file (`home.jsonc`):
Still in the `home.jsonc, search for the `shelf#home` block.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[markdownlint-fix] reported by reviewdog 🐶

Suggested change
Still in the `home.jsonc, search for the `shelf#home` block.
Still in the `home.jsonc, search for the`shelf#home` block.


As previously mentioned, blocks are pieces of code exported by VTEX Store Framework apps. This means that whenever a block is used in your theme, the app behind it must be declared in your Store Theme [dependencies](https://developers.vtex.com/docs/guides/vtex-io-documentation-dependencies/) list.
> ℹ Learn more about these and other relevant concepts in [Essential concepts](LINK).
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pensei em pegar as docs que ainda existem na categoria Concepts e criar um único guia, visto que os conceitos ali dialogam bastante. Coloquei o nome de Essential concepts, mas é provisório. Posso ver depois um título melhor.

As docs que ainda estão lá são: Composition, Interfaces, Properties e Slots.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant