← Back to Back To Front Support
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
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
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?
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
Thanks a lot. The following was not obvious
url = "/useraccount/:alias?/:crud?/:id?"
modelSelect = 0
I encountered an issue while working with the BacktoFront component in my project. Specifically, I received the following error: Cannot access protected property Backend\Behaviors\RelationController::$alias:rice purity test It seems that the $alias property is not accessible due to its protected status in the RelationController. Has anyone else faced this issue? Any suggestions on how to resolve it or work around this limitation would be greatly appreciated!
1-6 of 6