Add a menu item

Sorry, this is the last log:

‘[2016-08-09 10:04:20] WEB.ERROR: An exception has been thrown during the rendering of a template (“Named route not found for name: mytest.view”) in “authed.twig” at line 118. Exception Type: Twig_Error_Runtime [] {“uid”:“fd93c9d”,“method”:“GET”,“route”:"/dashboard/status",“userId”:1}

same error with mytest.view inside the authed.twig

please check my classes, in my response 10 minute ago

Perhaps you can create the example in the docs and we can work from there? Or you could add some additional logging in your Middleware to ensure it is being called.

Assuming you have it as you have pasted it above, the only reason the route would not be registered is if your Middleware is not being called. Try removing your try/catch from settings.php and see if you get a different error presented.

Removing the try/catch from settings it returns the same error.

What do you mean for docs? Google docs?

You can take a look to my project here: https://drive.google.com/a/overapp.it/file/d/0B5-ZJ40uD6sDSVlDbG5JY2tmaGs/view?usp=sharing

Thanks

Sorry, I don’t know what you mean.

The example I have provided for you in the manual (on GitHub) is working on my environment and another environment I have tested it on - baring the template loading issue, which I have already explained - and updated the doc accordingly.

You have taken that document and created something different, based on your own requirements - and it doesn’t work. I can’t help you with that.

Create what is in the docs and then add debugging to work out what is happening - I think it is clear how to do this?

Hi Dan,

Our requirement is very simple: add an entry in the left menu panel in the main dashboard. I don’t understand why you say we are creating something different… Could you please share with us your test project with a new working menu item named “test” and when pressed it shows a new page? We want to replicate the same behavior for the help/about page. That’s it.

Many Thanks,

Osvaldo

I’m really trying to help you :slight_smile: and have written the example in the manual specifically for you. Looking through the code you’ve posted it seems to me like you’ve changed the name of various bits and pieces of the example - which means it doesn’t work. At that point it becomes very difficult to help, because I don’t know what you have actually done.

I’ve asked a colleague (who has never done this before) go through the instructions, step by step to create the same as you are trying to create. The code worked without any issue, but as a result I have added some more detail to the article.

In an effort to make things easier for you i’ve uploaded this copy of the manual to the website.

Please create the files exactly as they are shown in the article: http://xibo.org.uk/manual-tempel/en/advanced_extending.html#examples

I have also added examples to the themes section of the manual: http://xibo.org.uk/manual-tempel/en/advanced_theme.html#examples

Once you’ve done that, you can ZIP it up and send me a link to download - and I will review what you’ve done (if it doesn’t work).

Hi Dan,

Thank you very much for your support.

Anyway, i replicated all steps of this example: http://xibo.org.uk/manual-tempel/en/advanced_extending.html#examples but it shows again this error:

[2016-08-10 14:41:07] WEB.ERROR: An exception has been thrown during the rendering of a template ("Named route not found for name: test.view") in "authed.twig" at line 119. Exception Type: Twig_Error_Runtime [] {"uid":"1dc5182","method":"GET","route":"/dashboard/status","userId":1}

I zipped my simple project, that contains the xibo-cms1.8 beta and the changes of your example -> https://drive.google.com/a/overapp.it/file/d/0B5-ZJ40uD6sDZDJYLWtYRVBEVTQ/view?usp=sharing

Can you take a look?

Thank you again :slight_smile:

I’ve requested access to the link you’ve provided. Thanks!

Ok, you can proceed :thumbsup:

I finally understand what is happening (the penny has dropped). There has been a bug fix to the Middleware implementation that is due to be released in 1.8.0-rc1. The bug was that Middleware was not being included correctly, which means that even though your code is absolutely correct, its not running.

The commit which fixes the bug is here: https://github.com/xibosignage/xibo-cms/commit/7d99b684e45e9b51b9242ab8d440f996380d5534

There aren’t any changes to composer requirements so you can actually download the develop repository on github - i think that was your starting point anyway?

Sorry I didn’t think of this sooner!

Ok Dan, now it’s work!

Thank you for support

1 Like

How can I add functionality to the new route . I’ve created a route but it doesn’t have a function .
I wanted it to have a CRUD.

You need to implement that functionality in your custom Controller - its a very broad question, so I don’t think we can help without specific details.

Please create a new topic for this as it is a new discussion.