From: Jean-Marc L. <jea...@gm...> - 2009-12-25 02:12:28
|
On Thu, Dec 24, 2009 at 5:47 PM, Desilets, Alain <Ala...@nr...> wrote: > Say you are at a page called ParentPage, which is written in say, Spanish. > There is question-mark link on it that points to a yet to be created page > called ChildPage. > > When you click on that link, I would like the language of ChildPage to > default to the language of ParentPage (i.e., Spanish in this case). In 99% > of the cases, that would probably be what the user wants, but he could > change that afterwards. This makes a lot of sense. > In order to do this, I have to: > > a) Be able to tell that ChildPage was created by clicking on a question mark > link > b) Be able to tell what was the parent page where this link was clicked on. Hmm, more to the point, you would need to know what the default language is supposed to be when a new page is created. That's all you intend to derive from the data from your a) and b), isn't it ? > How would I do this? > > I printed the content of $_REQUEST when I create a page through a > question-mark link, and all it contains is the name of the new page. No > additional info on the parent page. > > So, I guess I would have to modify the WikiSyntax parser so that when it > creates a question mark link, it adds a CGI argument parentPage or > something. Is there a simpler way, is that the way to go? I haven't looked at the code but it would seem that a simpler way would be to add an argument which would have the default language value as a parameter in the question mark link. That is all you need in the page to create, and this info is available in the page containing the question mark. Jyhem |