Skip to content

Commit

Permalink
adjust origin to slug when home page
Browse files Browse the repository at this point in the history
  • Loading branch information
finanalyst committed May 10, 2018
1 parent fa4fe66 commit 42bb26d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# v1.0.1
## 10 May 2018
1. [](#update)
* adjust origin route to slug if origin is home page. Otherwise redirects do not work.
# v1.0.0
## 05/03/2018

Expand Down
2 changes: 1 addition & 1 deletion blueprints.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Sequential Form
version: 1.0.0
version: 1.0.1
description: A sequence of pages, each with a form is linked, with all form data processed according to the final process
icon: link
author:
Expand Down
5 changes: 4 additions & 1 deletion sequential-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use ReflectionProperty;

/**
* Class MypluginPlugin
* Class SequentialFormPlugin
* @package Grav\Plugin
*/
class SequentialFormPlugin extends Plugin
Expand Down Expand Up @@ -120,6 +120,9 @@ public function onFormProcessed(Event $event)
$seq_name = 'sequence_' . ($params['name']?:'default');
$url = ((string)$params['routes'][0]);
$origin = $this->grav['page']->route() ;
if ($origin === '/') { // sequence form is on home page, so get page's slug
$origin = $this->grav['page']->header()->{'slug'};
}
$sequence = [
'stage' => 1,
'routes' => $params['routes'] ,
Expand Down
1 change: 1 addition & 0 deletions sequential-form.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
enabled: true
built_in_css: true

0 comments on commit 42bb26d

Please sign in to comment.