Internationalization breaks my navigation

Permalink
I'm using the auto-nav for my header menu. Since my site needs to be in multiple languages I was really excited about this new internationalization addon. But after folowing the video and structuring the sitemap to make use of this addon, now my navigation on all sites is broken.

By default the auto-nav uses to display the top levels. Example:
Before:
- page 1
- page 2
...

After:
- eng (for the english language)

I could change this simple by going into every singe auto-nav block, edit it and choose DisplayPage -> "second level"...but then I figured out that the default is "top level" and my since my clients will post blog posts those sites will always have the default "top level" active and therefore have a broken navigation...

If I could somehowe change the default value for "top" to be the second level I would solve the problem.

Does anybody now how to solve this? Please! It's quite urgent.

Agetis
 
boomgraphics replied on at Permalink Best Answer Reply
boomgraphics
Hello, a simple fix (for now) would be to change some code in the autonav.

Open form_setup_html.php and change this:
<strong><?php echo t('Display Pages')?></strong><br>
<select name="displayPages" onchange="toggleCustomPage(this.value);">
   <option value="top"<?php  if ($info['displayPages'] == 'top') { ?> selected<?php  } ?>><?php echo t('at the top level.')?></option>
   <option value="second_level"<?php  if ($info['displayPages'] == 'second_level') { ?> selected<?php  } ?>><?php echo t('at the second level.')?></option>
   <option value="third_level"<?php  if ($info['displayPages'] == 'third_level') { ?> selected<?php  } ?>><?php echo t('at the third level.')?></option>
   <option value="above"<?php  if ($info['displayPages'] == 'above') { ?> selected<?php  } ?>><?php echo t('at the level above.')?></option>
   <option value="current"<?php  if ($info['displayPages'] == 'current') { ?> selected<?php  } ?>><?php echo t('at the current level.')?></option>
   <option value="below"<?php  if ($info['displayPages'] == 'below') { ?> selected<?php  } ?>><?php echo t('At the level below.')?></option>
   <option value="custom"<?php  if ($info['displayPages'] == 'custom') { ?> selected<?php  } ?>><?php echo t('Beneath a particular page')?></option>
</select>


To this:
<strong><?php echo t('Display Pages')?></strong><br>
<select name="displayPages" onchange="toggleCustomPage(this.value);">
<option value="second_level"<?php  if ($info['displayPages'] == 'second_level') { ?> selected<?php  } ?>><?php echo t('at the second level.')?></option>
   <option value="top"<?php  if ($info['displayPages'] == 'top') { ?> selected<?php  } ?>><?php echo t('at the top level.')?></option>
   <option value="third_level"<?php  if ($info['displayPages'] == 'third_level') { ?> selected<?php  } ?>><?php echo t('at the third level.')?></option>
   <option value="above"<?php  if ($info['displayPages'] == 'above') { ?> selected<?php  } ?>><?php echo t('at the level above.')?></option>
   <option value="current"<?php  if ($info['displayPages'] == 'current') { ?> selected<?php  } ?>><?php echo t('at the current level.')?></option>
   <option value="below"<?php  if ($info['displayPages'] == 'below') { ?> selected<?php  } ?>><?php echo t('At the level below.')?></option>
   <option value="custom"<?php  if ($info['displayPages'] == 'custom') { ?> selected<?php  } ?>><?php echo t('Beneath a particular page')?></option>
</select>


That makes the default blocks settings go to second level instead of top level.

Hope that helps. :-)

PS: That's on lines 39-48 in the code.
Agetis replied on at Permalink Reply
Agetis
It did not resolve the problem totally.
Just by changing this file notwhing hapened. Event after Deleting the cache.
I did then uninstalled the Auto-nav addon, made the change to your suggested file and reinstall this new version of the Auto-nav. Then by adding the a new nav to the header the changes have been shown.

But still the problem isn't resolved, since by adding a totally new page to the site there is still the old navigation shown. Even though by editing the nav you now see under DisplayPage your changes in your form_setup_html.php file.

It's getting quite messy.

I see that after the upgrade to 5.4.2 also my blog breadcrumps don't render correctly - I now see the Home link, even though it is Excluded from the nav and it is also not showing up in the Preview panel.

aaa...messy, messy...
Agetis replied on at Permalink Reply
Agetis
Aaa, Solved! :)

@boomgraphics your suggestion did indeed help. The reason why it didn't work earlier is that I updated concrete to 5.4.2 and didn't now that I have to edit the files now in a new subdirectory:
updates/concrete5.4.2/concrete/blocks/form/

After an error I saw that there was this "secret" location and this hint made me solve it!

Thanks again man! :)
Judder replied on at Permalink Reply
Judder
You actually don't need to change any code.

All the changes in Boom! Graphics response is doing is making the 'at the second level' option the default rather than the 'at the top level'.

To have the same effect, just edit your Auto-Nav and set the Display Pages setting to be 'at the second level'

The reason that this works is that when you within a language tree, you are _always_ in a language branch so the 'second level' is always the top level of that language.

Good tip though and should help everyone else trying to do this (*PS concrete5 team - can't you add this tip to one of the videos or the demo site as I'm sure everyone using this hits the same problem?)