Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1846 2011-08-23 18:04:41
- ploinkr
- Member

- From: Montreal
- Registered: 2007-12-06
- Posts: 83
Re: MLP - The Multi-Lingual Publishing Pack
I’m having a strange problem here with MLP that reoccurs from time to time: when I edit a previously published article, the language menu doesn’t always show the right language and seems to revert to the language that was used in the last published article.
For example, if I’ve edited an article in English and then try to edit the French version, the language menu is stuck on English – and saving the article like that by mistake will invariably mess everything up, requiring I clean up and then reactivate MLP.
Any idea of what could be the problem? Thanks.
Offline
#1847 2011-08-23 20:37:38
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: MLP - The Multi-Lingual Publishing Pack
Benoit, I can’t reproduce this. Can you describe which steps exactly you are taking? How do you access the first article (through the MLP tab, Renditions tab, or other), and from there how do you go to the second article (MLP, Renditions, Recent articles, back button, …)?
And by the ‘language menu’ you mean the one just above the Title field?
Offline
#1848 2011-08-23 23:11:13
- ploinkr
- Member

- From: Montreal
- Registered: 2007-12-06
- Posts: 83
Re: MLP - The Multi-Lingual Publishing Pack
Thanks Els; I usually just go to Content > Renditions to edit the articles (and don’t use the back button). And yes, I’m referring to the drop-down menu above the title.
I just noticed something though: I’m wondering if it’s not some strange cache issue as I’m trying it from home now and all’s working fine…
Offline
#1849 2011-08-25 13:21:29
Re: MLP - The Multi-Lingual Publishing Pack
For the first time I have to look into this plugin seriously and wanted to check that I have the correct versions installed. – Sorry – it confused me :(
I’ve got
txp:4.4.1
l10n · 4.3.0.12
Is that right?
Offline
#1850 2011-08-25 13:40:54
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Offline
#1851 2011-08-25 19:33:41
- YannigR
- New Member
- Registered: 2011-08-25
- Posts: 7
Re: MLP - The Multi-Lingual Publishing Pack
I am having problems with the main page of my website. This is a site that used to be working well when it was monolingual. The default language is English and when I access the main page it works (ie it access article 17. ) (see http://www.grafito-words.com or http://www.grafito-words.com/en) When it is another language (either through the url http://www.grafito-words.com/fr or accessing it with a French / Spanish browser) I don’t get the main content of my page. This is what output the main content:
<txp:if_individual_article>
<txp:article form ="static_article" />
<txp:else />
<txp:article id="17" form ="static_article" />
</txp:if_individual_article>
I thought that this was pretty standard but my google fu is not quite good enough to find somebody who had the same issue. I can see why this is problematic (id = “17” refers to an article in English) but i can’t think of a way to go round this. I suspect that I am missing something fairly obvious.
Any suggestion?
Offline
#1852 2011-08-25 19:35:59
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: MLP - The Multi-Lingual Publishing Pack
Yes, I think someone did this before. Give me a moment and I’ll try and find the post.
Offline
#1853 2011-08-25 19:45:17
Re: MLP - The Multi-Lingual Publishing Pack
You could use smd_query to get content from the l10n_txp_en_us table. You can even output the content using Textpattern’s article tags by using the populate="article" attribute in smd_query.
Trying to get English content from the textpattern table does not work.
Offline
#1854 2011-08-25 19:45:25
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: MLP - The Multi-Lingual Publishing Pack
Offline
#1855 2011-08-25 19:50:12
Re: MLP - The Multi-Lingual Publishing Pack
At a glance, it looks like the l10n_txp_en_us table uses the same article IDs as the textpattern table, so this might work:
<txp:smd_query
populate="article"
column="*,
unix_timestamp(Posted) as uPosted,
unix_timestamp(LastMod) as uLastMod,
unix_timestamp(Expires) as uExpires"
table="l10n_txp_en_us"
where="ID = '17'"><txp:output_form form="static_article"/></txp:smd_query>
Edit: Removed limit attribute from the smd_query tag, since you should have only one match. I copied it rather hastily from my own implementation, which was an article list.
Last edited by johnstephens (2011-08-25 19:55:42)
Offline
#1856 2011-08-25 19:50:56
- YannigR
- New Member
- Registered: 2011-08-25
- Posts: 7
Re: MLP - The Multi-Lingual Publishing Pack
That is an impressively quick reply, thank you!
I am going to look into it and will let you know how I get on.
Offline
#1857 2011-08-25 19:53:03
Re: MLP - The Multi-Lingual Publishing Pack
I just saw the code Els posted, and it reminded me of a proviso: The table you query depends on what regional variation of English you’re using as the default. I’m in the US, so mine is l10n_txp_en_us, but yours might be l10n_txp_en_gb or something else. Hope this helps!
Offline
#1858 2011-08-25 19:57:37
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: MLP - The Multi-Lingual Publishing Pack
John, now that I see your code again, I have a question for you. Why is this part needed:
unix_timestamp(Posted) as uPosted,
unix_timestamp(LastMod) as uLastMod,
unix_timestamp(Expires) as uExpires"
All the times I have used smd_query I’ve never added this. What does it do?
Offline
#1859 2011-08-25 20:04:42
Re: MLP - The Multi-Lingual Publishing Pack
I think it’s a vestige of using smd_query to query the textpattern table, and I guess it might not be needed when querying the l10n_lang tables— but it doesn’t seem to hurt. If memory serves, querying the textpattern table without those items causes problems, accompanied by error messages when looking at the site in debug mode.
Offline
#1860 2011-08-25 20:08:00
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: MLP - The Multi-Lingual Publishing Pack
Thank you, John. That might explain why I’ve never needed it, I realise now that I only use the plugin to query the l10n_lang tables.
Offline