Skip to content

Commit

Permalink
refactor: Add copy code examples
Browse files Browse the repository at this point in the history
  • Loading branch information
khalwat committed Oct 23, 2023
1 parent 8b28bfa commit ef92273
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions docs/docs/advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,21 @@ You'll also see the rendered tags that SEOmatic has added to your webpage under

When hovering the cursor over any property, a clipboard icon will appear that when clicked on copies to the clipboard example code of how to get/set values for that particular property via Twig.

Tag example:
```twig
{# @var tag \nystudio107\seomatic\models\MetaTag #}
{% set tag = seomatic.tag.get('robots') %}
```

Tag property example:

```twig
{#-- Get the value --#}
{% set value = seomatic.tag.get('robots').content %}
{#-- Set the value --#}
{% do seomatic.tag.get('robots').content(value) %}
```

### Variables

Variables are used throughout SEOmatic when rendering tags, or controlling how tags are rendered. Tag properties often reference these variables via Twig expressions.

Check warning on line 48 in docs/docs/advanced.md

View workflow job for this annotation

GitHub Actions / build (14.x)

"are used" may be passive voice

Check warning on line 48 in docs/docs/advanced.md

View workflow job for this annotation

GitHub Actions / build (14.x)

"are rendered" may be passive voice
Expand All @@ -40,6 +55,14 @@ You can expand and sub-properties of nested properties by clicking on them.

When hovering the cursor over any property, a clipboard icon will appear that when clicked on copies to the clipboard example code of how to get/set values for that particular property via Twig.

Variable example:
```twig
{#-- Get the value --#}
{% set value = seomatic.meta.seoImage %}
{#-- Set the value --#}
{% do seomatic.meta.seoImage(value) %}
```

## Config Settings

SEOmatic supports the standard `config.php` multi-environment friendly config file for the plugin settings. Just copy the `config.php` to your Craft `config/` directory as `seomatic.php` and you can configure the settings in a multi-environment friendly way.

Check warning on line 68 in docs/docs/advanced.md

View workflow job for this annotation

GitHub Actions / build (14.x)

"Just" can weaken meaning
Expand Down

0 comments on commit ef92273

Please sign in to comment.