Here is the code:
en/products.php
en/products-folder.php
I have create another "cn" folder which consist exact same files with "en" folder, cn/products.php, cn/products-folder.php.
I know I can do relation between pages, but I got so many products ( > 500), if I do relation, I have to relate >500 pages, one by one. I understand the "relation" this way: I create a product page in english version named "Ac001" which consist products image and product name, then I go to chinese version create a page with same named "Ac001", and make it relate to english version of "Ac001", so it will display same content for both languages.
But both language share the same content, isn't it too stupid to do >500 relations in chinese version? Is there any chance I can just relate the whole folder?
@trendoman, you seems like you are already master this couchcms, maybe you can provide your idea here if you can, I really appreciate and value the help comes from this forum.
en/products.php
- Code: Select all
<cms:template title='Products' clonable='1' dynamic_folders='1' gallery='1' folder_masterpage='en/products-folder.php' order='3'>
<cms:editable
name="gg_image"
label="Image"
desc="Upload your main image here"
show_preview="1"
preview_height="200"
type="image"
/>
<cms:editable
name = "gg_thumb"
assoc_field = "gg_image"
label = "CMS Thumbnail Image"
desc = "Only used within the admin panel"
width = "115"
height = "115"
enforce_max = "1"
type = "thumbnail"
/>
<cms:editable
name = "grid_thumb"
assoc_field = "gg_image"
label = "Grid Thumbnail Image"
desc = "Used on the front end"
width = "640"
height = "400"
enforce_max = "1"
type = "thumbnail"
/>
<cms:editable name='gallery_css' type='message'>
<style>
#k_element_grid_thumb, #k_element_gg_thumb, #k_page_name {
display: none;
}
</style>
</cms:editable>
</cms:template>
<!---product menu--->
<!-- if this is NOT a folder -->
<cms:if k_is_home>
<!-- list folders -->
<cms:folders hierarchical='1'>
<!-- and redirect to the first folder that is not top-level -->
<cms:if k_level='1' || k_level='0'>
<cms:redirect url="<cms:show k_folder_link />" />
</cms:if>
</cms:folders>
</cms:if>
<div class="protitle">PRODUCT RANGE</div>
<cms:if k_is_page || k_is_folder >
<cms:if k_folder_name ><cms:set current_folder=k_folder_name /></cms:if>
<cms:if k_page_foldername ><cms:set current_folder=k_page_foldername /></cms:if>
</cms:if>
<cms:folders hierarchical='1' extended_info='1' include_custom_fields='1'>
<cms:if k_level_start >
<cms:set my_class2='' />
<cms:if k_level='0'>
<cms:set my_class2='class="orion-menu red"' />
</cms:if>
<UL <cms:show my_class2 />></cms:if>
<cms:if k_element_start >
<cms:set my_class='' />
<cms:if "<cms:is_ancestor parent=k_folder_name child=current_folder />" >
<cms:set my_class='class="active"' />
</cms:if>
<LI <cms:show my_class />>
<a href="<cms:if k_folder_immediate_children>javascript:void(0)<cms:else /><cms:show k_folder_link/></cms:if>"><cms:show k_folder_title/></a>
</cms:if>
<cms:if k_element_end ></LI></cms:if>
<cms:if k_level_end ></UL></cms:if>
</cms:folders>
<!----display products---->
<cms:if k_is_list >
<div class="row box">
<cms:pages folder=k_folder_name include_subfolders='0' limit='12' paginate='1' >
<div><a class="fancybox-thumbs fancybox-button" rel="fancybox" href="<cms:show gg_image />" title="<cms:show k_page_title />"><div class="thumbnailwrap sameheight2">
<div>
<img src="<cms:show grid_thumb />" class="img-responsive" alt="<cms:show k_page_title /> - <cms:show k_folder_title/> ">
</div>
<span class="rollover" ></span>
<span class="text"><cms:show k_page_title /></span>
</div></a>
</div>
<cms:paginator />
</cms:pages>
</div>
<cms:else /><!-- k_is_page -->
<div class="text-center">
<img alt="<cms:show k_page_title /> - <cms:show k_folder_title/> - Timber Art Design Sdn Bhd" src="<cms:show gg_image />" class="img-responsive" style="max-height:500px; width:auto; margin:0 auto;" />
<br>
<h1><cms:show k_page_title /> | <a href="<cms:show k_page_folderlink/>">view all <cms:show k_page_foldertitle/> products</a></h1>
</div>
</cms:if>
en/products-folder.php
- Code: Select all
<cms:template title='Product Folder' clonable='1' hidden='1' order='4'>
<cms:editable
name="chtext"
label="Chinese Text"
type="text"
/>
<cms:editable name='gallery_css' type='message'>
<style>
#k_element_grid_thumb, #k_element_gg_thumb, #k_page_name {
display: none;
}
</style>
</cms:editable>
</cms:template>
I have create another "cn" folder which consist exact same files with "en" folder, cn/products.php, cn/products-folder.php.
I know I can do relation between pages, but I got so many products ( > 500), if I do relation, I have to relate >500 pages, one by one. I understand the "relation" this way: I create a product page in english version named "Ac001" which consist products image and product name, then I go to chinese version create a page with same named "Ac001", and make it relate to english version of "Ac001", so it will display same content for both languages.
But both language share the same content, isn't it too stupid to do >500 relations in chinese version? Is there any chance I can just relate the whole folder?
@trendoman, you seems like you are already master this couchcms, maybe you can provide your idea here if you can, I really appreciate and value the help comes from this forum.