Skip to content

Commit

Permalink
Update modx.sendforward.md
Browse files Browse the repository at this point in the history
syntax fix
  • Loading branch information
ant-tar authored Jun 23, 2024
1 parent b7e9a8d commit c367751
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions en/extending-modx/modx-class/reference/modx.sendforward.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ void sendForward (integer $id, [string|array $options = null], [boolean $sendErr

## Examples

1. Send the user to Resource ID 234 without actually changing the URL.
Send the user to Resource ID 234 without actually changing the URL.

``` php
$modx->sendForward(234);
```

2. Send user to 404 Error page, for actual page ID we use [error_page](building-sites/settings/error_page) system setting value. If there is no such value,
Send user to 404 Error page, for actual page ID we use [error_page](building-sites/settings/error_page) system setting value. If there is no such value,
the value of [site_start](building-sites/settings/site_start) will be used.

``` php
Expand All @@ -46,7 +46,7 @@ $options = array(
);
$this->sendForward($this->getOption('error_page', $options, $this->getOption('site_start')), $options, false);
```
3. Show replacement page, keeping original `pagetitle`, `introtext` and other fields. To do this, you just need to specify an additional array with keys:
Show replacement page, keeping original `pagetitle`, `introtext` and other fields. To do this, you just need to specify an additional array with keys:

``` php
$options = array(
Expand All @@ -56,6 +56,7 @@ $options = array(
);
$this->sendForward(15, $options);;
```

[forward_merge_excludes](building-sites/settings/forward_merge_excludes) setting manages source page fields that need to be excluded from the results. Next fields will definitely be added as well: `content,pub_date,unpub_date,richtext`

This is good approach if you want hide/protect some resources but left `pagetitle` and `description` for visitors and search crawlers.
Expand Down

0 comments on commit c367751

Please sign in to comment.