Problems, need help? Have a tip or advice? Post it here.
4 posts Page 1 of 1
hello ... I have just launched a portfolio site. There are 9 work categories - each represented by a dynamic folder. I am using cms:folders to generate the sub-navigation. In addition I have a 10th link - which is a random selection / lucky dip from all the work items set up. The link for this is:
Code: Select all
<cms:pages masterpage='my-work.php' orderby="random" limit='1' >
      <li><a href="<cms:show k_page_link />"<cms:if k_is_folder><cms:else /> class="current"</cms:if>>Lucky Dip <img style="margin: 5px;" src="<cms:show k_site_link />img/redo.png" alt="Lucky Dip" width="15" height="15" /></a></li></cms:pages>

When the randomly picked page is displayed the url in the browser address bar is not the right url for the page ... it'll be some other work item altogether.

This isn't exactly the end of the world, but now I've noticed it, I'm curious to know if there's a way to correct it?!
Hi Potato,

I had a look at your site. Your list-view page is displaying all the cloned pages but none of the entries have a link to their respective page-view. This makes it impossible for me to compare the problematic link you mentioned with the correct one.

Could you please grant me FTP + Couch admin access to the site for a little while?

Thanks
Thank you for the creds.

I had a look and the problem is that in your 'page-view' you are using the cms:pages tag once again and that too with the 'random' parameter.
Code: Select all
<cms:pages masterpage='my-work.php' orderby='random' limit='1' show_future_entries='1' >
   <h2 class="my-work">Lucky Dip : <cms:show k_page_foldertitle /></h2>
   ...
<cms:pages>

In the page-view all the variables of the page being visited are already available so there is no need to use the cms:pages tag there. In all probability you used it for displaying a 'random' page - that again is unnecessary (and confusing, as shown by the problem on hand) as you are already selecting a random page from the sidebar.

Please remove the enclosing <cms:pages> tag pair leaving the enclosed content intact and the problem will be resolved.

Thanks.
so I'd created a loop within a loop ... thanks for your help - I couldn't see what I'd done!
4 posts Page 1 of 1