Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2013-12-04 13:01:55

Gallex
Member
Registered: 2006-10-08
Posts: 914

display the page from other url

i have multilanguages (6) site. to make life easier, client wants to display this products section page under all other language product section pages as well. the navigation menu needs to stay unchanged – so it can’t just redirect the link (like i have done at the moment).
one solution, which came to my mind, is to use iframe in articles, but iframe will display the whole page, containing header and footer and so on… is there more, better solutions?

not the excellent explanation, but i hope you understood what i’m trying to do.

Last edited by Gallex (2013-12-04 13:28:46)

Offline

#2 2013-12-04 18:26:19

etc
Developer
Registered: 2010-11-11
Posts: 2,171
Website

Re: display the page from other url

Why wouldn’t you include <txp:article_custom section="products" /> instead of iframe on the concerned pages?


etc_[ query | search | pagination | date | tree | cache ]

Offline

#3 2013-12-05 08:45:56

Gallex
Member
Registered: 2006-10-08
Posts: 914

Re: display the page from other url

etc wrote:

Why wouldn’t you include <txp:article_custom section="products" /> instead of iframe on the concerned pages?

yes, this is a good solution till visitor goes to individual article (product) page…

Offline

#4 2013-12-05 10:08:34

etc
Developer
Registered: 2010-11-11
Posts: 2,171
Website

Re: display the page from other url

Huh, yeah… Well, you could use iframes, with a bit of js manipulation to detect if the page is iframed and hide headers/footers etc. But this means two requests by page.

If only the navigation menu is concerned, you can try to introduce some url lang parameter:

  • install etc_url;
  • create one menu form for every language: menu-en, menu-de, and so on;
  • detect which language is called: <txp:variable name="lang" value='<txp:etc_url type="lang" />' />;
  • display the corresponding menu: <txp:output_form form='menu-<txp:variable name="lang" />' />;
  • to transmit lang parameter to all links, replace <txp:permlink /> and such with <txp:etc_url url='<txp:permlink />' query='lang=<txp:variable name="lang" />' />

etc_[ query | search | pagination | date | tree | cache ]

Offline

#5 2013-12-05 11:08:30

Gallex
Member
Registered: 2006-10-08
Posts: 914

Re: display the page from other url

etc wrote:

If only the navigation menu is concerned, you can try to introduce some url lang parameter:

yes exactly, the navigation menu is the main concern. but i’m not sure i fully understand you…

  • install etc_url;
  • create one menu form for every language: menu-en, menu-de, and so on;

done

  • detect which language is called: <txp:variable name="lang" value='<txp:etc_url type="lang" />' />;
  • display the corresponding menu: <txp:output_form form='menu-<txp:variable name="lang" />' />;

i will put this two lines into page template? actually i have different page template for every language – does this make a difference? and how this language detection process will work exactly…?

  • to transmit lang parameter to all links, replace <txp:permlink /> and such with <txp:etc_url url='<txp:permlink />' query='lang=<txp:variable name="lang" />' />

i use <txp:permlink /> only in article forms. how i will replace them here:

<txp:if_article_list>
<txp:if_excerpt>
<h2><txp:permlink><txp:title /></txp:permlink></h2>
<txp:excerpt />
<p class="meta"><txp:permlink>Loe edasi &raquo; </txp:permlink></p>
<txp:else />
...

Last edited by Gallex (2013-12-05 11:09:05)

Offline

#6 2013-12-05 11:31:37

etc
Developer
Registered: 2010-11-11
Posts: 2,171
Website

Re: display the page from other url

i will put this two lines into page template? actually i have different page template for every language – does this make a difference? and how this language detection process will work exactly…?

I would create only one or two templates, /glavnaya/ isn’t any better than /home/?lang=ru (save seo…), but let it be as is for the moment. Include this in the English template, just to test. In menu-ru form you should add ?lang=ru to all links, like this: <a href="/products/?lang=ru">Продукты</a>. The lang parameter will be detected by etc_url and stored in <txp:variable name="lang" />.

Replace <txp:permlink><txp:title /></txp:permlink> in the appropriate article form by

<txp:if_variable name="lang" value="">
<txp:permlink><txp:title /></txp:permlink>
<txp:else />
<txp:etc_url url='<txp:permlink />' query='lang=<txp:variable name="lang" />'><txp:title /></txp:etc_url>
</txp:if_variable>

etc_[ query | search | pagination | date | tree | cache ]

Offline

#7 2013-12-05 12:40:22

Gallex
Member
Registered: 2006-10-08
Posts: 914

Re: display the page from other url

oleg, i don’t know, did i do all as needed, but it started to go wrong in many places :(
i can’t allow this, because this is a live site and has quite big frequency of attendance.

Would you like to try yourself? i could create an account for you

Offline

#8 2013-12-05 12:45:10

etc
Developer
Registered: 2010-11-11
Posts: 2,171
Website

Re: display the page from other url

Gallex wrote:

oleg, i don’t know, did i do all as needed, but it started to go wrong in many places :(
i can’t allow this, because this is a live site and has quite big frequency of attendance.

Would you like to try yourself? i could create an account for you

Sure you can, a designer account should suffice, but I won’t be back before 3 hours, sorry.


etc_[ query | search | pagination | date | tree | cache ]

Offline

#9 2013-12-05 15:58:41

etc
Developer
Registered: 2010-11-11
Posts: 2,171
Website

Re: display the page from other url

Done.


etc_[ query | search | pagination | date | tree | cache ]

Offline

Board footer

Powered by FluxBB