Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] I18N - sidebar translation
#3
(2013-04-18, 04:01:45)Carlos Wrote: I think that you should use get_i18n_content instead of getPageContent, see here:
http://mvlcek.bplaced.net/get-simple/i18n:en/
in Language dependent Content -> Pages

As for the short text (Nejnovější články), see (same link above):
Language dependent Content -> Conditions

(I forgot) ...or you could use get_i18n_component and create two (almost identical) sidebar components, one for each language.

PS I don't understand why the News Manager Addons functions didn't work for you in component. They should (it's how I use them). BTW you should add a ; before the closing ?>
Thank you Carlos. I have already seen the page many times, however, I just didn't use that functions...

So the get_i18n_content solved my upper part of the sidebar Smile



However, there are still problems in the lower part.

How did you manage to get the component working with nested functions?

Look how I tried to do it. The second component is different because I wanted you to see both ways how I tried to include the functions inside of the component.
[Image: 2uq1yiu.png]
It just didn't work, the div on my site was empty like <div></div>.





I also tried with the same method as in the upper part of the sidebar, however, without success - the CKEditor always added <!-- --> around PHP tags; even editing .xml files didn't work for some reason (html entities I think).

In the template was
Code:
<div class="panelVypisClanku">
  <?php get_i18n_content('bocni-panel-nejnovejsi-clanky'); ?>          
</div>

After putting this code into a page's source code
Code:
<p><strong>Nejnovější články</strong></p>
    
    <?php nm_set_custom_maxposts(3) ?>
    <?php nm_set_custom_excerpt(250) ?>
    <?php nm_custom_display_recent('
      <div class="my_recent_post">
        <h4><a href="{{ post_link }}">{{ post_title }}</a></h4>
        <span class="my_excerpt_date">{{ post_date }}</span>
      <span class="my_excerpt">{{ post_excerpt }}</span>
    </div>
    '); ?>
and saving the page, it transformed into this
Code:
<p>
    <strong>Nejnovější články</strong></p>
<!--?php nm_set_custom_maxposts(3) ?--><!--?php nm_set_custom_excerpt(250) ?--><!--?php nm_custom_display_recent('
      <div class="my_recent_post"-->
<h4>
    <a href="{{ post_link }}">{{ post_title }}</a></h4>
<p>
    <span class="my_excerpt_date">{{ post_date }}</span> <span class="my_excerpt">{{ post_excerpt }}</span> '); ?&gt;</p>
which is useless Smile





I worked it out by using a condition in the lower part of the sidebar in my template. It works like a charm now, thanks for the tip. I don't think this bar needs to be editable as the upper one.
Code:
<div class="panel">    
  <?php get_i18n_content('rychly-kontakt'); ?>  
</div>

<div class="panelVypisClanku">
    <?php if ($language == 'cs') { ?><p><strong>Nejnovější články</strong></p><?php } ?>
    <?php if ($language == 'en') { ?><p><strong>Latest posts</strong></p><?php } ?>
    
    <?php nm_set_custom_maxposts(3) ?>
    
    <?php nm_set_custom_excerpt(250) ?>
      
    <?php nm_custom_display_recent('
      <div class="my_recent_post">
        <h4><a href="{{ post_link }}">{{ post_title }}</a></h4>
        <span class="my_excerpt_date">{{ post_date }}</span>
      <span class="my_excerpt">{{ post_excerpt }}</span>
    </div>
    '); ?>       
</div>




But there's still a bug in me head why it haven't worked with both the components and/or the pages... don't you know?


Either way, thanks a lot Carlos Smile you always know somehow.
And sorry for my extra-long post as usually.
Tomáš Janeček - Multilingual personal website powered by GetSimple
» The little I did for GetSimple
Reply


Messages In This Thread
[SOLVED] I18N - sidebar translation - by TeeJay - 2013-04-18, 03:45:59
RE: I18N - sidebar translation - by Carlos - 2013-04-18, 04:01:45
RE: I18N - sidebar translation - by TeeJay - 2013-04-18, 06:06:16
RE: I18N - sidebar translation - by Carlos - 2013-04-18, 06:27:29
RE: I18N - sidebar translation - by TeeJay - 2013-04-18, 07:11:24



Users browsing this thread: 1 Guest(s)