Coded something up in Couch in an interesting way? Have a snippet or shortcode to share? Post it here for the community to benefit.
49 posts Page 3 of 5
Hi I've got ultra strange problems.

1. On homepage everything is ok, I can change languages but on pages like info.php etc I've got error on language list:
Warning: Invalid argument supplied for foreach() in /couchdir/tags.php(2420) : eval()'d code on line 3

2.
I'm using if tag to change images besed on selected languages on homepage www.metod.pl but first rendering of specific languages gives me a ultra pixeleted images. I don't know why.

Please help
Hi,

Looks like the 'lang_getter.html' snippet (defining the acceptable languages) is not embedded properly in the problem templates. Please check and verify.
Hello,

first thanks for that awesome CMS - just finished my html5 version
and iam now into implementing Couch, also ill buy it - if everything is done.

My client wants to have a multilanguage side - so i decided to go
with the folder solution mysite/en/index.html

My question is, do i have to install Couch twiche ?
so one like myside/en/couch/ ?

Also when i would install like an "onepage editing" then i can simly
have one Couch CMS cause i edit direktly on the side ?

When i have onepage editing - i it just for edit, or can i post "new" stuff,
like a blog - so having a button that lets me add new conetnt.

Thanks alot!
Hello and welcome, Alphavader,
I am glad you liked Couch :)

so i decided to go
with the folder solution mysite/en/index.html

My question is, do i have to install Couch twiche ?
so one like myside/en/couch/ ?
No. Just once in the root. The 'en' and other languages will be the folders within the root.
Code: Select all
site_root
  |_couch (folder)
  |_en (folder)
  |   |_index.php
  |   |_about.php
  |   |_news.php
  |_fr (folder)
  |   |_index.php
  |   |_apropos.php
  |   |_nouvelle.php
  |_index.php
I've explained it more thoroughly in the original post of this thread - viewtopic.php?p=330#p330

When i have onepage editing - i it just for edit, or can i post "new" stuff,
like a blog - so having a button that lets me add new conetnt.
'Create', for now, has not been implemented I am afraid. We can just 'edit' from the frontend.
Hi,

I'm creating a multilanguage site wich now uses separate templates per language, but I want one template for the homepage that can be used for all index pages, but I can't get this to work.
Can you help?

Kind regards
Hi,

There can be multiple ways of doing this.

One that comes to mind is to use an index.php template in the root itself (in addition to the index.php templates you have in the respective language folders).

Define all editable regions in the root index.php so all data is contained in one folder.
Now in the inner index templates, display the data from the root like this -
Code: Select all
<cms:pages masterpage='index.php' limit='1'>
   ... all regions defined in root index template available here ..
</cms:pages>

This way the same data is displayed on all inner index templates.

Does this help?
It works like a charm! Thank you very much!
The "third" way of working is great and works fine for me!
I have a little question regarding the lang switcher.

I would like to have a switcher with only the language that is not selected in it.
So if you click on it, it changes to the other language.

Which modification should I make in the code to come to this?


EDIT:

After some logical thinking I found the solution myself. :-)
Just add following css rule to your code:

Code: Select all
.selected{
display:none;
}


Can't be easier.
@KK

I created all what u was saying but still I've got problem.

When I try to change lang url looks like that and it not working:
http://127.0.0.1/og/couch/switch.php?lang=de&redirect=%2Fog%2F

URL in config file http://127.0.0.1/og/

li element in menu has class 'selected' so it works yup but I've also
sth like that in my index page to display custom HTML based on lang
<cms:if my_lang='pl'><h1><span class="special">O</span> nas</h1></cms:if>
<cms:if my_lang='en'><h1><span class="special">A</span> bout us</h1></cms:if>
<cms:if my_lang='de'><h1><span class="special">ü</span> ber uns</h1></cms:if>


And nothing is displayed

EDIT: Also I've duplicated sites in CMS for each lang
Hi Adrian,

li element in menu has class 'selected' so it works
That shows that the language is getting set correctly by switch.php.

<cms:if my_lang='de'><h1><span class="special">ü</span> ber uns</h1></cms:if>
And nothing is displayed
That shows that the 'my_lang' variable is either not available or is not set to the correct values.

To troubleshoot, please make sure lang_getter.html snippet is properly embedded in the index page. Place a <cms:dump_all /> tag in index.php and verify that 'my_lang' is indeed present and with the right values.

Hope it helps.
49 posts Page 3 of 5