Skip to content

Commit

Permalink
update Fields binding description
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuliya Pazniak committed Jan 11, 2025
1 parent 5636436 commit 9638e57
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions datapress/binding/fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,28 @@ Premium feature! This feature is available in the addon to the premium extension

:::

With the Dataverse Integration Fields Binding plugin available in the Addons, you can work with custom fields, allowing you to display any text before displaying the field value and formatting the field value.
With the Dataverse Integration Fields Binding plugin available in the Addons, you can work with custom fields, allowing you to display any text before displaying the field value and format the field value.

To use this plugin, follow the steps below:
1. Create a page, click `Preferences`, and open the `Panel` settings.
2. Add extra areas to the editor by choosing `Custom fields` option. Click `Enable & Reload` to see the Custom fields section.
3. At the bottom of the page, create a name for custom field(s). Save and publish the page.
4. Go to the pages list, find the page you created and click `Configure Binding` to choose the table to bind.
5. In the Dataverse Admin Area, go to `Bindings` -> `Fields Binding`. Here, you can set pre-rendering Twig code that will execute before rendering Twig expression substitution. You can use it to retrieve data, define variables, etc.
6. Click `Create Binding`, and choose the page that was created earlier. Then select `Add Field` and choose the custom field created for the page.

Additionally, the following options will replace a field:
1. In the Dataverse Admin Area, navigate to Bindings -> Fields Binding. Here, you can set pre-rendering Twig code that will execute before rendering Twig expression substitution. Use this to retrieve data, define variables, and more.
2. Select `Add field` to choose the custom field to display or click `Create field` to create a new custom field.
3. Add a table from which to retrieve data.
4. Click Save.
5. Return to the WordPress Admin Area and create a page. Click `Preferences`, then open the `Panel` settings.
6. Add extra areas to the editor by choosing `Custom fields` option. Click `Enable & Reload` to see the Custom fields section.
7. At the bottom of the page, create a name for custom field(s). Save and publish the page.
8. Go to the pages list, find the page you created and click `Configure Binding` to choose the table to bind and how to bind the post.

- Twig Expression (type Twig expression to display it as the field value)
- Column (choose the column logical name from the drop-down)
- Twig Template (choose the Twig template, which is in Templates -> Twig templates)
- Formatted Column (choose the column logical name from the drop-down).
Additionally, the following options can replace a field:

Add the output of the meta field to your template:
- **Twig Expression:** Type a Twig expression to display it as the field value.
- **Column:** Choose the column logical name from the drop-down.
- **Twig Template:** Choose the Twig template, which can be found under `Templates` -> `Twig Templates`.
- **Formatted Column:** Choose the column logical name from the drop-down.

```php
<?= get_post_meta( get_the_ID(), '{fieldName}', true ); ?>
```
:::note

The selected table in the Configure Binding item must match the table for this custom field in the Dataverse Admin Area.

:::

0 comments on commit 9638e57

Please sign in to comment.