Jump to:

5540 Posts in 1738 Topics by 1224 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Virtual Page to a page in another language

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1169 Views
  • Futureal
    Avatar
    Community Member
    9 Posts

    Virtual Page to a page in another language Link to this post

    I have a two-language Silverstripe website, created with the multilangual functionality.

    One menu-item and all of its sub-items is only available in the original language.
    For the other language, I was thinking of creating a Virtual Page that linked to the menu-item in the original language, so that all the sub-pages would still show in the menu.
    In the dropdown of the virtual page I can however only choose from the pages in that particular language. Is there any way to get around this and create a virtual page that links to another language?

    Thanks in advance.

  • Futureal
    Avatar
    Community Member
    9 Posts

    Re: Virtual Page to a page in another language Link to this post

    Anyone?
    Or perhaps a way to realize the same goal?

  • Futureal
    Avatar
    Community Member
    9 Posts

    Re: Virtual Page to a page in another language Link to this post

    Can someone at least shed some light on this case and tell me whether it is (ever) possible or not?

  • Ironcheese
    Avatar
    Community Member
    33 Posts

    Re: Virtual Page to a page in another language Link to this post

    Hi there,

    i was (or still am) in the exact same position.
    My workaround so far is, to add custom DB fields for the pages. You have to kind of extend the TranslationGroupID functionality here.

    So what i did, was to add DB Fields which add holds a "MasterPageID" (the ID of the Page in your default language) and a simple Boolean Field which just holds the information if this page is linked to its MasterPage. (I managed that with a checkbox in the backend.)

    In the init() function of my page, i have a simple if statement which checks if this current page is linked to another page, if yes -> get the content of that page and replace it with the current page content.

    Not sure if this is a good way, but it works. xD

    1169 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.