Amit Kumar Mishra Posted October 31, 2018 Report Posted October 31, 2018 hi developers i was working on something for blesta, at present you may call it a plugin where i get stuck is if i keep can setup two routes say, in // Route all except the following to the CMS plugin (if the plugin exists) if (file_exists(PLUGINDIR . 'cms')) { Router::route('^(?!' . $admin_loc . '|api|callback|cron|404|uploads|' . $client_loc . '|install|order|plugin|widget)', '/cms/main/index/$1'); } the functionalities of my plugin dont serve the pages now if i put my plugindir . 'mydir' the plugin i am coding is working, but the blesta's own cms portal is not working what i aim to achieve is the cms (portal plugin to work) and along with it, my plugin to serve a few pages, either static or dynamic so, i am stuck with how to get both the things to work? any help from any developers would be highly appreciated thanks Quote
Blesta Addons Posted November 6, 2018 Report Posted November 6, 2018 the sample way is to configure your custom page with a prefix like /pages/ then add this prefix to the excluded routes then your plugin will handle your pages w sample for your route sould be like this // Route all except the following to the CMS plugin (if the plugin exists) if (file_exists(PLUGINDIR . 'cms')) { Router::route('^(?!' . $admin_loc . '|api|callback|cron|404|uploads|' . $client_loc . '|install|order|plugin|widget|pages)', '/cms/main/index/$1'); } Router::route('^pages/(.*)$', '/your-plugin/main/index/$1'); Notes all your plugin links should be begin with the prefix, like /pages/my-custom-page /pages/my-custom-page-2 /pages/another-my-custom-page Quote
Amit Kumar Mishra Posted November 6, 2018 Author Report Posted November 6, 2018 humm so far, so good at least one help.. i will do this and test it ASAP, and update you here, in case there is some issue, and in case i require a bit more guidance Quote
Blesta Addons Posted November 7, 2018 Report Posted November 7, 2018 On 11/6/2018 at 8:48 PM, Amit Kumar Mishra said: humm so far, so good at least one help.. i will do this and test it ASAP, and update you here, in case there is some issue, and in case i require a bit more guidance you are welcome. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.