Babel: Menu not showing

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
solodok
New Member
New Member
Posts: 9
Joined: Tue Dec 14, 2010 2:17 pm

Re: Babel: Menu not showing

Post by solodok »

Talked to plger (admin of project), he is planning to update module soon, great news! :)

Mr. Dude: What redirection method you are using? I have problems with hierarchy method, never tried second one with assigning..
User avatar
M@rtijn
Power Poster
Power Poster
Posts: 706
Joined: Sat Nov 14, 2009 4:54 pm
Location: the Netherlands

Re: Babel: Menu not showing

Post by M@rtijn »

Since the content for my website is not the same in both languages, i use the "Marcos Cruz's definition solution"

First line of my page template is

Code: Select all

{content block='languages' label='Other Languages' oneline='true' assign=other_languages wysiwyg='false'}
which gives me an extra content block when creating or editing a page. There you have to specify the url of the page in the other language. The user-redirection is the same for this method as the hierarchy solution (with the auto-redirect settings in babel).
I do not have '{babel action="assign"}' in the page-template, only the call above.

Awesome news by the way that Pierré is updating this module again!  8)
Last edited by Anonymous on Tue Dec 21, 2010 2:40 pm, edited 1 time in total.
Make your community a better place!
User avatar
plger
Forum Members
Forum Members
Posts: 196
Joined: Wed Oct 15, 2008 10:38 am

Re: Babel: Menu not showing

Post by plger »

solodok wrote: Talked to plger (admin of project), he is planning to update module soon, great news! :)
I've made changes to Babel so that it supports cmsms' newer versions. Before I release it, however, I would like to test it a bit more. Anybody interested in testing it in the next few days can download it from the SVN or at www.plger.net/babel-0.4.zip

Plger
User avatar
M@rtijn
Power Poster
Power Poster
Posts: 706
Joined: Sat Nov 14, 2009 4:54 pm
Location: the Netherlands

Re: Babel: Menu not showing

Post by M@rtijn »

Dr.CSS wrote: I find it best to keep block names as one word then use label='Which lets You add all kinds of info to it'...
You're totally right!
I copied this from my sandbox whilst not really paying attention to the exact call. On my main website it uses a label.
Having spaces in the block name can indeed cause problems on some installations (I have experienced it with a block with 'extra keywords', which wasn't working, where 'keywords' did work)

I've edited the post! Thanks for your correction!
Make your community a better place!
User avatar
M@rtijn
Power Poster
Power Poster
Posts: 706
Joined: Sat Nov 14, 2009 4:54 pm
Location: the Netherlands

Re: Babel: Menu not showing

Post by M@rtijn »

plger wrote: I've made changes to Babel so that it supports cmsms' newer versions. Before I release it, however, I would like to test it a bit more. Anybody interested in testing it in the next few days can download it from the SVN or at http://www.plger.net/babel-0.4.zip

Plger
Pierre,

I've installed your update to test it and have some bad news...  ::)

On my (sandbox)install the update causes problems. I'm using the Marco Cruz direction method, so when adding a page which has a 'brother', the other language is specified in a block with either 'en_GB=enhome' or 'nl_NL=home'. Works like a charm when you do not have the same page tree for both languages. Or actually, was working like a charm  ;D

I have a custom template which looks like this:

Code: Select all

   <div id="lang">
{foreach from=$languages item="language"}
{if $language->is_current}
      <img src="http://img.website.tld/{$language->name}.png" class="flag" height="17" width="24" title="{$language->name}" alt="{$language->name}"/>
{else}
      <a href="{$language->url}"><img src="http://img.website.tld/{$language->name}.png" class="flag" height="17" width="24" title="{$language->name}" alt="{$language->name}"/></a>
{/if}
{/foreach}
   </div>
HTML output on the English (marked as default language) part of the website is:

Code: Select all

   <div id="lang">
      <a href="http://www.website.tld/nl/home"><img src="http://img.website.tld/Nederlands.png" class="flag" height="17" width="24" title="Nederlands" alt="Nederlands"/></a>
      <img src="http://img.website.tld/English.png" class="flag" height="17" width="24" title="English" alt="English"/>
   </div>
All is well, but...

... when I go to the Dutch page, the HTML output is:

Code: Select all

   <div id="lang">
      <img src="http://img.website.tld/English.png" class="flag" height="17" width="24" title="English" alt="English"/>

   </div>
Notice that there is no image for the current page and the link around the image to the English part is gone.
The html output for that Dutch page should be:
<div id="lang">
<img src="http://img.website.tld/Nederlands.png" class="flag" height="17" width="24" title="Nederlands" alt="Nederlands"/>
<a href="http://www.website.tld/en"><img src="http://img.website.tld/English.png" class="flag" height="17" width="24" title="English" alt="English"/></a>
</div>
When I set the default language in Babel to Dutch, those pages are working perfect and the links to the English pages are screwed.

It seams that fixing the problems for the hierarchy method is now killing the marco cruz method.

Does this give you enough information to find the bug? If you need anything, let me know!
Make your community a better place!
Freight
New Member
New Member
Posts: 9
Joined: Fri Sep 01, 2006 9:37 am

$page_lang not set correct

Post by Freight »

plger wrote: Anybody interested in testing it in the next few days can download it from the SVN or at www.plger.net/babel-0.4.zip
Thanks for the update. Babel is very useful!

However there is a problem: After upgrading to 0.4 the $page_lang-Variable is not set correct any more. It always shows the default language.

any ideas?

Thanks a lot!
Freight
New Member
New Member
Posts: 9
Joined: Fri Sep 01, 2006 9:37 am

Re: $page_lang not set correct

Post by Freight »

Freight wrote: After upgrading to 0.4 the $page_lang-Variable is not set correct any more.
I have found the problem.
// I just don't know why, but between 1.8.x and 1.9 hierarchy levels just dropped of 1...
I am using CMSms 1.9.2 and it seems, that the hierarchy levels are not dropped.

So in babel.module.php:604 of version 0.4 I changed from

Code: Select all

while( isset($currentNode) && $currentNode->getLevel() > ($post19?-1:0) ){
back to

Code: Select all

while( isset($currentNode) && $currentNode->getLevel() > 0 ){
And all is fine :-)
User avatar
M@rtijn
Power Poster
Power Poster
Posts: 706
Joined: Sat Nov 14, 2009 4:54 pm
Location: the Netherlands

Re: Babel: Menu not showing

Post by M@rtijn »

Freight,

Awesome! That also solved my problem!

Thank you for thinking with Pierre!
Make your community a better place!
solodok
New Member
New Member
Posts: 9
Joined: Tue Dec 14, 2010 2:17 pm

Re: Babel: Menu not showing

Post by solodok »

Freight, big thanks, also helped me.

But i found another one bug:
I have more than 10 sub categories in both languages,
and when I'm on 1.2.1 page, second language link is pointed to 2.2.10 not to 2.2.1.
And it is in both ways (2.2.10.x = 1.2.1.x in second language)
Maybe there is solution for such situation? 8)
Using CMSMS 1.9.2.
Updated Babel 0.4 + Freight fix
URL - http://gira.e-move.lv
Thank you :)
User avatar
plger
Forum Members
Forum Members
Posts: 196
Joined: Wed Oct 15, 2008 10:38 am

Re: Babel: Menu not showing

Post by plger »

solodok: just to make sure (I'm quite sure I know the problem), I suppose you're using the unofficial version linked above?
solodok
New Member
New Member
Posts: 9
Joined: Tue Dec 14, 2010 2:17 pm

Re: Babel: Menu not showing

Post by solodok »

plger: Yes, you're right!
Downloaded from www.plger.net/babel-0.4.zip
User avatar
plger
Forum Members
Forum Members
Posts: 196
Joined: Wed Oct 15, 2008 10:38 am

Re: Babel: Menu not showing

Post by plger »

I've updated the SVN and the www.plger.net/babel-0.4.zip file. You're invited to test it. I'll release as soon as it has been tested enough...
Plger
solodok
New Member
New Member
Posts: 9
Joined: Tue Dec 14, 2010 2:17 pm

Re: Babel: Menu not showing

Post by solodok »

Thanks, problem now is solved! :)

But returned old one (that one that was solved by Freight).. English is showing as actual language in both versions.
User avatar
plger
Forum Members
Forum Members
Posts: 196
Joined: Wed Oct 15, 2008 10:38 am

Re: Babel: Menu not showing

Post by plger »

I think the version just released in the forge should solve both problems.
solodok
New Member
New Member
Posts: 9
Joined: Tue Dec 14, 2010 2:17 pm

Re: Babel: Menu not showing

Post by solodok »

Plger: Thank you! :) Updated, now it works fine! ;)
Post Reply

Return to “Modules/Add-Ons”