Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1816 2011-06-09 18:55:48

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 1,000
Website

Re: MLP - The Multi-Lingual Publishing Pack

populate="article" normally allows you to use TXP’s article tags, and it is working on in the English view. I’ll check out the other table.

Offline

#1817 2011-06-09 19:01:30

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: MLP - The Multi-Lingual Publishing Pack

johnstephens wrote:

populate="article" normally allows you to use TXP’s article tags

Ah sorry, didn’t know that – who reads Stef’s entire plugin documentation anyway… ;)

Offline

#1818 2011-06-09 19:10:35

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: MLP - The Multi-Lingual Publishing Pack

John, it works for me if I remove the populate="article" and replace the article tags with the {Title} ‘tags’.

Offline

#1819 2011-06-09 19:21:16

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 1,000
Website

Re: MLP - The Multi-Lingual Publishing Pack

Thanks! Hmmm— I’m not sure how to deal with the permlinks (wrapping the Title), rss_auto_excerpt, and if_last_article functionality without support for TXP tags.

Offline

#1820 2011-06-09 19:33:15

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: MLP - The Multi-Lingual Publishing Pack

Hmm… you’ve got a point. I’ve been doing permlinks like here, but I can’t think of a solution for the other tags right now. I will think about it some more, but maybe you can ask Stef in the smd_query thread, if there is a way to do it, he’ll know.

Offline

#1821 2011-06-09 19:43:37

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: MLP - The Multi-Lingual Publishing Pack

rvm_substr: <txp:rvm_substr>{Excerpt}</txp:rvm_substr>, though it’s not as sophisticated as rss_auto_excerpt.
And maybe it’s possible to replace the if_last_article with something outside the smd_query tags?

Last edited by els (2011-06-09 19:44:13)

Offline

#1822 2011-06-20 16:42:24

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 1,000
Website

Re: MLP - The Multi-Lingual Publishing Pack

Thanks again, Els! I finally got a chance to test this with rvm_substr, and I’m having the same problem. The smd_query output displays flawlessly when viewing the English site, but there is no output when viewing the Spanish site.

Here is the code I’m using in the template that displays the site’s homepage:

<txp:smd_query
	column="*,
	     unix_timestamp(Posted) as uPosted,
	     unix_timestamp(LastMod) as uLastMod,
	     unix_timestamp(Expires) as uExpires"
	table="textpattern"
	where="section = 'my-blog-section' AND l10n_lang = 'en-us'"
	limit="3"><article class="hentry">
<h1 class="entry-title"><a href="<txp:site_url/>en/{Section}/{ID}/{url_title}" rel="bookmark">{Title}</a></h1>
<div class="entry-summary"><txp:variable name="has_excerpt">{Excerpt}</txp:variable>
<txp:if_variable name="has_excerpt" value=""><txp:rvm_substr length="130">{Body_html}</txp:rvm_substr><txp:else/><txp:rvm_substr length="130">{Excerpt}</txp:rvm_substr></txp:if_variable>
<p><a href="<txp:site_url/>en/{Section}/{ID}/{url_title}" rel="bookmark">##read_more##</a></p>
</div> <!-- EO .entry-summary -->
</article>
<hr/>
</txp:smd_query>
<h2><txp:section link="1" name="my-blog-section" title="1"/>&#160;&#187;</h2>

Here is what I have in the tag-trace of the Spanish section:

<txp:smd_query
column="*,
     unix_timestamp(Posted) as uPosted,
     unix_timestamp(LastMod) as uLastMod,
     unix_timestamp(Expires) as uExpires"
table="textpattern"
where="section = 'my-blog-section' AND l10n_lang = 'en-us'"
limit="3">
	[<txp:smd_query
column="*,
     unix_timestamp(Posted) as uPosted,
     unix_timestamp(LastMod) as uLastMod,
     unix_timestamp(Expires) as uExpires"
table="textpattern"
where="section = 'my-blog-section' AND l10n_lang = 'en-us'"
limit="3">: false]
	[SQL (0.000877141952515): select *,
     unix_timestamp(Posted) as uPosted,
     unix_timestamp(LastMod) as uLastMod,
     unix_timestamp(Expires) as uExpires from l10n_txp_es_es where section = 'my-blog-section' AND l10n_lang = 'en-us']
	[<txp:smd_query
column="*,
     unix_timestamp(Posted) as uPosted,
     unix_timestamp(LastMod) as uLastMod,
     unix_timestamp(Expires) as uExpires"
table="textpattern"
where="section = 'my-blog-section' AND l10n_lang = 'en-us'"
limit="3">: true]
	[<txp:smd_query
column="*,
     unix_timestamp(Posted) as uPosted,
     unix_timestamp(LastMod) as uLastMod,
     unix_timestamp(Expires) as uExpires"
table="textpattern"
where="section = 'my-blog-section' AND l10n_lang = 'en-us'"
limit="3">: false]
</txp:smd_query>
<txp:smd_query
column="*,
     unix_timestamp(Posted) as uPosted,
     unix_timestamp(LastMod) as uLastMod,
     unix_timestamp(Expires) as uExpires"
table="textpattern"
where="section = 'my-blog-section' AND l10n_lang = 'en-us'"
limit="3">
	[<txp:smd_query
column="*,
     unix_timestamp(Posted) as uPosted,
     unix_timestamp(LastMod) as uLastMod,
     unix_timestamp(Expires) as uExpires"
table="textpattern"
where="section = 'my-blog-section' AND l10n_lang = 'en-us'"
limit="3">: false]
	[SQL (0.00080394744873): select *,
     unix_timestamp(Posted) as uPosted,
     unix_timestamp(LastMod) as uLastMod,
     unix_timestamp(Expires) as uExpires from l10n_txp_es_es where section = 'my-blog-section' AND l10n_lang = 'en-us']
	[<txp:smd_query
column="*,
     unix_timestamp(Posted) as uPosted,
     unix_timestamp(LastMod) as uLastMod,
     unix_timestamp(Expires) as uExpires"
table="textpattern"
where="section = 'my-blog-section' AND l10n_lang = 'en-us'"
limit="3">: true]
	[<txp:smd_query
column="*,
     unix_timestamp(Posted) as uPosted,
     unix_timestamp(LastMod) as uLastMod,
     unix_timestamp(Expires) as uExpires"
table="textpattern"
where="section = 'my-blog-section' AND l10n_lang = 'en-us'"
limit="3">: false]
</txp:smd_query>

I can’t tell what’s going wrong. Should I report this on the smd_query thread instead, or is there something obvious that I’m doing wrong? It seems odd that the output displays as expected on the English homepage and not on the Spanish homepage.

Thank you!

Offline

#1823 2011-06-20 16:54:25

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 1,000
Website

Re: MLP - The Multi-Lingual Publishing Pack

A separate question: Before I upgrade this project to TXP 4.4.1, I want to make sure it’s safe. According to the changelogs, the txplib_db.php file that must be patched for MLP to work hasn’t been updated since Sept 2010. I don’t see any reports of MLP upgrade problems in the 4.4.1 feedback thread, so I take it that it’s clear as long as I use the latest MLP version of txplib_db.php. Is that correct?

Thank you!

Offline

#1824 2011-06-20 17:02:56

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: MLP - The Multi-Lingual Publishing Pack

johnstephens wrote:

I don’t see any reports of MLP upgrade problems in the 4.4.1 feedback thread, so I take it that it’s clear as long as I use the latest MLP version of txplib_db.php. Is that correct?

That is correct. (I only upgraded to the RC, but I assume 4.4.1 will be the same.) I’ll have a look at your other post later this evening.

Last edited by els (2011-06-20 17:03:52)

Offline

#1825 2011-06-20 20:33:33

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: MLP - The Multi-Lingual Publishing Pack

John, this simple example works for me:

<ul>
<txp:smd_query
	column="Title"
	table="l10n_txp_en_gb"
	where="section='my-section'"
	limit="3"><li>{Title}</li>
</txp:smd_query>
</ul>

Maybe you can strip your attributes and/or tags one by one and see where it starts working.

Edit: if I change that to

<ul>
<txp:smd_query
	column="Title"
	table="textpattern"
	where="section='my-section' AND l10n_lang='en-gb'"
	limit="3"><li>{Title}</li>
</txp:smd_query>
</ul>

it stops working! So start with changing

	table="textpattern"
	where="section = 'my-blog-section' AND l10n_lang = 'en-us'"

to

	table="l10n_txp_en_us"
	where="section = 'my-blog-section'"

Last edited by els (2011-06-20 20:40:25)

Offline

#1826 2011-06-21 15:43:43

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 1,000
Website

Re: MLP - The Multi-Lingual Publishing Pack

Thank you, Els! This works for me. I’ll try re-adding the populate="article" to see if that works with this configuration.

Offline

#1827 2011-07-04 10:02:23

michaelb
Member
From: London, UK
Registered: 2008-04-02
Posts: 21

Re: MLP - The Multi-Lingual Publishing Pack

Hi, I have recently upgraded to Txp 4.4.0 & MLP 4.3.0.12.

As far as I know I followed the upgrade procedures exactly, but now:

  1. When I go to the Renditions tab, I get as string of messages concerning the txp_section table such as:

Warning: Unknown column ‘l10n_title_en_gb’ in ‘field list’ select `l10n_title_en_gb` as `title` from txp_section where name=‘attributes-of-mastery’ in /home/eeiwor01/public_html/textpattern/lib/txplib_db.php on line 113

Warning: Unknown column ‘l10n_title_en_gb’ in ‘field list’ select `l10n_title_en_gb` as `title` from txp_section where name=‘copyrights-disclaimers’ in /home/eeiwor01/public_html/textpattern/lib/txplib_db.php on line 113

.
.
.

etc.

  1. When I go to the Write tab, or edit a rendition it’s a similar couple of errors but this time for the txp_category table:

Warning: Unknown column ‘l10n_title_en_gb’ in ‘field list’ select id, name, lft, rgt, parent, `l10n_title_en_gb` as `title` from txp_category where lft between 1 and 2 and type = ‘article’ and name != ‘root’ and 1=1 order by lft asc in /home/eeiwor01/public_html/textpattern/lib/txplib_db.php on line 113

Warning: Unknown column ‘l10n_title_en_gb’ in ‘field list’ select id, name, lft, rgt, parent, `l10n_title_en_gb` as `title` from txp_category where lft between 1 and 2 and type = ‘article’ and name != ‘root’ and 1=1 order by lft asc in /home/eeiwor01/public_html/textpattern/lib/txplib_db.php on line 113

I then took a look at the txp_section and txp_category tables, and they have a l10n_title_en_us column, not a l10n_title_en_gb column. I think is what I’d expect – the l10n_title_en_us – as en-us is set up as the default language.

Anyway, any help to know how to fix this would be appreciated!

Offline

#1828 2011-07-04 13:44:22

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 1,000
Website

Re: MLP - The Multi-Lingual Publishing Pack

@michaelb, It sounds like you replaced the MLP-modified txplib_db.php with the file in the TXP upgrade package. In non-MLP Textpattern installations, that’s exactly what you should do when you upgrade. However, MLP needs to use a patched version of the file in order to function. In order to get MLP working just revert that file to its pre-upgrade version— if you don’t have it, you can find it in the latest MLP download package. I hope this helps!

Offline

#1829 2011-07-04 14:02:17

michaelb
Member
From: London, UK
Registered: 2008-04-02
Posts: 21

Re: MLP - The Multi-Lingual Publishing Pack

Hi John – thanks very much for the advice.

However, the txplib_db.php file I am using is from the \mlp-4.3.0.12\textpattern\lib\ folder that I downloaded for the latest version of MLP. I reuploaded it just to be sure, and still get the same errors.

Something I find odd is that the error message mentions …en_gb…, but we are using en_us as our default language, so I’m not sure where MLP is picking that up from.

Offline

#1830 2011-07-28 10:25:26

datorhaexa
Member
From: Düsseldorf, Germany
Registered: 2005-05-23
Posts: 115
Website

Re: MLP - The Multi-Lingual Publishing Pack

I posted a question at the rah_sitemap plugin thread and will shove it here once again, because it’s relevant (I think).

Did anyone manage to get rah_sitemap working with MLP? I got the URL re-writes configuration right but now I get a sitemap of only the default language and the second one is simply ignored.

Offline

Board footer

Powered by FluxBB