1 2015-06-25 10:08:06 (edited by will 2015-12-07 08:14:45)

Topic: Re-routing/ mapping & frontend languages

http://www.mightyhaggis.com/public/uploads/forums/routing-monstra-forum.png


I haven't been able to dedicate as much time as i'd like so this has been a bit delayed.
Features include silent routing and redirects.

In the process I have created a simple javascript class that extends monstra for form checking. It uses required, regex and callback tags allowing you to do pretty much anything via extension but keeps it simple. Every other checkers I tried were to bloated, complicated and didn't allow easy l18n

Been a little delayed on this one but its nearly done so soon!




----------------


My latest plugin will require some core file changes which I will propose for Monstra, but for the time being I will have the plugin auto replace and backup the old ones, which I think is the best solution or would manually changing be better?

As I have been adjusting the Uri class I thought I'd make the site multi language aware as I have seen this requested in other posts. This means that urls like www.mysite.com/ru/blog will give the Russian version if you are using I18n. If using this feature you will need to adjust links to carry over the lang preference, I have created the function Site::langUrl that outputs if set and nothing if not so links can be easily changed e.g:
Site::url . DS . Site::langUrl . rest-of-path Note that a trailing slash will be automatically added if needed allowing for a none value.
The language preference is stored in a cookie, so will be active on next visit also.
Changing language is as simple as www.mysite.com/en (note that this is frontend only)

Re-routing/ mapping, will over-ride any command arg and redirect. i.e the first /arg after the url
You will be able to do things such as:
www.mysite.com/shortlink -> www.mysite.com/blog/1/any/other/args/you/like
www.mysite.com/news -> www.mysite.com/blog
This will allow you to maintain eternal links when you site structure changes and allow for short linking as well.

Hope that all sounds good. Let me know if anyone has suggestions as I progress.

will's Website

2 2015-06-25 12:25:53

Re: Re-routing/ mapping & frontend languages

will wrote:

Hope that all sounds good. Let me know if anyone has suggestions as I progress.

That is not good, its amazing!

(с) Roman Art
So far So good wink

RomanArt's Website

Re: Re-routing/ mapping & frontend languages

Updated 13th Oct

will's Website