Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

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.


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (5)


Hi,

Could you please try to put the * object at the top?

<img src=" alt="image" border="0">

Thanks



This is my original "array".

<img src=" />


Alla fine io ho modificato questa funzione perché non riusciva a prendere le pagine quando dovevo editare qualche pagina.

<img src=" />

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



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",
),
),
),


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(