Back to Back To Front Support

andrey.averkov13595
andrey.averkov13595

Example

title = "Executors"
url = "/executors"
layout = "default"
is_hidden = 0

[session]
security = "user"
redirect = "login"

[backtofront]
controllerSelect = "Linkonoid\TestBTFplugin\Controllers\UserClients"
modelSelect = "Linkonoid\TestBTFplugin\Models\UserClients"
viewPath = "$/linkonoid/backtofront/components/backtofront/default"
alias = "{{ :alias }}"
crud = "{{ :crud }}"
id = "{{ :id }}"
injectRowClass = "rowlink"
limit = 20
==
{% component 'backtofront' %}

Errror

We're sorry, but an unhandled error occurred. Please see the details below.

Cannot access protected property Backend\Behaviors\RelationController::$alias

Linkonoid
Linkonoid

Yes, the original relation controller has expansion restrictions. In the settings you need to enable "Use modificated OctoberCMS core files" (there are 3 files, including RelationController.php, where "protected $alias;" is replaced with "public $alias;").

These files are located in the "/linkonoid/backtofront/vendor/backtofront/modifed" folder (maybe I shouldn't have put them in the "vendor" folder), this is in case you change this files manually.

Last updated

andrey.averkov13595
andrey.averkov13595

I have

title = "userclients"
url = "/userclients"
layout = "default"
is_hidden = 0

[backtofront userclients]
controllerSelect = "Linkonoid\TestBTFplugin\Controllers\UserClients"
modelSelect = "Linkonoid\TestBTFplugin\Models\UserClients"
viewPath = "$/linkonoid/backtofront/components/backtofront/default"
alias = "{{ :alias }}"
crud = "{{ :crud }}"
id = "{{ :id }}"
injectRowClass = "rowlink"
limit = 20
==
{% component 'userclients' %}

List display, but after click create -> 404? Why?

Linkonoid
Linkonoid

The code below is from the test server. Please note that you have at least 1 problem: "url" is not correct set. The component does not understand what alias, operation and Id to use. Lists must have 3 parameters ("/:alias?/:crud?/:id?")

title = "Demonstration"
url = "/useraccount/:alias?/:crud?/:id?"
layout = "default"
meta_title = "TEST"
is_hidden = 0

[backtofront UserClients]
controllerSelect = "Linkonoid\TestBTFplugin\Controllers\UserClients"
modelSelect = 0
viewPath = "$/linkonoid/backtofront/components/backtofront/default"
alias = "{{ :alias }}"
crud = "{{ :crud }}"
id = "{{ :id }}"
injectRowClass = "rowlink"
allowRainlabUser = 1
userIdFieldName = "user_id"
limit = 20

[backtofront UserClientsMoneys]
controllerSelect = "Linkonoid\TestBTFplugin\Controllers\UserClientsMoneys"
modelSelect = 0
viewPath = "$/linkonoid/backtofront/components/backtofront/userclientsmoneys"
alias = "{{ :alias }}"
crud = "{{ :crud }}"
id = "{{ :id }}"
injectRowClass = "rowlink"
allowRainlabUser = 1
userIdFieldName = "user_id"
limit = 20

The "testbtfplugin" plugin is completely authentic to the standard plugin and should work without this plugin in backend mode. The folder "plugins/linkonoid/backtofront/components/backtofront" contains modified partials that allow the correct display of standard widgets in the frontend (the "viewPath" parameter in the component settings).

Last updated

andrey.averkov13595
andrey.averkov13595

Thanks a lot. The following was not obvious

url = "/useraccount/:alias?/:crud?/:id?"
modelSelect = 0

1-5 of 5