Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
I am creating a portfolio with the main nav link "My work" showing a grid of 9 categories (set up as image links). I have a clonable template my-work.php with dynamic folders. Each category is a folder into which a work item is placed ... click on a category link and see the list of works (image and any details added).

I am referring to views k_is_home (with tag cms:folders, for the grid of 9 categories) and k_is_folder (with tag cms:pages for the list of works within a folder). And that is all working well.

BUT when I click on 'View' within the admin panel there is a blank page, because we are looking at page view (which I'm not interested in). If I check for k_is_page as well as for k_is_folder I get a page showing all items in all categories and no folder heading.

I think that I would need to put a whole piece of code in to do the k_is_page view ... just for the case where the client is clicking on 'view'.

I can tell the client that they will see a blank page if they click 'view' and I think that's acceptable. But my query is ... for the sake of completeness/correctness should one always cater for a page view? Am I oversimplifying my code and wrongly leaving gaps/uncatered for conditions?
But my query is ... for the sake of completeness/correctness should one always cater for a page view? Am I oversimplifying my code and wrongly leaving gaps/uncatered for conditions?

You are completely at liberty to implement whatever views, in whatever manner that suits you.
If your situation does not require a page-view, feel free to skip it.

This will of course, as you witnessed, cause a blank page to be shown when a page is viewed from the admin panel. This can be corrected by implementing somewhere at the beginning of the template a stub code that redirects to the folder-view if the template is called in a page-view -
Code: Select all
<cms:if k_is_page>
   <cms:redirect url="<cms:link masterpage=k_template_name folder=k_page_foldername />" />
</cms:if>

This will effectively apply only to pages invoked from the admin-panel as the main site will have no links to page-views.

Hope this helps.
wish I'd thought of that ... thank you!
3 posts Page 1 of 1
cron