Skip to content

Commit

Permalink
fixes #68
Browse files Browse the repository at this point in the history
  • Loading branch information
tabacitu committed Oct 16, 2018
1 parent bc36510 commit acddd67
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/app/Http/Controllers/Admin/PageCrudController.php
Expand Up @@ -14,8 +14,6 @@ class PageCrudController extends CrudController

public function setup($template_name = false)
{
parent::__construct();

$modelClass = config('backpack.pagemanager.page_model_class', 'Backpack\PageManager\app\Models\Page');

/*
Expand Down Expand Up @@ -91,6 +89,8 @@ public function store(StoreRequest $request)
// Overwrites the CrudController edit() method to add template usage.
public function edit($id, $template = false)
{
$template = request('template');

// if the template in the GET parameter is missing, figure it out from the db
if ($template == false) {
$model = $this->crud->model;
Expand Down
Expand Up @@ -47,7 +47,7 @@ function redirect_to_new_page_with_template_parameter() {
var new_template = $("#select_template").val();
var current_url = "{{ Request::url() }}";
window.location.href = strip_last_template_parameter(current_url)+'/'+new_template;
window.location.href = strip_last_template_parameter(current_url)+'?template='+new_template;
}
function strip_last_template_parameter(url) {
Expand Down

0 comments on commit acddd67

Please sign in to comment.