Problems, need help? Have a tip or advice? Post it here.
6 posts Page 1 of 1
Hello, I’ve a folder problem.

I got a multi lingual site. Here the structure:

index.php
partners.php
de/partner_de.php
eng/partner_eng.php

I set up a clonable partner page with dynamic folders (partners.php) were texts in both languages are added. Each partner belongs to a category which is handled by the folders.

Each partner page(_de, _eng) gets the data from partners.php (via cms:pages masterpage ....) which works out very well. But when I add a drop down menu which should list the categories and link to the specific folders I get a problem.

All k_folder_links pointing to partners.php but this page does not have language setting as it is planned only to provide the data for the several partner sites in different languages. Is it possible to output the folders one a separate page like it is done for the search form? Or is it possible to hand over the variable for the language?

Thanks again
Hey cl,

I'm pretty new to Couch but have a fair bit of experience with Wordpress and Expression Engine - using them there is either a plugin or you use multiple content fields in one page and set the language (field) to display accordingly to the visitors preference.

Not sure I am completely understanding your situation, I don't think "Folders" will work in the way you want - KK will jump in at anytime I am sure.

I think if you could add additional fields to "dynamic folders" or perhaps specify this in hardcoded (i hate hardcoded solutions - unless completely nessessary) you could tap into "http://www.couchcms.com/docs/tags-reference/set_cookie.html" to detect / and / or set a language, i.e. you could add multiple fields to a folder rather than the stock dynamic ones to enter repeatable languages and set a "name" or ID to them that the cookie could hook into?
Hi cl,

As Patrick said, it's a little difficult to understand your situation going by the description alone.

Could you please paste in some of the code that you are using? I mean, what is the folder structure like, how do you display only the 'eng' field in eng/partner_eng.php etc.

Basically give us some thing more concrete to understand the structure of your site so we can try to find a solution in accordance to it.

Thanks.
Hello, and thank you for your answers. Here is the link of the page:
http://apartment-vie.net/eng/partner.php

As you can see, there is a search field which is working fine. Now I would like to ad a dropdown menu below, were the user can select the partners by country and this menu should only show the available countries. I thought it would be a good idea to implement that by putting the partners into folders which can be created dynamically.

Code: Select all
<div id="catmenu">
<ul>
    <li >
        <a href="#">Select a country</a>
        <ul>
          <cms:folders masterpage="partnerapartments.php">
          <li class="submenu"><a href="<cms:show k_folder_link/>"><cms:show k_folder_title/></a></li>
          </cms:folders>
        </ul>
      </li>
     </ul>
</div>


Clearly this looks like the wrong way, because the folderlinks pointing to partnerapartments.php. I search for an option to output the folders directly at the partner page or at a separate page like I have for the search form.

The data from partnerapartments.php which is the cloneable page, and provides the text in booth languages, is selected by a variable <cms:if mylang="eng"> or <cms:if mylang="de"> , like described here http://www.couchcms.com/forum/viewtopic.php?f=8&t=74.

Sorry for my questioning, I'm more a designer than a programmer and often get stuck on things which might be easy.
OK, I get it now cl.

One way, I think, could be the following -
Stick to your plan of creating folders in 'partnerapartments.php'.
In 'eng/partner.php' and 'de/partner.php', list the folders as you planned. However, now instead of using <cms:show k_folder_link/> (which will lead to 'partnerapartments.php'), use the link of the current page (i.e. either 'eng/partner.php' or 'de/partner.php') and stick to the link a querystring parameter named 'country' with the value of the selected folder. e.g.
Code: Select all
<cms:folders masterpage="partnerapartments.php">
    <li class="submenu"><a href="<cms:show k_page_link />?country=<cms:show k_folder_name />" ><cms:show k_folder_title/></a></li>
</cms:folders>

Selecting a folder now will lead back to the same page but with the folder name now available as a GET parameter.
Get this using cms:gpc tag and then use it with the cms:pages tag you are currently deploying to list the pages e.g. the highlited parts below are the changes required
<cms:set country="<cms:gpc 'country' method='get' />" />
<cms:pages masterpage="partnerapartments.php" folder=country >
... your existing code with no change ...
</cms:pages>

I haven't tested out the code but I think it should work.
Please try it out and let me know. Thanks.
hi Kamran, you are by far the best :) - its working great
6 posts Page 1 of 1