This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

nylson.bryan25052
nylson.bryan25052

After created a plugin with builder and I populated the database, in the backend there is the list of elements. When I click in an element I do not want to open the update view (default behavior), but a new empty page related to that element. I tried to create a new view (test.htm) in the controller folder and set its path to config_list.yaml, but it does not work.

Tschallacka
Tschallacka

Open the following file in an editor

/plugins/AuthorName/PluginName/controllers/controllername/config_list.yaml

Change the value for recordUrl

  recordUrl: authorname/pluginname/controller/mynewview/:id

in the controller make a function

  public function mynewview() {
         $id = $this->params[0];
         $model = MyModel::find($id);
         return $this->makePartial('mynewview', ['model' => $model]);
  }

And make a file named _mynewview.htm which contains your thing.

nylson.bryan25052
nylson.bryan25052

Tschallacka said:

Open the following file in an editor

/plugins/AuthorName/PluginName/controllers/controllername/config_list.yaml

Change the value for recordUrl

 recordUrl: authorname/pluginname/controller/mynewview/:id

in the controller make a function

 public function mynewview() {
        $id = $this->params[0];
        $model = MyModel::find($id);
        return $this->makePartial('mynewview', ['model' => $model]);
 }

And make a file named _mynewview.htm which contains your thing.

Thanks!

1-3 of 3

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.