by
KK » Tue Jul 23, 2013 4:31 am
It seems you deleted a previous post of yours where you asked for directions about using folders.
Anyways, here is the answer (though you might have found it out for yourself)
With reference to your site hierarchy illustrated below -
- Code: Select all
chf
kunst
malstifte
malen
wachs
farbstifte
wolle
farbig
natur
pflanzen
locken
seide
- following are the pages (i.e. distinct URLs) that a visitor can reach
(assuming you eventually turn on prettyURLs)
http://www.yoursite.com/chf/ This is the
home-view.
Here you are displaying a list of all your folders with the first-level folders serving only as headings while the second-level folders actually link deeper.
http://www.yoursite.com/chf/wolle/This is the
folder-view of the first-level folder.
In your site this throws 404 error but we'll make it show a list of folders directly below it i.e. all the child second-level folders below it.
http://www.yoursite.com/chf/wolle/farbig/This is also a
folder-view but of a second-level folder.
Here is where the meat of your site lies.
We'll display all the cloned-pages (i.e. products) that reside in this folder.
http://www.yoursite.com/chf/wolle/farbig/mohair.htmlThis is a page-view showing a product.
Your site does not show individual products on single pages so we won't implement this view.
With the above information, this is what your template should look roughly like (you can fine-tune the HTML markup).
- Code: Select all
<cms:if k_is_home >
<!-- we'll list all folders of this template -->
<cms:folders hierarchical='1' depth='2'>
<cms:if k_level='0'>
<!-- first level folders need to show only their names -->
<h2><cms:show k_folder_title /></h2>
<cms:else />
<!-- second level folders need to show their photo and link -->
<a href="<cms:show k_folder_link />"><cms:show k_folder_image /></a>
<a href="<cms:show k_folder_link />"><cms:show k_folder_title /></a>
</cms:if>
</cms:folders>
</cms:if>
<cms:if k_is_folder >
<!-- we check for the first level folders by testing if they have a parent (they don't) -->
<cms:if k_folder_parentid='-1'>
<!-- first level folder - show its child folders -->
<h1><cms:show k_folder_title /></h1>
<cms:folders childof=k_folder_name hierarchical='1' depth='1' >
<a href="<cms:show k_folder_link />"><cms:show k_folder_image /></a>
<a href="<cms:show k_folder_link />"><cms:show k_folder_title /></a>
</cms:folders>
<cms:else />
<!-- second level folder - show all products within it -->
<cms:pages folder=k_folder_name include_subfolders='1' >
<!-- All the variables of each page (i.e. product) in this folder are available here -->
<div class="wrapper">
<!-- place your original code showing a single product here -->
<h3><cms:show k_page_title /></h3>
</div>
</cms:pages>
</cms:if>
</cms:if>
Hope this helps. Do let me know.