Hello Guys,
I'm fairly new on CouchCMS and i'm trying to get my first project started with it.
Right now, i'm struggling with the loops.
The site should be a collective of artist, each one with their own projects and products, so the structure should be:
Home
--Artist A
----Projects
------Project 1A
------Project 2A
----Products
------Product 1A
------Product 2A
--Artist B
----Projects
------Project 1B
------Project 2B
----Products
------Product 1B
------Product 2B
I'm using nested folders and despite the "name" is different (like projects-1 and so on) the title "Projects" is always the same (also the "Products")
I made one single template that when browsing "Projects" or "Products" it correctly shows the childs of this folders, and when browsing Home it shows the links to each artists.
But i would also like to show in the Home "sections" of each artist like this:
Bla Bla Bla Artist Name
Current Projects:
Some content from project 1
Some content from project 2
Some content from project 3
More bla bla bla
Current Products:
Some content from product 1
Some content from project 2
Can i do some kind of loop that only goes through childof "parent_title" instead of "parent_name"?
That way i would not need to edit the template everytime i add a new artist to the site.
Rigth now i'm using:
But i'm not sure if this is code efficient as it will loop through all the folder hierarchy every time.
Best regards
PS: Sorry for my english
I'm fairly new on CouchCMS and i'm trying to get my first project started with it.
Right now, i'm struggling with the loops.
The site should be a collective of artist, each one with their own projects and products, so the structure should be:
Home
--Artist A
----Projects
------Project 1A
------Project 2A
----Products
------Product 1A
------Product 2A
--Artist B
----Projects
------Project 1B
------Project 2B
----Products
------Product 1B
------Product 2B
I'm using nested folders and despite the "name" is different (like projects-1 and so on) the title "Projects" is always the same (also the "Products")
I made one single template that when browsing "Projects" or "Products" it correctly shows the childs of this folders, and when browsing Home it shows the links to each artists.
But i would also like to show in the Home "sections" of each artist like this:
Bla Bla Bla Artist Name
Current Projects:
Some content from project 1
Some content from project 2
Some content from project 3
More bla bla bla
Current Products:
Some content from product 1
Some content from project 2
Can i do some kind of loop that only goes through childof "parent_title" instead of "parent_name"?
That way i would not need to edit the template everytime i add a new artist to the site.
Rigth now i'm using:
- Code: Select all
<cms:nested_pages include_custom_fields='1' depth='2' order='asc' childof=k_page_name >
<a href="<cms:show k_nestedpage_link />">
<h1><cms:show k_nestedpage_title /></h1>
</a>
<cms:if k_nestedpage_parent_title='Project' >
Test test project
</cms:if>
</cms:nested_pages>
But i'm not sure if this is code efficient as it will loop through all the folder hierarchy every time.
Best regards
PS: Sorry for my english