diff --git a/datapress/Forms/custom-forms/_category_.json b/datapress/Forms/custom-forms/_category_.json new file mode 100644 index 0000000..f63d2a1 --- /dev/null +++ b/datapress/Forms/custom-forms/_category_.json @@ -0,0 +1,7 @@ +{ + "label": "Custom Forms", + "position": 1, + "link": { + "type": "generated-index" + } +} diff --git a/datapress/Forms/custom-forms/custom-forms-example.md b/datapress/Forms/custom-forms/custom-forms-example.md new file mode 100644 index 0000000..21a087b --- /dev/null +++ b/datapress/Forms/custom-forms/custom-forms-example.md @@ -0,0 +1,137 @@ +--- +title: Custom Forms examples +sidebar_position: 9 +slug: /forms/custom-forms-example +tags: + - Form + - DataPress +keywords: [DataPress custom form] +--- + +:::note +The plugin previously known as **Dataverse Integration** has been renamed to **DataPress**. All references in documentation and UI are being updated accordingly. [1](https://docs.alexacrm.com/forms/custom-forms/) +::: + +## Custom form examples + +### 1. Update a Contact + +``` +{% form entity="contact" mode="update" record=record|to_entity_reference %} +
+
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ + +
+{% endform %} +``` + +### 2. Contact Us Form (Create) + reCAPTCHA + +``` +{% form entity="lead" mode="create" recaptcha=true %} +
+
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ + +
+{% endform %} +``` + +### 3. Date Only & Date Time fields + +``` +{% form entity="contact" mode="create" %} +
+
+ +
+ +
+ +
+ +
+ +
+ + +
+{% endform %} +``` + +### 4. Display extracted date/time values + +``` +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+``` \ No newline at end of file diff --git a/datapress/Forms/custom-forms/custom-forms-overview.md b/datapress/Forms/custom-forms/custom-forms-overview.md new file mode 100644 index 0000000..3329c85 --- /dev/null +++ b/datapress/Forms/custom-forms/custom-forms-overview.md @@ -0,0 +1,64 @@ +--- +title: Custom Forms - Overview +sidebar_position: 7 +slug: /forms/custom-forms-overview +tags: + - Form + - DataPress +keywords: [DataPress custom form] +--- + +:::note +The plugin previously known as **Dataverse Integration** has been renamed to **DataPress**. All references in documentation and UI are being updated accordingly. [1](https://docs.alexacrm.com/forms/custom-forms/) +::: + +

Use Twig + HTML to build custom forms and send submissions directly into Dataverse.

+ +# Overview + +Custom Forms let you capture data from your WordPress site **without** using Power Apps or Dynamics 365 forms. +Instead, you build the layout yourself using regular HTML form markup and wrap it inside Twig tags. + +Key capabilities: +- Build any HTML layout using your own design. +- Map form fields to Dataverse table columns via input `name` attributes. +- Submit data directly into Dataverse (create or update records). +- Optionally add reCAPTCHA protection. + +Custom Forms are included in the **free** DataPress plugin on WordPress.org. + +--- + +# Configuration + +## 1. Wrap your HTML form with `{% form %} ... {% endform %}` + +A custom form begins with a pair of Twig tags: +`{% form ... %}` → configuration +`{% endform %}` → closing tag + +Inside them, you **must** place a standard HTML `
...
` element. +The submit event is handled automatically when the user submits the form. + +## 2. Connect form inputs to Dataverse columns + +Use the Dataverse column logical name for each ``: + +```html + + +``` + +The plugin uses these names to map the values to Dataverse. + +## 3. Enable reCAPTCHA (optional) + +To protect from spam: + +- Add recaptcha=true to `{% form %}`. +- Add the placeholder `` inside your `
`. +- Configure reCAPTCHA keys in plugin settings — otherwise the form may not load or submit. + +## 4. Place the form on a WordPress page + +Use the Gutenberg block **Dataverse Plain**, which accepts Twig and renders it as HTML on the frontend. diff --git a/datapress/Forms/custom-forms/custom-forms-reference.md b/datapress/Forms/custom-forms/custom-forms-reference.md new file mode 100644 index 0000000..0d9af78 --- /dev/null +++ b/datapress/Forms/custom-forms/custom-forms-reference.md @@ -0,0 +1,96 @@ +--- +title: Custom Forms - Reference +sidebar_position: 8 +slug: /forms/custom-forms-reference +tags: + - Form + - DataPress +keywords: [DataPress custom form] +--- + +# Reference (Capabilities & Limitations) + +## What Custom Forms can do + +- **Create** new Dataverse records (rows) from a WordPress page. +- **Update** existing Dataverse records when `mode="update"` and `record` is provided. +- Map HTML inputs to Dataverse columns using the input `name` attribute (Dataverse logical column name). +- Optionally enable **reCAPTCHA** [protection for custom forms](https://docs.alexacrm.com/forms/recaptcha/) + +## How submission works (important note) + +DataPress processes submissions using the HTML form **submit** event (standard browser behavior). [1](https://docs.alexacrm.com/forms/custom-forms/)[3](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit_event) + +Make sure your markup contains a real `...
` element, because [submission is tied to the form itself](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit_event) + +--- + +## `{% form %}` parameters + +Use these parameters in the opening Twig tag: + + +| Parameter | Type | Description | +|-------------|---------------------|-------------| +| **entity** | string (required) | Logical name of the target Dataverse table. | +| **mode** | string (required) | Form mode: `create` to create a new record, `update` to update an existing one. | +| **record** | EntityReference | Record GUID, EntityReference, or Table object used in `update` mode.| +| **recaptcha** | boolean | Enables reCAPTCHA validation. Requires `` placeholder inside the form. See *Protect form submissions with reCAPTCHA*. | +| **redirect** | string | URL to redirect the user to after a successful submission. Supports `%s` for record GUID. | +| **message** | string | Custom success message displayed after form submission. | +| **messages** | object | Custom messages object (e.g., success / failure messages). Example: `{ "success": "Thanks!", "failure": "Please try again later." }` | +| **keep** | boolean | Keeps the form visible after a successful submission (`false` by default; form collapses). | +| **keep_data** | boolean | Keeps form field values after a successful submission (`false` by default; values are cleared). | + +[Examples](/forms/custom-forms-example) + +--- + +## Premium behavior (Power Apps forms) + +If the premium add‑on is installed and an `id` parameter is used, the `{% form %}` tag behaves like a Power Apps form [tag](/forms/forms-configuration/) + +--- + +## reCAPTCHA requirements (Custom Forms) + +If you enable reCAPTCHA with `recaptcha=true`, you must do **both**: + +1. Configure [reCAPTCHA keys in DataPress settings](/forms/recaptcha/) +2. Add the `` placeholder **inside** your `
` markup. + DataPress replaces it with the actual reCAPTCHA widget at runtime. + +If reCAPTCHA is enabled but not configured, the form may fail to render or submit. + +Read more: [reCAPTCHA support](/forms/recaptcha/) + +--- + +## Date/Time fields in Custom Forms + +### Expected input formats + +When you fill date fields manually in a custom form, use these formats: + +- **Date Only**: `yyyy-mm-dd` or `yyyy/mm/dd` + Example: `2023-01-20` or `2023/01/20` [1](https://docs.alexacrm.com/forms/custom-forms/) +- **Date Time**: `yyyy-mm-ddThh:mm` + Example: `2023-01-20T12:30` [1](https://docs.alexacrm.com/forms/custom-forms/) + +### Time zone behavior + +How date/time values are displayed can depend on Dataverse behavior (User Local / Time Zone Independent / Date Only) and DataPress settings such as [`ICDS_DATETIME_VALUE`](/date-and-time/) +[1](https://learn.microsoft.com/en-us/power-apps/maker/data-platform/behavior-format-date-time-field) + +Read more: [Date and Time columns](https://docs.alexacrm.com/date-and-time/) + +--- + +## Getting the created record GUID via redirect + +After a record is created successfully, you can capture its GUID using `redirect` with a `%s` placeholder. + +Example: + +- `redirect="/?id=%s"` becomes: + `/?id=00000000-0000-0000-0000-000000000000` diff --git a/datapress/Forms/custom-forms.md b/datapress/Forms/custom-forms/custom-forms.md similarity index 99% rename from datapress/Forms/custom-forms.md rename to datapress/Forms/custom-forms/custom-forms.md index 76aeb5a..fac3887 100644 --- a/datapress/Forms/custom-forms.md +++ b/datapress/Forms/custom-forms/custom-forms.md @@ -1,6 +1,6 @@ --- -title: Custom Forms -sidebar_position: 2 +title: Custom Forms - old +sidebar_position: 6 slug: /forms/custom-forms tags: - Form diff --git a/datapress/Forms/elementor.md b/datapress/Forms/elementor.md new file mode 100644 index 0000000..3658d70 --- /dev/null +++ b/datapress/Forms/elementor.md @@ -0,0 +1,17 @@ +--- +title: Elementor +sidebar_label: Elementor +slug: /forms/elementor +sidebar_position: 5 +--- + +import React from 'react'; +import {useHistory} from '@docusaurus/router'; + +export default function Redirect() { + const history = useHistory(); + React.useEffect(() => { + history.replace('/addons/elementor/'); + }, []); + return null; +} \ No newline at end of file diff --git a/datapress/Forms/forms.md b/datapress/Forms/forms.md deleted file mode 100644 index b48060e..0000000 --- a/datapress/Forms/forms.md +++ /dev/null @@ -1,251 +0,0 @@ ---- -title: Power Apps Forms -sidebar_position: 1 -premium: true -slug: /forms/forms -tags: - - Form - - DataPress -keywords: [DataPress forms] ---- -:::note -The plugin previously known as Dataverse Integration has been renamed to DataPress. This change reflects our commitment to enhancing user experience and aligning with our evolving product vision. -All references to Dataverse Integration in the documentation, user interface will be updated to DataPress. -::: - -

Capture leads, feedback and other information from your website using forms designed in Power Apps and Dynamics 365.

- -## Introduction - -:::info - -This feature is exclusive to the premium extension. - -Licensing Requirement - -If the premium plugin is not properly licensed, syntax errors may occur. Ensure the plugin is correctly licensed to maintain Power Apps Forms functionality. - -::: - -Forms are an essential component of Power Apps and Dynamics 365 which enables interaction with your data. DataPress (Dataverse Integration) brings the comparable experience to your WordPress website. It makes writing data back to Dataverse / Dynamics 365 a priority, and to achieve the goal it provides support for rendering Dataverse / Dynamics 365 forms and processing the input by converting it into new Dataverse rows (records) or updates to the existing rows. - -The plugin introduces a concept of *"form registrations"*, a proxy layer between WordPress and a Dataverse form. It specifies among other things which Dataverse form to show, how to handle submissions, which fields to make required or optional. - -Forms are fully integrated into the Twig templating engine, and Twig templates are the way to place forms on your website pages. - -## Features and limitations - -DataPress (Dataverse Integration) renders forms close to what they are defined in Dataverse, layout-wise. Most control types are supported too, including lookups, radio buttons and checkboxes, date & time pickers, as well as simple text (e.g. single-line and multi-line text, email) and number (e.g. integers, money) inputs. - -DataPress (Dataverse Integration) provides a lookup dialog very similar to one included in Power Apps and Dynamics 365. It allows picking rows as values for lookup and customer columns. The lookup dialog included in the plugin does not support selecting multiple rows for one column. Multi-select picklists are not supported yet. - -Several composite controls are not supported yet. Those include subgrids, maps, nested forms (quick forms), notes (Posts, Assistant, Activities, Notes). - -There are no plans for support of web resources, such as custom JavaScript libraries embedded into forms. You can still use CSS and JavaScript to change how your forms appear and behave using standard WordPress means. - -### Composite columns - -Default Dataverse tables, such as Contact and Lead, include several composite read-only columns. - -`fullname` is a calculated column which by default represents First Name and Last Name. DataPress (Dataverse Integration) and Dynamics 365 provide several options to generate the Full Name, [see the article](https://www.magnetismsolutions.com/blog/colinmaitland/2014/02/03/how-to-change-the-full-name-format-for-contacts-in-microsoft-dynamics-crm-2013). The plugin does not show a pop-up to specify each name component separately. It instead decomposes the `fullname` column, if one is present on the form, into separate controls on the form as if the form contained `firstname` and `lastname` instead. - -`addressN_composite` columns are likewise calculated based on other `addressN_*` columns. In terms of rendering composite address columns are treated the same as Full Name columns. - -DataPress (Dataverse Integration) allows customizing the list of underlying attributes for Full Name and Address columns. - -### reCAPTCHA support - -Dataverse forms are fully integrated with reCAPTCHA. -[Read more](/forms/recaptcha/#recaptcha-support-for-power-apps-forms) - -### Front-end dependencies - -Dataverse forms require [Bootstrap 4](https://getbootstrap.com/) and [Font Awesome 5](https://fontawesome.com/) to work properly. We provide custom builds of these libraries that do not interfere with the existing layout of pages. You can opt out of including these libraries onto your website if your WordPress theme provides these dependencies. - -## Create a form registration - -To insert a form onto your webpage and start collecting data, you need to create a "form registration", which defines how to treat the incoming data. - -In the plugin dashboard, go to the *Forms* tab and click **Create new** to start creating a new form registration. - -Enter the *Form Name*, select the *CRM Form* and choose the mode of operation. Three modes are available: - -- Create a new record -- submissions always create a new record (row). -- Update or create a record -- form uses [table binding](/datapress/binding/table-binding.md) to acquire a record and put its values into form, and submission updates the row with changed values. If table binding hasn't yielded an existing record, a new record will be created instead. -- Read-only -- table binding is used to acquire a record, its values are displayed, but nothing can be changed on the form. - -Finally, click **Create** to save the new form registration. - -### Allow deleting records - -When you choose the *update* or *read-only* mode, you can enable record deletion by checking *Allow deleting the record.* - -You are advised to implement the `integration-cds/forms/authorize-delete` filter hook to guard against unauthorized use. When deletion request is submitted, three parameters are passed into the hook: - -- `$isAuthorized` -- *(boolean)* whether to authorize deletion of the record. -- `$reg` -- *(FormRegistration)* form registration which initiated deletion. Contains form ID, target entity and other form registration settings. -- `$target` -- *([EntityReference](https://github.com/AlexaCRM/dynamics-webapi-toolkit/blob/master/src/Xrm/EntityReference.php)|null)* record that is being deleted. The hook should return `false` if `NULL` has been passed. - -### Required and optional columns - -Dataverse forms can require some columns (fields) to be filled before a form can be submitted. Sometimes you want to make more columns required, or, instead, make some columns optional, without actually customizing the Dataverse form. - -To do that, select the columns from the Attributes column and move them to the Required or Optional column by clicking **Required →** or **Optional →** respectively. Select columns and click **Remove selected**, or double-click the fields (columns), to remove them from the list. - -### Global settings overrides - -Form registration provides several options to override global form settings, such as inclusion of reCAPTCHA and front-end dependencies, form behavior, messages and Full Name / Address decomposition columns. - -## Add the form to a page - -DataPress (Dataverse Integration) provides a custom Twig tag, `{% form %}`, to add Dataverse forms to WordPress pages. When you add a Dataverse form to a page, you need to know its form registration ID -- it is specified in the list of form registrations. - -```twig -{% form id=42 %} -``` - -This code is sufficient to display a Dataverse form on a WordPress page and start accepting submissions. - -### Default values - -You can set default values for different fields in two ways: - -- In the DataPress Admin Area -- In the WordPress Admin Area - -1. **Setting default values in the DataPress Admin Area** - -- Go to **Forms → Forms Editor** and open the required form. -- Find the **Fields Customization** section. -- Under **Default Field Values**, select the column display name and set the default value. - -For a choice field, you can set the default value as 0 (choices value). - -
-Choice value -
- -2. **Setting default values in the WordPress Admin Area** - -You can provide default values to pre-populate specific form columns by using the ‘defaults’ attribute in the `{% form %}` tag. - -```twig -{% form id=42 defaults={ "leadsourcecode": 8, "donotfax": true, "address1_country": "United States" } %} -``` - -If you create a page using the Dataverse Form block, you can set values in the `defaults` field. - -```twig -{ "leadsourcecode": 8, "donotfax": true, "address1_country": "United States" } -``` - -To set a default value for a choice field, you need to analyze the possible values. For example, you can find the label and value mapping in the table settings. To set the ‘Male’ label for the gender column, you need to choose the value of 1. - -```twig -{% form id=4 defaults={"gendercode": 1} %} -``` - -Similar way to set default value for multiple choice field. - -```twig -{% form id=2 defaults={"multipleChoiceColumnName": '3,4'} %} -``` - -Additionally, you can provide default values in the Dataverse Admin Area. Choose the form, go to Fields Customization, and find the Default Field Values section. Here, you just need to choose the field name and set the default value for it. You can set default values even for lookup and choice fields. - -### Getting record GUID - -After the record has been successfully created, you can get the guid using the redirect setting with the %s parameter. - -For example, `/?id=%s` will be replaced by `/?id=00000000-0000-0000-0000-000000000000` - -## Date Time and Date Only fields in forms - -When working with date and time values in forms, you can customize how they are displayed to users and how they are adjusted for different time zones. Here are the behavior options available in Dataverse and model-driven apps: - -- **User Local**: Adjusts values based on the user’s time zone. -- **Time Zone Independent**: No time zone conversion is applied. -- **Date Only**: Displays only the date portion without time zone conversion. - -[Read more](https://learn.microsoft.com/en-us/power-apps/maker/data-platform/behavior-format-date-time-field) - -[Usage Scenarios](/date-and-time/#usage-scenarios) - -When using the User Local behavior, all columns will display date or date-time fields converted to the specified time zone in case of the **Legacy** or **Local** option in `ICDS_DATETIME_VALUE`. [More details](/datapress/administration/troubleshooting.md) - -For instance: - -If you have a value like **5/15/2028 03:00:00 AM** in a column with User Local behavior and set the time zone to **UTC + 2h**, the form will show **5/15/2028 05:00:00 AM**. -If you set the time zone to **UTC - 4h**, the form will display **5/14/2028 11:00:00 PM**. - -| | Legacy | UTC | Local | -|-----------------|--------------|----------------|-----------| -|premium forms | convert the date and time to the user's timezone | UTC | convert the date and time to the user's timezone | - -You can set time zones for **individual WordPress users**: - -1. Find the user and click **Edit**. -2. Go to the **Dataverse Extra Fields** section. -3. Choose a value from the **Timezone** dropdown. - -For example, if a user has the same **5/15/2028 03:00:00 AM** column value with User Local behavior: - -- Setting their time zone to **UTC + 2h** will display **5/15/2028 05:00:00 AM**. -- Setting their time zone to **UTC - 4h** will show **5/14/2028 11:00:00 PM**. - -Anonymous visitors will see the values in the timezone of the website. To set the time zone for the website, follow these steps: - -1. Sign in into WordPress administrative interface. -2. Click **Settings**. -3. Go to **General**. -4. Select the required time zone. - -## Lookup fields in forms - -In Power Apps Forms for Dataverse, lookups are crucial for creating relationships between tables and enhancing data entry. Here’s a detailed look at how lookups function in different contexts: - -1. **Dialog** - -Search dialog boxes provide an interactive way to search and select records. Key features include: - -**Advanced Search**: Users can view all records or get results as they type, making it easier to find the right record. -**Filters**: Filters set with the view help narrow down search results. You can set values to sort while searching in any view. - -2. **Dropdown** - -Dropdown controls are used to display records with selections, allowing users to choose from a predefined list of options. They can be customized as follows: - -**Filter Choices**: Use the view to filter the available choices based on the records available in it. The name of the view must be pre-defined by the administrator in the form settings. -**Search Options**: When there are a large number of records, it is convenient to use the search option to find the desired value. - -3. Select - -This is basically a standard dropdown list where users can select an entry from a dropdown list. By default, about 50 values are displayed. - -### Lookup security - -Lookups utilize a custom REST API that could potentially execute outside of the form context, thereby unintentionally exposing data. To mitigate the risk of accidental exposure, we have implemented additional security measures: - -1. We fully support Wordpress nonces for lookup queries, i.e. queries performed outside of the form context will fail. Learn more at [Nonces – Common APIs Handbook](https://developer.wordpress.org/apis/security/nonces/). - -2. We support custom filter restricting access to the lookups. For example, to restrict lookups to the signed-in users only, add the following code to the `functions.php` file of the current theme. - -```php -add_filter( 'integration-cds/lookup/authorize-access', function( $isAllowed, $entityName, $view ){ - if ( !is_user_logged_in() ) { - return false; - } - - return $isAllowed; -}, 10, 3 ); -``` - -3. Data returned by a lookup can be filtered using fetchXML templates, refer to the `FetchXML queries` page for sample templates. To add a template to a form in the Dataverse Admin Area, navigate to the Forms settings and scroll down to the `Conditional access` section located at the bottom of the page and add your desired template for the form lookups. - -:::note -The following formats of the **Whole Number** data type are currently unsupported: **Language code**, **Duration**, **Time zone**. -::: - -## How to work with decimal and float fields - -Decimal and float fields depend on your Power Apps website settings. Here, you can set minimum and maximum values, decimal places, and other settings. [Read more](https://learn.microsoft.com/power-apps/maker/data-platform/formula-column-data-types) \ No newline at end of file diff --git a/datapress/Forms/gravity-forms.md b/datapress/Forms/gravity-forms.md new file mode 100644 index 0000000..a217fb5 --- /dev/null +++ b/datapress/Forms/gravity-forms.md @@ -0,0 +1,324 @@ +--- +title: Gravity Forms +sidebar_position: 3 +premium: true +slug: /forms/gravity-forms +tags: + - Gravity Forms + - DataPress +keywords: [DataPress Gravity Forms addon, create DataPress form with Gravity Forms] +--- + +

Use gravity forms to manage your organization data

+ +## Introduction + +Our plugin supports Gravity Forms. So you can use it instead of our Custom or Power Apps forms + +:::info +Premium feature! This feature is available in the premium extension. +::: + +## Form configuration + +1. **Create a Gravity Form** + +- To begin, navigate to **Forms** → **Add New** in Gravity Forms. + +- Add the necessary fields to the form. + +- Assign titles to each field to ensure clarity. + +- Once all required fields are set up, click the **Save Form** button to finalize the form creation. + +2. **Configure DataPress Feed** + +- After saving the form, you must set up a **DataPress Feed** to integrate the form with Dataverse. + +- Without closing your Gravity Form, go to **Settings** → **DataPress**. + +- Follow the necessary configuration steps to map form fields to table columns. + +
+GF dataverse +
+ +Then click `Add New`, select the CRM table, choose the action type (create, update, or upsert - which performs create or update depending on the situation), and map the form columns to the CRM columns by setting a correspondence between the CRM column name (key) and the Gravity Form field name (value). + +
+GF fields mapping +
+ +### Access to a table + +Be attentive with the access to tables from Maker portal. Pages, based on Gravity forms do not show any error when you try to fill in and submit the form even if you don't have an access to this table. You click Submit and then you will see success message even when you don't have privilege to create a new record. In that case the administrator will get an email with the details. + +### Dynamic column population + +If you want to set default values for columns you can follow these instructions: + +1. To set default value for standard columns go to `Field settings` tab - `Advanced`. +2. To add lookup column you should go to `Add Fields` tab and choose `Dataverse Lookup` from `Advanced Fields` tab. Then you need to open the `Appearance` tab and set default value. + +If you want to set default values dynamically for columns using the form's field_values attribute (see [Dynamically Populating a Field](https://docs.gravityforms.com/using-dynamic-population/)), you can follow the following instructions. + +1. Add a new field, go to `Advanced Settings` and check the `Allow field to be populated dynamically` checkbox. +2. Specify a parameter name just below the `Allow field to be populated dynamically` checkbox and save the parameter name. +3. Map the field to one of the table columns in the `DataPress Feed` settings. +4. Remember your Gravity Form id. +5. Go to `Pages` -> `Add New` and choose `Custom HTML` block + +Example for setting dynamic value: + +```php +[gravityforms id="1" field_values="parameter_name=Dynamic Value"] +``` + +**Note:** The parameter name in the `field_values` attribute must be the same as specified in the `2nd` point. + +**Note:** When populate a lookup parameter, use the following syntax: parameter_name=`entity_name`:`record_id`. + +Example for `companyid` parameter name (actual column name is `parentcustomerid` in the `contact` Dataverse table): + +1. Fixed value: + + ``` + field_values="companyid=account:f5aaed4c-654c-4730-bd4f-38bc19a330bd" + ``` + +1. Using twig expressions to get dynamic value: + + ```php + field_values="companyid=account:{{account.accountid}}" + ``` + +### How to bind a record by its guid + +To bind a record on a page created with the help of Gravity Forms, follow these steps: + +1. Create a Gravity Form with an Update Action in DataPress Feed: +- First, create a Gravity Form that includes the necessary fields for your record. +- Configure the form to perform an update action in your DataPress feed. + +
+GF feed +
+ +- Remember the name of this Gravity Form. + +2. Create a Page based on the Gravity Form Block: +- Create a new page. Use the Gravity Form block to build your page. Save the page. + +
+GF +
+ +3. Configure Binding for the Page: +- Locate the page you just created in your list of pages. +- Click `Configure binding` -> `Setup binding`. +- Choose the appropriate table name and select the `Via GUID in query string` option + +
+GF configuration +
+ +4. Add the Record GUID to the Page URL: +- Now you can include the record GUID as part of the URL. +- For example, if your record GUID is 65ffaf9a-e8c5-432d-860b-32f841b00d87, your URL could look like + +```php +https://yourwebsite.com/your-page?id=65ffaf9a-e8c5-432d-860b-32f841b00d87 +``` + +Alternatively, you can use a shortcode to achieve the same result (use the `Custom HTML` block): + +```php +[gravityform id="1" action="icds" icds_record="account:2793c9dc-ff0d-ef11-9f89-0022489310b4"] +``` + +This shortcode will populate the form fields with values from the record with the GUID 2793c9dc-ff0d-ef11-9f89-0022489310b4 in the contact table. In this case you don't need to configure binding for the page, just to write the record guid in the `Custom HTML` block. + +:::note + +**Duplicating Gravity Forms with DataPress Feed** + +If you need to reuse an existing form setup, Gravity Forms makes duplication fast and efficient—especially when working with DataPress integration. + +When you duplicate a form through the Gravity Forms admin interface: +- The form structure and all fields are copied. +- The associated DataPress feed is duplicated automatically—retaining table mappings, action types (create or update), and field relationships. + +This eliminates the need to manually reconfigure DataPress integration for each new form. It’s particularly useful for scenarios like: +- Building multiple forms for similar entities (e.g. contacts, leads, events) +- Creating multilingual or region-specific versions of forms +- Iterating new versions for testing, staging, or conditional logic workflows. + +> After duplication, you can tweak individual mappings or feed settings in the new form without affecting the original. + +
+GF duplicate feed +
+::: + +## Handling Various Data Types + +### Lookup Columns + +Lookup column supports two views for displaying the column: dropdown and dialog. + +To select a view, you need to click the `Add Fields` tab and choose `Dataverse Lookup` from `Advanced Fields`. Then open the `Appearance` tab in the column settings. + +
+GF lookup +
+ +If you select the dropdown, you must also select the table and view to lookup. The dialog view does not require any additional settings. + +
+GF lookup 2 +
+ +To set a default value for a Dataverse Lookup field, use the following format: + +```php + table:98837486-742e-ed22-9db1-00224893bd2f +``` + +
+GF lookup default value +
+ +To filter the available options in a dropdown lookup, you can apply a FetchXML query: + +```twig + + + +``` + +
+ +
+ +For a **Dialog** Lookup, the format includes the entity name: + +```php +account:98837486-742e-ed22-9db1-00224893bd2f +``` + +Replace account or table with the appropriate entity logical name, and use the actual GUID of the record you want to preselect. + +To control conditional access to requested records in dropdown or dialog use fetchXML filter. + +### Choice + +Choice columns allow you to present dropdown lists with fixed values in your app, ensuring data consistency. [Read more](https://learn.microsoft.com/power-apps/maker/data-platform/custom-picklists). + +Choice columns can be configured as either **single selection (choice)** or **multi-selection (choices)**. + +**Single Selection (Choice) - Radio Buttons** + +When a user must select only one value from the list, use **Radio Buttons**: + +
+GF single choice +
+ +- Select the **table** and the **column** where the choice values are stored. + +Map the selected **Form Field** to the corresponding table column in DataPress Feed. + +**Multi-Selection (Choices) - Multi Select** + +For cases where multiple values can be selected, use **Multi Select**: + +
+GF multiple choice +
+ +- Select the **table** and the **column** where the multi-choice values are stored. + +- Map the selected **Form Field** to the corresponding table column in DataPress Feed. + +### Date and time columns + +To create a record with `date and time` data type columns you need to follow next steps: +1. Add a Date Field to Your Gravity Form: +- In your Gravity Form, create a field that captures the date. This field will store the date portion of your record. +- Configure the date field according to your requirements (e.g., date format, default value, etc.). + +
+GF date +
+ +2. Add a Time Field: +- Next, add a separate field to capture the time. This field will store the time portion of your record. +- Customize the time field settings as needed (e.g., 12-hour or 24-hour format, default time, etc.). + +
+GF time +
+ +3. Map the Fields and columns in DataPress Feed: +- When configuring your DataPress feed (integration with Dataverse), you’ll observe that instead of a single column from the Power App, you’ll encounter two separate columns: one for the date and another for the time. These columns are `pseudo-columns` because they do not exist in Dataverse as standalone entities. Instead, they are derived by splitting or combining data from the source column as needed. + +
+GF fields +
+ +- Map the date field from your Gravity Form to the corresponding date column in Dateverse. +- Similarly, map the time field from your Gravity Form to the corresponding time column in Dateverse. + +
+Mapping +
+ +Here are two options. We recommend using **Local Date** and **Local Time** for the **User Local** behavior option, and **Date Only**, **Time Only** (or **UTC Date** and **UTC Time**) for the **Time Zone Independent** and **Date Only** behavior options. +[Read more](https://learn.microsoft.com/en-us/power-apps/maker/data-platform/behavior-format-date-time-field) + +**DataPress Admin Area Settings:** + +Adjust the `ICDS_DATETIME_VALUE` setting with options like: + +- **Legacy** +- **UTC** +- **Local** + +The **Time Zone Independent** and **Date Only** behavior options works as UTC and don't depend on the user's timezone + +Examples for the **DateTimeUserLocal** column which has User Local behavior: + +| | Legacy | UTC | Local | +|----------------------|--------------|----------------|-----------| +|`DateTimeUserLocal (UTC DateTime) (Date Only)` | UTC | UTC | UTC | +|`DateTimeUserLocal (UTC DateTime) (Time Only)` | UTC | UTC | UTC | +|`DateTimeUserLocal (Local Date)` | convert the date to the user's timezone | convert the date to the user's timezone | convert the date to the user's timezone | +|`DateTimeUserLocal (Local Time)` | convert the time to the user's timezone | convert the time to the user's timezone | convert the time to the user's timezone | + +Examples for the **DateOnlyUserLocal** column which has User Local behavior: + +| | Legacy | UTC | Local | +|----------------------|--------------|----------------|-----------| +|`DateOnlyUserLocal (UTC Date) (Date Only)` | UTC | UTC | UTC | +|`DateOnlyUserLocal (Local Date)` | convert the date to the user's timezone | convert the date to the user's timezone | convert the date to the user's timezone | + +
+Gravity date +
+ +In case, when you set only time value, the date represents the date zero (January 1, 1900). + +### File upload columns + +You can set maximum attached file size for File upload column in Gravity Forms. But you should also remember about the file size limits which are set for such columns in crm. So that your maximum attached file should not be more than the size from the crm column settings. + +At current moment we don't support uploading multiple files. + +## Sending Error Messages to the Admin Email + +To configure error notifications: +1. Navigate to the Gravity Forms plugin settings. +2. Open the DataPress menu. +3. Specify one or more email addresses to receive error messages. + +You can enter any valid email address — not just admin accounts. This allows you to notify stakeholders whenever an error occurs during form submission or CRM integration. \ No newline at end of file diff --git a/datapress/Forms/power-apps-forms/_category_.json b/datapress/Forms/power-apps-forms/_category_.json new file mode 100644 index 0000000..1a009b2 --- /dev/null +++ b/datapress/Forms/power-apps-forms/_category_.json @@ -0,0 +1,7 @@ +{ + "label": "Power Apps Forms", + "position": 2, + "link": { + "type": "generated-index" + } +} diff --git a/datapress/Forms/power-apps-forms/forms-capabilities.md b/datapress/Forms/power-apps-forms/forms-capabilities.md new file mode 100644 index 0000000..df04f48 --- /dev/null +++ b/datapress/Forms/power-apps-forms/forms-capabilities.md @@ -0,0 +1,135 @@ +--- +title: Notes (capabilities & limitations) +sidebar_position: 3 +premium: true +slug: /forms/forms-reference +tags: + - Form + - DataPress +keywords: [DataPress forms configuration] +--- + +## Supported controls + +DataPress renders forms close to their Dataverse definitions. + +Supported control types include: + +- Single‑line and multi‑line text +- Email and numeric fields +- Money and integer fields +- Radio buttons and checkboxes +- Date and time pickers +- Lookup fields + +--- + +## Limitations + +### Lookup selection +- Lookup dialogs do **not** support selecting multiple records +- Multi‑select picklists are **not supported** + +### Unsupported composite controls +The following controls are not currently supported: + +- Subgrids +- Maps +- Quick (nested) forms +- Notes, activities, posts, assistant panels + +### Web resources +Custom JavaScript web resources embedded in Dataverse forms are not supported. + +You may still use WordPress‑level CSS and JavaScript to customize appearance and behavior. + +--- + +## Composite columns + +### Full Name (`fullname`) + +`fullname` is a calculated field composed of name attributes. + +If present on the form, DataPress automatically decomposes it into individual controls (such as `firstname` and `lastname`) instead of using a popup editor. + +Microsoft reference: +https://www.magnetismsolutions.com/blog/colinmaitland/2014/02/03/how-to-change-the-full-name-format-for-contacts-in-microsoft-dynamics-crm-2013 + +### Address (`addressN_composite`) + +Address composite columns are handled similarly and decomposed into their underlying attributes. + +The plugin allows configuring which attributes are used for Full Name and Address fields. + +--- + +## Date and time behavior + +Dataverse supports multiple date behaviors: + +- **User Local**: Adjusts values based on the user’s time zone. +- **Time Zone Independent**: No time zone conversion is applied. +- **Date Only**: Displays only the date portion without time zone conversion. + +Documentation: +https://learn.microsoft.com/en-us/power-apps/maker/data-platform/behavior-format-date-time-field + +### Time zone handling + +For **User Local** fields, displayed values depend on: + +- `ICDS_DATETIME_VALUE` setting (Legacy или Local) +- User time zone + +Example: + +| Stored Value | Timezone | Displayed Value | +|-------------|----------|----------------| +| 5/15/2028 03:00 AM | UTC+2 | 5/15/2028 05:00 AM | +| 5/15/2028 03:00 AM | UTC‑4 | 5/14/2028 11:00 PM | + +Anonymous visitors see values using the WordPress site time zone. + +--- + +## Lookup behavior and security + +### Display modes + +1. **Dialog** — searchable modal lookup +2. **Dropdown** — filtered list with optional search +3. **Select** — simple dropdown (≈ 50 options) + +--- + +### Security measures + +To prevent unauthorized data access: + +1. WordPress nonces are enforced + https://developer.wordpress.org/apis/security/nonces/ + +2. Access can be restricted using a filter hook: + +```php +add_filter( 'integration-cds/lookup/authorize-access', function( $isAllowed, $entityName, $view ){ + if ( !is_user_logged_in() ) { + return false; + } + return $isAllowed; +}, 10, 3 ); +``` + +3. FetchXML templates can filter lookup results. + +## Unsupported Whole Number Formats +These Dataverse formats are not supported: + +Language code +Duration +Time zone + +## Decimal & Float Fields +Handled according to Dataverse settings (min/max, decimals). +[Reference](https://learn.microsoft.com/power-apps/maker/data-platform/formula-column-data-types) \ No newline at end of file diff --git a/datapress/Forms/power-apps-forms/forms-configuration.md b/datapress/Forms/power-apps-forms/forms-configuration.md new file mode 100644 index 0000000..3fd32a8 --- /dev/null +++ b/datapress/Forms/power-apps-forms/forms-configuration.md @@ -0,0 +1,135 @@ +--- +title: Form Configuration +sidebar_position: 2 +premium: true +slug: /forms/forms-configuration +tags: + - Form + - DataPress +keywords: [DataPress forms configuration] +--- + +## Before you begin + +Make sure that: + +1. The premium extension is active and licensed +2. A Dataverse (model‑driven) form already exists +3. You know whether the form should create, update, or display records + +--- + +## Creating a form registration + +To start collecting data, you must create a form registration. + +1. Open the plugin dashboard +2. Go to **Forms** +3. Click **Create new** + +Fill in the following fields: + +- **Form Name** +- **CRM Form** — select a Dataverse form +- **Mode** — choose how data is processed + +Click **Create** to save the registration. + +--- + +## Form modes + +### Create a new record + +Each submission creates a **new Dataverse record**. + +### Update or create a record + +The form uses table binding to: + +- load an existing record into the form +- update it on submission + +If no record is found, a new one is created. + +### Read‑only + +Table binding is used to load a record, but the form cannot be edited or submitted. + +--- + +## Allow deleting records + +When using **Update** or **Read‑only** mode, you can enable record deletion: + +- Enable **Allow deleting the record** + +⚠️ To prevent unauthorized deletes, implement the filter: + +`integration-cds/forms/authorize-delete` + +Parameters passed to the filter: + +- `$isAuthorized` — whether deletion is allowed +- `$reg` — the active form registration +- `$target` — the record being deleted (or `NULL`) + +Return `false` if deletion should not be allowed. + +--- + +## Required and optional attributes + +Dataverse defines required fields at the form level. +DataPress allows additional customization **without modifying the Dataverse form**. + +To change requiredness: + +1. Select attributes in **Attributes** +2. Move them to: + - **Required →** + - **Optional →** +3. Remove items by double‑clicking or using **Remove selected** + +--- + +## Global settings overrides + +Each form registration can override global form behavior, including: + +- reCAPTCHA +- Front‑end dependencies +- Form messages and behavior +- Full Name / Address decomposition + +--- + +## Front‑end dependencies + +Power Apps forms require the following libraries: + +- **Bootstrap 4** — https://getbootstrap.com/ +- **Font Awesome 5** — https://fontawesome.com/ + +DataPress ships custom, isolated builds of these libraries. +You may disable them if your WordPress theme already includes compatible versions. + +--- + +## reCAPTCHA support + +Dataverse forms integrate with reCAPTCHA. + +[Read more](/forms/recaptcha/#recaptcha-support-for-power-apps-forms) + +--- + +## Adding the form to a page + +Use the Twig tag and the form registration ID: + +```twig +{% form id=42 %} +``` + +This renders the form and starts accepting submissions. \ No newline at end of file diff --git a/datapress/Forms/power-apps-forms/forms-examples.md b/datapress/Forms/power-apps-forms/forms-examples.md new file mode 100644 index 0000000..b85e62b --- /dev/null +++ b/datapress/Forms/power-apps-forms/forms-examples.md @@ -0,0 +1,165 @@ +--- +title: Forms Examples +sidebar_position: 4 +premium: true +slug: /forms/forms-examples +tags: + - Form + - DataPress + - Examples +keywords: [DataPress forms, Power Apps Forms examples, Dataverse forms examples] +--- +This page provides copy/paste examples for rendering **Power Apps / Dataverse forms** on WordPress using **DataPress** form registrations. + +> **Prerequisite:** You must create a **form registration** in the plugin admin area. +> You will need its registration ID (for example, `id=42`). + +--- + +## Render a basic form + +Render a form using its **form registration ID**: + +```twig +{% form id=42 %} +``` + +## Render a form with default field values +Use the defaults attribute to pre-populate fields: + +``` +{% form id=42 defaults={ + "leadsourcecode": 8, + "donotfax": true, + "address1_country": "United States" +} %} +``` + +**Notes:** + +- Defaults values must match Dataverse attribute logical names. +- Boolean fields accept true/false. +- For choice fields, pass the numeric option value (see next section). + +## Set a default value for a Choice (Option Set) field + +For choice fields, pass the integer value of the option. +**Example:** set gendercode to “Male” where “Male” has value 1: + +``` +{% form id=4 defaults={"gendercode": 1} %} +``` + +You can find label/value mapping in Dataverse column settings or metadata. + +## Set a default value for a Multi-Select Choice field + +Multi-select values are passed as a comma-separated string: + +``` + +{% form id=2 defaults={"multipleChoiceColumnName": "3,4"} %} +``` + +### Pre-select lead source + +``` +{% form id=42 defaults={"leadsourcecode": 8} %} +``` + +## Redirect after submit and capture the created record GUID + +When a record is successfully created, you can inject the record GUID into a redirect URL using %s. +Example: + +- Redirect setting: /?id=%s +- After create: /?id=00000000-0000-0000-0000-000000000000 + +Use this to forward users to a “Thank you” page, a confirmation screen, or a details page. + +## Set default values via Admin UI (no Twig changes) + +You can define default values inside the Dataverse Admin Area: + +1. Choose the form +2. Go to Fields Customization +3. Find Default Field Values +4. Add field name + default value + +This method supports defaults for: + +- text/number fields +- choice fields +- lookup fields (when configured) + +## Deletion security — authorize delete requests + +If your form registration enables **Allow deleting the record**, you should guard it with the `integration-cds/forms/authorize-delete filter`. + +Add to functions.php: + +``` +add_filter( 'integration-cds/forms/authorize-delete', function( $isAuthorized, $reg, $target ) { + // Reject if no record was resolved + if ( $target === null ) { + return false; + } + + // Example rule: only signed-in users can delete + if ( ! is_user_logged_in() ) { + return false; + } + + // You can add more rules here: + // - check user role/capability + // - check ownership against $target + // - check registration ID via $reg + + return $isAuthorized; +}, 10, 3 ); +``` + +## Lookup security — restrict lookup access to signed-in users + +Lookups use a REST API endpoint and should be protected to avoid accidental data exposure. +The snippet below restricts lookups to **authenticated users only**. + +Add it to the active theme’s functions.php: + +``` +add_filter( 'integration-cds/lookup/authorize-access', function( $isAllowed, $entityName, $view ) { + if ( ! is_user_logged_in() ) { + return false; + } + + return $isAllowed; +}, 10, 3 ); +``` + +## Date & Time behavior — what users will see + +Dataverse fields can behave as: + +**User Local**: value converts to user timezone +**Time Zone Independent**: no conversion +**Date Only**: date without time conversion + +Example value stored: 5/15/2028 03:00:00 AM (User Local field) + +If timezone is UTC + 2, users see 5/15/2028 05:00:00 AM +If timezone is UTC - 4, users see 5/14/2028 11:00:00 PM + +Set timezone per WordPress user + +Users → Edit +Dataverse Extra Fields +Choose Timezone + +Anonymous visitors use the site timezone configured in: +Settings → General → + +## Troubleshooting tips (quick) + +- If the premium plugin is not licensed, forms may fail with syntax errors — verify licensing first. +- If your theme already includes Bootstrap/Font Awesome, consider disabling DataPress dependencies to avoid conflicts. +- If lookup results look too broad, use view filters and/or FetchXML templates in conditional access settings. \ No newline at end of file diff --git a/datapress/Forms/power-apps-forms/forms-overview.md b/datapress/Forms/power-apps-forms/forms-overview.md new file mode 100644 index 0000000..353a3f2 --- /dev/null +++ b/datapress/Forms/power-apps-forms/forms-overview.md @@ -0,0 +1,49 @@ +--- +title: Power Apps Forms +sidebar_position: 1 +premium: true +slug: /forms/forms +tags: + - Form + - DataPress +keywords: [DataPress forms] +--- + +:::note +The plugin previously known as **Dataverse Integration** has been renamed to **DataPress**. +All references in the documentation and user interface will be gradually updated. +::: + +

+Capture leads, feedback, and other data from your website using forms designed in Power Apps and Dynamics 365. +

+ +## What are Power Apps Forms in DataPress? + +**Power Apps Forms** allow you to display Dataverse (Dynamics 365) forms on your WordPress website and submit user input directly back to Dataverse. + +With DataPress, you can: + +- Render Dataverse forms on public or protected pages +- Create new records from form submissions +- Update existing records using table binding +- Display data in a read‑only mode + +## Key concept: Form Registration + +To use a Dataverse form on a WordPress page, DataPress introduces the concept of a **form registration**. + +A form registration acts as a proxy between WordPress and Dataverse. It defines: + +- Which Dataverse form to display +- How the form handles submissions +- Which attributes are required or optional +- Which form‑level settings override global defaults + +## How forms are rendered on the website + +Forms are embedded into pages using the Twig templating engine. + +```twig +{% form id=42 %} +``` \ No newline at end of file diff --git a/datapress/Forms/recaptcha.md b/datapress/Forms/recaptcha.md index 21e9dac..c3c0d17 100644 --- a/datapress/Forms/recaptcha.md +++ b/datapress/Forms/recaptcha.md @@ -1,6 +1,6 @@ --- title: reCAPTCHA support -sidebar_position: 3 +sidebar_position: 10 premium: true slug: /forms/recaptcha tags: diff --git a/datapress/Samples/_category_.json b/datapress/Samples/_category_.json index e8cf522..a9e7df4 100644 --- a/datapress/Samples/_category_.json +++ b/datapress/Samples/_category_.json @@ -1,5 +1,5 @@ { - "label": "Samples", + "label": "Reference Implementations", "position": 16, "link": { "type": "generated-index" diff --git a/datapress/addons/gravity-forms.md b/datapress/addons/gravity-forms.md index 1f597b6..6888248 100644 --- a/datapress/addons/gravity-forms.md +++ b/datapress/addons/gravity-forms.md @@ -1,324 +1,17 @@ --- title: Gravity Forms -sidebar_position: 1 -premium: true +sidebar_label: Gravity Forms slug: /addons/gravity-forms -tags: - - Gravity Forms - - DataPress -keywords: [DataPress Gravity Forms addon, create DataPress form with Gravity Forms] +sidebar_position: 1 --- -

Use gravity forms to manage your organization data

- -## Introduction - -Our plugin supports Gravity Forms. So you can use it instead of our Custom or Power Apps forms - -:::info -Premium feature! This feature is available in the premium extension. -::: - -## Form configuration - -1. **Create a Gravity Form** - -- To begin, navigate to **Forms** → **Add New** in Gravity Forms. - -- Add the necessary fields to the form. - -- Assign titles to each field to ensure clarity. - -- Once all required fields are set up, click the **Save Form** button to finalize the form creation. - -2. **Configure DataPress Feed** - -- After saving the form, you must set up a **DataPress Feed** to integrate the form with Dataverse. - -- Without closing your Gravity Form, go to **Settings** → **DataPress**. - -- Follow the necessary configuration steps to map form fields to table columns. - -
-GF dataverse -
- -Then click `Add New`, select the CRM table, choose the action type (create, update, or upsert - which performs create or update depending on the situation), and map the form columns to the CRM columns by setting a correspondence between the CRM column name (key) and the Gravity Form field name (value). - -
-GF fields mapping -
- -### Access to a table - -Be attentive with the access to tables from Maker portal. Pages, based on Gravity forms do not show any error when you try to fill in and submit the form even if you don't have an access to this table. You click Submit and then you will see success message even when you don't have privilege to create a new record. In that case the administrator will get an email with the details. - -### Dynamic column population - -If you want to set default values for columns you can follow these instructions: - -1. To set default value for standard columns go to `Field settings` tab - `Advanced`. -2. To add lookup column you should go to `Add Fields` tab and choose `Dataverse Lookup` from `Advanced Fields` tab. Then you need to open the `Appearance` tab and set default value. - -If you want to set default values dynamically for columns using the form's field_values attribute (see [Dynamically Populating a Field](https://docs.gravityforms.com/using-dynamic-population/)), you can follow the following instructions. - -1. Add a new field, go to `Advanced Settings` and check the `Allow field to be populated dynamically` checkbox. -2. Specify a parameter name just below the `Allow field to be populated dynamically` checkbox and save the parameter name. -3. Map the field to one of the table columns in the `DataPress Feed` settings. -4. Remember your Gravity Form id. -5. Go to `Pages` -> `Add New` and choose `Custom HTML` block - -Example for setting dynamic value: - -```php -[gravityforms id="1" field_values="parameter_name=Dynamic Value"] -``` - -**Note:** The parameter name in the `field_values` attribute must be the same as specified in the `2nd` point. - -**Note:** When populate a lookup parameter, use the following syntax: parameter_name=`entity_name`:`record_id`. - -Example for `companyid` parameter name (actual column name is `parentcustomerid` in the `contact` Dataverse table): - -1. Fixed value: - - ``` - field_values="companyid=account:f5aaed4c-654c-4730-bd4f-38bc19a330bd" - ``` - -1. Using twig expressions to get dynamic value: - - ```php - field_values="companyid=account:{{account.accountid}}" - ``` - -### How to bind a record by its guid - -To bind a record on a page created with the help of Gravity Forms, follow these steps: - -1. Create a Gravity Form with an Update Action in DataPress Feed: -- First, create a Gravity Form that includes the necessary fields for your record. -- Configure the form to perform an update action in your DataPress feed. - -
-GF feed -
- -- Remember the name of this Gravity Form. - -2. Create a Page based on the Gravity Form Block: -- Create a new page. Use the Gravity Form block to build your page. Save the page. - -
-GF -
- -3. Configure Binding for the Page: -- Locate the page you just created in your list of pages. -- Click `Configure binding` -> `Setup binding`. -- Choose the appropriate table name and select the `Via GUID in query string` option - -
-GF configuration -
- -4. Add the Record GUID to the Page URL: -- Now you can include the record GUID as part of the URL. -- For example, if your record GUID is 65ffaf9a-e8c5-432d-860b-32f841b00d87, your URL could look like - -```php -https://yourwebsite.com/your-page?id=65ffaf9a-e8c5-432d-860b-32f841b00d87 -``` - -Alternatively, you can use a shortcode to achieve the same result (use the `Custom HTML` block): - -```php -[gravityform id="1" action="icds" icds_record="account:2793c9dc-ff0d-ef11-9f89-0022489310b4"] -``` - -This shortcode will populate the form fields with values from the record with the GUID 2793c9dc-ff0d-ef11-9f89-0022489310b4 in the contact table. In this case you don't need to configure binding for the page, just to write the record guid in the `Custom HTML` block. - -:::note - -**Duplicating Gravity Forms with DataPress Feed** - -If you need to reuse an existing form setup, Gravity Forms makes duplication fast and efficient—especially when working with DataPress integration. - -When you duplicate a form through the Gravity Forms admin interface: -- The form structure and all fields are copied. -- The associated DataPress feed is duplicated automatically—retaining table mappings, action types (create or update), and field relationships. - -This eliminates the need to manually reconfigure DataPress integration for each new form. It’s particularly useful for scenarios like: -- Building multiple forms for similar entities (e.g. contacts, leads, events) -- Creating multilingual or region-specific versions of forms -- Iterating new versions for testing, staging, or conditional logic workflows. - -> After duplication, you can tweak individual mappings or feed settings in the new form without affecting the original. - -
-GF duplicate feed -
-::: - -## Handling Various Data Types - -### Lookup Columns - -Lookup column supports two views for displaying the column: dropdown and dialog. - -To select a view, you need to click the `Add Fields` tab and choose `Dataverse Lookup` from `Advanced Fields`. Then open the `Appearance` tab in the column settings. - -
-GF lookup -
- -If you select the dropdown, you must also select the table and view to lookup. The dialog view does not require any additional settings. - -
-GF lookup 2 -
- -To set a default value for a Dataverse Lookup field, use the following format: - -```php - table:98837486-742e-ed22-9db1-00224893bd2f -``` - -
-GF lookup default value -
- -To filter the available options in a dropdown lookup, you can apply a FetchXML query: - -```twig - - - -``` - -
- -
- -For a **Dialog** Lookup, the format includes the entity name: - -```php -account:98837486-742e-ed22-9db1-00224893bd2f -``` - -Replace account or table with the appropriate entity logical name, and use the actual GUID of the record you want to preselect. - -To control conditional access to requested records in dropdown or dialog use fetchXML filter. - -### Choice - -Choice columns allow you to present dropdown lists with fixed values in your app, ensuring data consistency. [Read more](https://learn.microsoft.com/power-apps/maker/data-platform/custom-picklists). - -Choice columns can be configured as either **single selection (choice)** or **multi-selection (choices)**. - -**Single Selection (Choice) - Radio Buttons** - -When a user must select only one value from the list, use **Radio Buttons**: - -
-GF single choice -
- -- Select the **table** and the **column** where the choice values are stored. - -Map the selected **Form Field** to the corresponding table column in DataPress Feed. - -**Multi-Selection (Choices) - Multi Select** - -For cases where multiple values can be selected, use **Multi Select**: - -
-GF multiple choice -
- -- Select the **table** and the **column** where the multi-choice values are stored. - -- Map the selected **Form Field** to the corresponding table column in DataPress Feed. - -### Date and time columns - -To create a record with `date and time` data type columns you need to follow next steps: -1. Add a Date Field to Your Gravity Form: -- In your Gravity Form, create a field that captures the date. This field will store the date portion of your record. -- Configure the date field according to your requirements (e.g., date format, default value, etc.). - -
-GF date -
- -2. Add a Time Field: -- Next, add a separate field to capture the time. This field will store the time portion of your record. -- Customize the time field settings as needed (e.g., 12-hour or 24-hour format, default time, etc.). - -
-GF time -
- -3. Map the Fields and columns in DataPress Feed: -- When configuring your DataPress feed (integration with Dataverse), you’ll observe that instead of a single column from the Power App, you’ll encounter two separate columns: one for the date and another for the time. These columns are `pseudo-columns` because they do not exist in Dataverse as standalone entities. Instead, they are derived by splitting or combining data from the source column as needed. - -
-GF fields -
- -- Map the date field from your Gravity Form to the corresponding date column in Dateverse. -- Similarly, map the time field from your Gravity Form to the corresponding time column in Dateverse. - -
-Mapping -
- -Here are two options. We recommend using **Local Date** and **Local Time** for the **User Local** behavior option, and **Date Only**, **Time Only** (or **UTC Date** and **UTC Time**) for the **Time Zone Independent** and **Date Only** behavior options. -[Read more](https://learn.microsoft.com/en-us/power-apps/maker/data-platform/behavior-format-date-time-field) - -**DataPress Admin Area Settings:** - -Adjust the `ICDS_DATETIME_VALUE` setting with options like: - -- **Legacy** -- **UTC** -- **Local** - -The **Time Zone Independent** and **Date Only** behavior options works as UTC and don't depend on the user's timezone - -Examples for the **DateTimeUserLocal** column which has User Local behavior: - -| | Legacy | UTC | Local | -|----------------------|--------------|----------------|-----------| -|`DateTimeUserLocal (UTC DateTime) (Date Only)` | UTC | UTC | UTC | -|`DateTimeUserLocal (UTC DateTime) (Time Only)` | UTC | UTC | UTC | -|`DateTimeUserLocal (Local Date)` | convert the date to the user's timezone | convert the date to the user's timezone | convert the date to the user's timezone | -|`DateTimeUserLocal (Local Time)` | convert the time to the user's timezone | convert the time to the user's timezone | convert the time to the user's timezone | - -Examples for the **DateOnlyUserLocal** column which has User Local behavior: - -| | Legacy | UTC | Local | -|----------------------|--------------|----------------|-----------| -|`DateOnlyUserLocal (UTC Date) (Date Only)` | UTC | UTC | UTC | -|`DateOnlyUserLocal (Local Date)` | convert the date to the user's timezone | convert the date to the user's timezone | convert the date to the user's timezone | - -
-Gravity date -
- -In case, when you set only time value, the date represents the date zero (January 1, 1900). - -### File upload columns - -You can set maximum attached file size for File upload column in Gravity Forms. But you should also remember about the file size limits which are set for such columns in crm. So that your maximum attached file should not be more than the size from the crm column settings. - -At current moment we don't support uploading multiple files. - -## Sending Error Messages to the Admin Email - -To configure error notifications: -1. Navigate to the Gravity Forms plugin settings. -2. Open the DataPress menu. -3. Specify one or more email addresses to receive error messages. +import React from 'react'; +import {useHistory} from '@docusaurus/router'; -You can enter any valid email address — not just admin accounts. This allows you to notify stakeholders whenever an error occurs during form submission or CRM integration. \ No newline at end of file +export default function Redirect() { + const history = useHistory(); + React.useEffect(() => { + history.replace('/forms/gravity-forms/'); + }, []); + return null; +} \ No newline at end of file diff --git a/datapress/using-twig/filters_and_function.md b/datapress/using-twig/filters_and_function.md index 3f377a7..24f05c3 100644 --- a/datapress/using-twig/filters_and_function.md +++ b/datapress/using-twig/filters_and_function.md @@ -1,5 +1,5 @@ --- -sidebar_position: 3 +sidebar_position: 7 title: Filters and function slug: /twig/filters_and_function tags: diff --git a/datapress/using-twig/separate_columns_in_twig.md b/datapress/using-twig/separate_columns_in_twig.md index 476be45..765e060 100644 --- a/datapress/using-twig/separate_columns_in_twig.md +++ b/datapress/using-twig/separate_columns_in_twig.md @@ -1,6 +1,6 @@ --- -sidebar_position: 2 -title: Using Twig to display the value of separate columns +sidebar_position: 6 +title: Using Twig to display the value of separate columns - old slug: /twig/display-separate-column-value tags: - Twig diff --git a/datapress/using-twig/twig_configuration.md b/datapress/using-twig/twig_configuration.md new file mode 100644 index 0000000..9c2c012 --- /dev/null +++ b/datapress/using-twig/twig_configuration.md @@ -0,0 +1,84 @@ +--- +sidebar_position: 2 +title: Twig Configuration +slug: /twig/configuration +tags: [Twig, Configuration] +keywords: [DataPress twig configuration] +--- + +## Debug Mode + +Twig debugging allows use of `dump()` to inspect Twig variables. +It becomes active when: + +- WordPress debug mode (`WP_DEBUG`) is enabled, or +- `ICDS_TWIG_DEBUG = true`. + +## Template Caching + +Caching improves Twig template rendering performance. +Enable it with (Advanced settings in DataPress Admin Area): + +``` +ICDS_TWIG_CACHE = true +``` + +## Mobile Device Detection + +DataPress exposes **MobileDetect** helpers in Twig: + +```twig +isMobile: {% if isMobile %}Yes{% else %}No{% endif %} +isChrome: {% if isChrome %}Yes{% else %}No{% endif %} +isFirefox: {% if isFirefox %}Yes{% else %}No{% endif %} +``` + +Intellisense hints are available when typing `{{` inside a Dataverse Twig block. + +## Date/Time Mode + +Your Dataverse **ICDS_DATETIME_VALUE** setting controls how date columns behave: + +- Legacy +- UTC +- Local + +Different fields (e.g., User Local) adjust their output accordingly. +Use `format_datetime()` for consistent locale/timezone formatting. + +Examples for the **createdon** column which has User Local behavior: + +| | Legacy | UTC | Local | +|----------------------|--------------|----------------|-----------| +|`{{record.createdon}}` | UTC | UTC | convert the date and time to the user's timezone | +|`{{record.createdon_utc}}` | UTC | UTC | UTC | +|`{{record.createdon_local}}` | convert the date and time to the user's timezone | convert the date and time to the user's timezone | convert the date and time to the user's timezone | + +[Usage Scenarios](/date-and-time/#usage-scenarios) + +### Timezone & Locale Sources + +- user.timezone / user.locale +- site.timezone / site.locale + +These follow the IANA timezone format (e.g., Europe/Paris, UTC). + +## Request Context + +Object `request` contains information about the current request. It has the following members: + +- `params` -- merged map of cookies, POST form values and GET query arguments +- `path` -- relative page URL +- `path_and_query` -- relative page URL with query arguments +- `query` -- query arguments, start with `?` if not empty +- `url` -- full request URL + +Global object `params` is the alias of `request.params`. + +### Dataverse Connection Status + +``` +{% if crm.connected %} + Dataverse connection active +{% endif %} +``` \ No newline at end of file diff --git a/datapress/using-twig/twig_examples.md b/datapress/using-twig/twig_examples.md new file mode 100644 index 0000000..69bbaa3 --- /dev/null +++ b/datapress/using-twig/twig_examples.md @@ -0,0 +1,127 @@ +--- +sidebar_position: 4 +title: Twig Examples +slug: /twig/examples +tags: [Twig, DataPress] +keywords: [DataPress twig examples] +--- + +# Twig Examples + +This page provides practical Twig snippets for displaying data, formatting values, and building custom forms in DataPress. + +--- + +## Render a Page-Bound Record + +```twig +{% if binding.is_bound %} + {% set contact = binding.record %} + {{ contact["fullname"] }} <{{ contact["emailaddress1"] }}> +{% endif %} +``` + +## Display Current User Information + +```twig + +{% if user.is_bound %} + {{ user.record["fullname"] }} +{% endif %} +``` + +## Access your Dataverse Integration organization metadata + +`metadata` object allows accessing metadata of your Dataverse instance. It follows the interface of `EntityMetadata` in XRM SDK. See [Microsoft reference docs](https://docs.microsoft.com/en-us/dotnet/api/microsoft.xrm.sdk.metadata.entitymetadata). + +```twig +{% set options = metadata["contact"].Attributes["gendercode"].OptionSet.Options %} +{% for option in options %} +
  • {{option.Value}} - {{option.Label.UserLocalizedLabel.Label}}
  • +{% endfor %} +``` + +## Format Date Using User Locale & Timezone + +```twig +{{ "now" | format_datetime('short', 'short', locale=user.locale, timezone=user.timezone) }} +``` + +## Access Any Dataverse Record + +```twig +{{ entities.contact["00000000-0000-0000-0000-000000000000"]["fullname"] }} +``` + +## Using Twig to display the value of separate columns + +### Working with Date Columns + +Standard formatting + +```twig +{{ record.birthdate | format_datetime( + dateFormat='short', + timeFormat='short', + locale=user.locale, + timezone=user.timezone +) }} +``` + +Convert timezone + +```twig +{{ record.birthdate | date("F jS \\a\\t g:ia", "Europe/Paris") }} +``` + +Custom datetime pattern + +```twig +{{ record.birthdate | format_datetime(pattern="hh 'oclock' a, zzzz") }} +``` + +Calculate real GMT offset + +```twig +{{ "2024-08-11T17:39:00+03" | timezone_offset("Australia/Sydney") }} +``` + +### Lookup Fields + +```twig +{{ record.parentcustomerid.Name }} +{{ record.parentcustomerid.Id }} +``` + +### Choice Fields + +```twig +{{ record | formatted_value("cr1d1_choiceday") }} +``` + +### Currency Fields + +```twig +{{ record | formatted_value("cr1d1_currency") }} +``` + +### Duration Fields + +Convert CRM duration (minutes) → readable format: + +```twig +{% set record=entities.contact["dad5909a-973c-ef11-a316-000d3ad268c1"] %} +{{ record.cr8d6_duration*60 | format_time(pattern: 'mm min. ss sec.') }} +``` + +## Specify fields to display + +When using the `expand` filter, you can specify which fields to display. If you don’t specify any fields, all of them will be selected. Fields are specified as an array or a comma-delimited string. + +```twig +{% set contact = entities.contact['ea8157fa-cc32-ef11-8409-000d3a38d58d']|expand('createdby','fullname,Id') %} + +{% set contact = entities.contact['ea8157fa-cc32-ef11-8409-000d3a38d58d']|expand('createdby',['fullname']) %} + +{% set contact = entities.contac​t['ea8157fa-cc32-ef11-8409-000d3a38d58d']|expand('createdby') %} +``` \ No newline at end of file diff --git a/datapress/using-twig/twig_introduction.md b/datapress/using-twig/twig_introduction.md index 06c59da..71453a2 100644 --- a/datapress/using-twig/twig_introduction.md +++ b/datapress/using-twig/twig_introduction.md @@ -1,6 +1,6 @@ --- -sidebar_position: 1 -title: Using Twig +sidebar_position: 5 +title: Using Twig - old slug: /twig/introduction tags: - Twig diff --git a/datapress/using-twig/twig_overview.md b/datapress/using-twig/twig_overview.md new file mode 100644 index 0000000..3e2d50e --- /dev/null +++ b/datapress/using-twig/twig_overview.md @@ -0,0 +1,23 @@ +--- +sidebar_position: 1 +title: Twig Overview +slug: /twig/overview +tags: [Twig, DataPress] +keywords: [DataPress twig] +--- + +> **Note:** Dataverse Integration has been renamed to **DataPress**. All references will be gradually updated. + +Use **Twig templates** to build custom layouts and display Dataverse data directly inside WordPress. +DataPress extends Twig with additional objects, helpers, and filters to simplify working with Dataverse entities, metadata, user binding, and environment settings. + +## What You Can Do with Twig in DataPress + +- Render Dataverse records in custom layouts. +- Access page-bound records and current user data. +- Query any Dataverse table by logical name and GUID. +- Read site, user, and request context. +- Format dates, currencies, durations, choices, and lookup values. +- Build dynamic forms (including multiple‑choice fields). + +[Refer to the official Twig documentation for templating basics](https://twig.symfony.com/doc/2.x/templates.html) diff --git a/datapress/using-twig/twig_reference.md b/datapress/using-twig/twig_reference.md new file mode 100644 index 0000000..74970f6 --- /dev/null +++ b/datapress/using-twig/twig_reference.md @@ -0,0 +1,35 @@ +--- +sidebar_position: 3 +title: Twig Reference. Capabilities & Limitations +slug: /twig/reference +tags: [Twig, DataPress] +keywords: [DataPress twig reference] +--- + +## Global Objects Overview + +### `binding` — Current Page-Bound Record + +- `is_bound` +- `reference` — lightweight entity reference +- `record` — full entity data (slower) +- `currentrecord` — legacy alias (use only for backward compatibility) + +### `user` — Current User Information + +- `is_bound` +- `reference` +- `record` +- `wp_user` +- `timezone` +- `locale` + +**Performance tip:** prefer `.reference` unless the full record is needed. + +### `entities` — Any Record by Table & GUID + +Example: + +```twig +{{ entities.contact["GUID"]["fullname"] }} +``` diff --git a/docusaurus.config.ts b/docusaurus.config.ts index 15a9870..7e354cf 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -89,7 +89,7 @@ const config: Config = { from: ['/integration-cds/forms'], }, { - to: '/addons/gravity-forms', + to: '/forms/gravity-forms', from: ['/integration-cds/gravity-forms'], }, { diff --git a/src/css/custom.css b/src/css/custom.css index 9a8f255..383500a 100644 --- a/src/css/custom.css +++ b/src/css/custom.css @@ -1,13 +1,13 @@ :root { --ifm-color-primary: #0077c2 !important; --ifm-color-primary-dark: #006bb0; - --ifm-color-primary-darker: #004080; /* заменено для контраста */ + --ifm-color-primary-darker: #004080; --ifm-color-primary-darkest: #004f8a; --ifm-color-primary-light: #48D0FF !important; --ifm-color-primary-lighter: #48D0FF; --ifm-color-primary-lightest: #7EDCFF !important; - --ifm-background-color: #ffffff !important; + --ifm-background-color: #ffffff; --ifm-font-color-base: #212121; --ifm-code-font-size: 95%; --docusaurus-highlighted-code-line-bg: rgba(0, 119, 194, 0.1); @@ -52,7 +52,7 @@ .navbar__link, .navbar__title { - color: #ffffff !important; + color: #ffffff; text-decoration: none !important; } @@ -63,7 +63,7 @@ /* Hero section */ .hero--primary { background-color: var(--ifm-color-primary) !important; - color: #ffffff !important; + color: #ffffff; } /* Content links only */ @@ -71,7 +71,7 @@ article a:not(.menu__link):not(.navbar__link):not(.breadcrumbs__link):not(.menu_ p a[target="_blank"], details summary, span[itemprop="name"] { - color: #004080; /* тёмный оттенок для контраста */ + color: #004080; font-weight: 700; } @@ -81,7 +81,7 @@ article a:hover { /* External links in paragraphs */ p a[target="_blank"] { - color: #004080 !important; /* исправлено */ + color: #004080 !important; font-weight: 700; text-decoration: underline; } @@ -94,13 +94,61 @@ article a[href^="http"]:not([href*="docs.alexacrm.com"]):after { height: 16px; margin-left: 6px; vertical-align: middle; - background-color: currentColor; - mask-image: url("/img/external-link.svg"); - mask-repeat: no-repeat; - mask-size: contain; - -webkit-mask-image: url("/img/external-link.svg"); - -webkit-mask-repeat: no-repeat; - -webkit-mask-size: contain; +} + +/* Limit content width for better readability on long pages */ +.markdown, +.theme-doc-markdown { + max-width: 780px; +} + +/* Section headers (H2) */ +.markdown h2 { + margin-top: 3.5rem; + margin-bottom: 1.2rem; + padding-bottom: 0.4rem; + border-bottom: 1px solid var(--ifm-toc-border-color); +} + +/* Subsection headers (H3) */ +.markdown h3 { + margin-top: 2.2rem; + margin-bottom: 0.6rem; +} + +/* Minor headers (H4) */ +.markdown h4 { + margin-top: 1.6rem; + font-weight: 600; +} + +/* Paragraph readability */ +.markdown p { + line-height: 1.7; + margin-bottom: 1rem; +} + + +/* Lists spacing */ +.markdown ul, +.markdown ol { + margin-top: 0.5rem; + margin-bottom: 1.2rem; +} + +.markdown li { + margin-bottom: 0.3rem; +} + + +/* Admonitions as visual anchors */ +.theme-admonition { + margin: 2rem 0; +} + +/* Add breathing space between sections */ +.markdown > h2 + p { + margin-top: 1.2rem; } /* Collapsible block */ @@ -111,7 +159,7 @@ details summary { position: relative; padding-left: 24px; margin-bottom: 0.5rem; - color: #004080; /* исправлено */ + color: #004080; } details summary:hover { @@ -165,15 +213,15 @@ span[itemprop="name"], /* Buttons */ button { - color: #004080 !important; /* исправлено */ - background-color: #ffffff !important; + color: #004080; + background-color: #ffffff; font-weight: 700; border: 1px solid #004f8a; padding: 0.4em 0.8em; } button:hover { - background-color: #f0f8ff !important; + background-color: #f0f8ff; color: #003f70 !important; } @@ -222,4 +270,197 @@ span[itemprop="name"] { .token.number { color: #006400 !important; font-weight: 600 !important; -} \ No newline at end of file +} + +/* Section headers (H2) */ +.markdown h2 { + margin-top: 3.5rem; + margin-bottom: 1.2rem; + padding-bottom: 0.4rem; + border-bottom: 1px solid var(--ifm-toc-border-color); +} + +/* Subsection headers (H3) */ +.markdown h3 { + margin-top: 2.2rem; + margin-bottom: 0.6rem; +} + +/* Minor headers (H4) */ +.markdown h4 { + margin-top: 1.6rem; + font-weight: 600; +} + +/* Paragraph readability */ +.markdown p { + line-height: 1.7; + margin-bottom: 1rem; +} + + +/* Lists spacing */ +.markdown ul, +.markdown ol { + margin-top: 0.5rem; + margin-bottom: 1.2rem; +} + +.markdown li { + margin-bottom: 0.3rem; +} + + +/* Admonitions as visual anchors */ +.theme-admonition { + margin: 2rem 0; +} + +/* Add breathing space between sections */ +.markdown > h2 + p { + margin-top: 1.2rem; +} + +/* ================================ + Centering content and preventing it from sticking to the right + ================================ */ + +:root { + --doc-content-max-width: 780px; +} + +.theme-doc-markdown, +.markdown { + max-width: var(--doc-content-max-width); +} + + +/* Desktop TOC */ +.theme-doc-toc-desktop, +.table-of-contents { + font-size: 0.95rem; + font-weight: 500; + letter-spacing: 0.01em; + line-height: 1.4; +} + +.table-of-contents a { + font-weight: 500; +} + +.markdown > h2 + p { + margin-top: 1.2rem; +} + +.tab-toc { + position: sticky; + top: var(--ifm-navbar-height); + max-height: calc(100vh - var(--ifm-navbar-height)); + overflow: auto; + padding: 0.5rem 0 0.5rem 0.25rem; + margin-bottom: 1rem; + border-left: 2px solid var(--ifm-toc-border-color, #eaecef); +} + +.tab-toc strong { + display: block; + font-size: 0.9rem; + margin: 0 0 0.5rem 0.5rem; + color: var(--ifm-color-emphasis-700); +} + +.tab-toc-list { + list-style: none; + padding-left: 0.5rem; + margin: 0; +} + +.tab-toc-list li { + margin: 0.2rem 0; +} + +.tab-toc-list li.level-2 { margin-left: 0.25rem; } +.tab-toc-list li.level-3 { margin-left: 1rem; font-size: 0.95em; } +.tab-toc-list li.level-4 { margin-left: 1.75rem; font-size: 0.9em; } + +.theme-doc-toc-desktop { + width: var(--doc-toc-width); + flex: 0 0 var(--doc-toc-width); + max-width: var(--doc-toc-width); +} + + +.tabs-container { + width: 100%; +} + +.tab-item, +.tabs__content { + width: 100%; +} + +.tabs__content > * { + max-width: var(--doc-content-max-width); +} + +/* ===================================== + DARK MODE – contrast & readability fix + ===================================== */ + +[data-theme='dark'] { + + /* Base text */ + color: var(--ifm-font-color-base); +} + +/* Content */ +[data-theme='dark'] .theme-doc-markdown, +[data-theme='dark'] .markdown { + background-color: transparent; + color: var(--ifm-font-color-base); +} + +/* Links inside content */ +[data-theme='dark'] article a, +[data-theme='dark'] .markdown a { + color: var(--ifm-color-primary-light); +} + +[data-theme='dark'] article a:hover { + color: var(--ifm-color-primary-lighter); +} + +/* details / collapsible */ +[data-theme='dark'] details, +[data-theme='dark'] details summary { + color: var(--ifm-font-color-base); + border-color: var(--ifm-color-primary); +} + +/* Menu, breadcrumbs, TOC */ +[data-theme='dark'] .menu__link, +[data-theme='dark'] .menu__link--active, +[data-theme='dark'] .pagination-nav__label, +[data-theme='dark'] .breadcrumbs__link, +[data-theme='dark'] .DocSearch-Button-Placeholder, +[data-theme='dark'] .table-of-contents a { + color: var(--ifm-font-color-base) !important; +} + +/* Buttons */ +[data-theme='dark'] button { + background-color: #123548 !important; + color: var(--ifm-font-color-base) !important; + border-color: var(--ifm-color-primary); +} + +[data-theme='dark'] button:hover { + background-color: #1a4a63 !important; +} + +/* Panes */ +[data-theme='dark'] .left-pane, +[data-theme='dark'] .right-pane { + background-color: #102a3a; + color: var(--ifm-font-color-base); +}