How to set "Back to Menu" link target? (admin pages)

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
skypanther

How to set "Back to Menu" link target? (admin pages)

Post by skypanther »

I'm working on the NMS module and have added some new functionality that involves a new template. At the moment, the "Back to Menu" link at the bottom of the admin page takes me back to the admin home page, not to the top page of the NMS module. How do I change that?

Tim
Dee
Power Poster
Power Poster
Posts: 1197
Joined: Sun Mar 19, 2006 8:46 pm

Re: How to set "Back to Menu" link target? (admin pages)

Post by Dee »

You cannot change the link directly. However, since scriptaculous/prototype is included in the admin by default you can do:

Code: Select all

<__script__ type="text/javascript">

Event.observe(window, 'load', function() {
	var elementList = document.getElementsByClassName("pageback");
	elementList[1].href = "moduleinterface.php?module=YourModule";
});

</__script>
Regards,
D
skypanther

Re: How to set "Back to Menu" link target? (admin pages)

Post by skypanther »

Thanks. I'm surprised this can't be set. It will probably be easier / better for me to add a link within my template back to the top of the NMS pages than to rely on JavaScript.

Thanks.
Tim
Post Reply

Return to “Developers Discussion”