metronic: Problem in Custom js in Laravel
when I want to have a "path" like this:account/annunci/4/edit
I can't get the "js" in the "config/global/pages.php" file to work
my config:
'account' => array(
'annunci' => array(
'title' => 'Lista annunci',
'assets' => array(
'custom' => array(
'css' => array(
'plugins/custom/datatables/datatables.bundle.css',
),
'js' => array(
'plugins/custom/datatables/datatables.bundle.js',
),
),
), 'create' => array(
'title' => 'Aggiungi Annuncio',
'assets' => array(
'custom' => array(
'css' => array(
'plugins/custom/datatables/datatables.bundle.css',
),
'js' => array(
'plugins/custom/datatables/datatables.bundle.js',
'js/custom/account/annunci/create-annuncis.js',
),
),
),
),
'*' => array(
'edit' => array(
'title' => 'Modifica Annuncio',
'assets' => array(
'custom' => array(
'js' => array(
'js/custom/account/annunci/edit-annuncis.js',
),
),
),
),
),
),
My JS is not added to the view. But if I put the numeric id instead of the asterisk, it works.
Replies (5)
Hi try putting your path inside of the asterisk. Like this.
'*' => array(
'annunci' => array(
'title' => 'Lista annunci',
'assets' => array(
'custom' => array(
'css' => array(
'plugins/custom/datatables/datatables.bundle.css',
),
'js' => array(
'plugins/custom/datatables/datatables.bundle.js',
),
),
),
This is my original "array".
Alla fine io ho modificato questa funzione perché non riusciva a prendere le pagine quando dovevo editare qualche pagina.
By modifying the "getOption" function in "app/Core/Adapters/Theme.php",
it works with all levels and is read only once.
Hi Gabriele,
Thank you for the solution. We will add it as a fix.
Thanks
Hi, I'm having the same problem too, the custom JS would not load. Kindly assist me too, thank you very much