diff --git a/docs/guides/configuration.md b/docs/guides/configuration.md index fc17a37..d434d99 100644 --- a/docs/guides/configuration.md +++ b/docs/guides/configuration.md @@ -6,32 +6,34 @@ description: You can learn about the configuration in the documentation of the D # Configuration -## Loading data for cards +## Load data for cards -To load data, add data to the [`data`](/api/config/booking-data) array. See all instructions here: [`Loading data`](/guides/loading-data). +Add data to the [`data`](/api/config/booking-data) array. For full instructions, see [`Loading data`](/guides/loading-data). -## Defining the structure of cards +## Define card structure -You can configure what information all cards will display on their left side using the [`cardShape`](/api/config/booking-cardshape) property or the [`cardTemplate`](/api/config/booking-cardtemplate) property, which also allows customizing the appearance of each card's block. +Use the [`cardShape`](/api/config/booking-cardshape) or [`cardTemplate`](/api/config/booking-cardtemplate) property to configure what information appears on the left side of each card. :::info -`cardTemplate` helps completely customize the appearance of a card by providing your own custom HTML. It gives full control over the card's layout, design and content. -`cardShape` allows you only to modify the default template by hiding/showing fields. -If both are applied, `cardTemplate` will override the `cardShape` settings. +`cardTemplate` fully customizes the appearance of a card with custom HTML. It gives full control over the card's layout, design, and content. +`cardShape` only modifies the default template by hiding or showing fields. +If both are applied, `cardTemplate` overrides `cardShape`. ::: -On the left side of each card the following data fields are displayed by default: -- preview: card image -- review: rating information with the number of rating stars (out of five) and the number of reviews -- category: the subtitle of a card -- title: the title of a card which is a specialist's name -- subtitle: the subtitle of a card, for example, experience details -- price: the price of the service -- details: other details of a card +### Hide or show card fields -To hide any information block from cards' display, set the appropriate parameter value of the [`cardShape`](/api/config/booking-cardshape) property to **false**. +Use [`cardShape`](/api/config/booking-cardshape) to control which fields appear on the left side of each card without changing the default layout. -Example: +The following fields appear on the left side of each card by default: +- `preview` — card image +- `review` — rating information including the number of stars (out of five) and the number of reviews +- `category` — category name (e.g., a specialist's job) +- `title` — card title (e.g., a specialist's name) +- `subtitle` — card subtitle (e.g., experience details); hidden by default +- `price` — service price +- `details` — additional card details + +To hide a field, set the corresponding `cardShape` parameter to `false`. The following code snippet hides the `details` field from all cards: ~~~jsx {24} const data = [ @@ -71,9 +73,11 @@ new booking.Booking("#root", { Please, see an example in the [snippet tool](https://snippet.dhtmlx.com/6mxd7918) ::: -To apply a template to each card (the left-hand block), use the [`cardTemplate`](/api/config/booking-cardtemplate) property. +### Apply a custom card template + +Use [`cardTemplate`](/api/config/booking-cardtemplate) to apply a custom HTML template to the left side of each card. -First, create a function that takes a card object and returns a string of HTML. To define a template, arrange card item properties into any HTML blocks with custom styles. In the example, `cardPreviewTemplate` returns HTML for a card that includes a preview image (card.preview), category (card.category), title (card.title), and price (card.price). +Create a function that takes a card object and returns HTML. Arrange card item properties into HTML blocks with custom styles. The example below defines `cardPreviewTemplate`, which renders a preview image, category, title, and price: ~~~html {} ~~~ -The next example shows how to change the background color for cards: +The following code snippet changes the background color for cards and selected date items: ~~~html