Assuming the folder-names of both the templates are identical, take a look at the folowing simplified code -
In the code above since we are in a page-view, the page's folder would be available as the variable named 'k_page_foldername'. We are simply providing this variable to the cms:pages loop's 'folder' parameter. So if the cms:pages template has a folder by the same name, it'll list pages only from that folder.
Once that is understood, you'll see that if we cut away the cms:pages loop and paste it into a separate snippet (say named 'some_snippet.html') so that the code above now becomes -
- the new code will work just the same. (remember, snippets behave as if their code is physically present at the place cms:embed tag is present).
So, to answer your query, please try using the folder=k_page_foldername within the snippet.
Hope it helps.
- Code: Select all
<cms:if k_is_page>
<cms:pages masterpage='some_template.php' folder=k_page_foldername >
..
</cms:pages>
</cms:if>
In the code above since we are in a page-view, the page's folder would be available as the variable named 'k_page_foldername'. We are simply providing this variable to the cms:pages loop's 'folder' parameter. So if the cms:pages template has a folder by the same name, it'll list pages only from that folder.
Once that is understood, you'll see that if we cut away the cms:pages loop and paste it into a separate snippet (say named 'some_snippet.html') so that the code above now becomes -
- Code: Select all
<cms:if k_is_page>
<cms:embed 'some_snippet.html' />
</cms:if>
- the new code will work just the same. (remember, snippets behave as if their code is physically present at the place cms:embed tag is present).
So, to answer your query, please try using the folder=k_page_foldername within the snippet.
Hope it helps.