Jump to content

Multilanguage static links to CMS pages


Recommended Posts

Hello,

Today I came across a fairly trivial problem. Suppose we have a few language in the store and we want to make a static menu, where you will find links to pages in the CMS - we have seo url enabled and we want have this in few languages.

Is there any easy way to display the friendly multi-lingual links giving only a simple code and id of cms page?

We have getCMSLink() method, but what do you do when you do not know the alias (required in this method)?

I have not found any simple solutions and...

I made ​​it up like this:

1. I created a class CMS in override/classes/ that extends the basic functionality of CMS.
2. I put the query there wich only get the alias of url by cms page id.
3. I register the new Smarty function call cmsRewriteLinks, it looks now like this:

{$link->getCMSLink(3, {cmsRewriteLinks id_cms=3})}



Depending on the language gives me the url to the page in the CMS.

For eg.

http://shop.com/en/content/3-terms-and-conditions-of-use

and for french:

http://shop.com/fr/content/3-conditions-generales-de-ventes

Is it not necessary and is an easier way?

  • Like 1
Link to comment
Share on other sites

  • 5 months later...
  • 2 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...