(2013-04-18, 04:01:45)Carlos Wrote: I think that you should use get_i18n_content instead of getPageContent, see here:Thank you Carlos. I have already seen the page many times, however, I just didn't use that functions...
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 ?>
So the get_i18n_content solved my upper part of the sidebar
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.
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>
'); ?>
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> '); ?></p>
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 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
» The little I did for GetSimple