All list links point to same detail listing?

8 posts by 2 authors in: Forums > CMS Builder
Last Post: July 10, 2012   (RSS)

By Dave R - July 8, 2012 - edited: July 8, 2012

Hi Folks,

I'm trying to create a list page, but when I use the code generator, the links it creates all link to the same detail page.

I have six sample listings - the process I am using is this:

1. Add New Editor
2 .Created fields
3. Added content to fields
4. Clicked copied code generator / List Page
5. Clicked copied code generator / Detail Page

Fired the files onto the server... see above issue.

I tried changing the url's on the list page to a full url = same issue.
Added a simple search page and same issue.

What am I missing.

Thanks
Dave

Re: [Dave R] All list links point to same detail listing?

By Jason - July 8, 2012

Hi Dave,

CMS Builder is set up so that you use a single detail page for a given section. That way the display and layout is always the same, just the content is different. Is there a reason why you need each record to go to a different detail page?

If so, one thing you could do is add a "detail_page" field to your section. For each record, enter a different detail page file name. In your list page code, you can use the value of "detail_page" in you link instead of the default "_link" pseudo field.

Hope this helps get you started.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] All list links point to same detail listing?

By Dave R - July 8, 2012

Hi Jason,

What I'm wanting to achieve is to build a directory, thousands of listings. At the moment, I have created 6 test / dummy listings. When I click on the links, they all point to the same listing. If that doesn't explain it better... think of Listings Manager... listings list, with links to details... but whenever I follow the links from listings list... they all point to the same content.

I can always email you the admin login if that helps.

Thanks
Dave

Re: [Dave R] All list links point to same detail listing?

By Dave R - July 9, 2012 - edited: July 9, 2012

Just an update: I note other customers are requesting urgent attention with issues. Conversely, I am in no rush and happy to wait... tis a project that has been in the "We'll get around to that one day" box for a long long time... please do prioritise others. [;)]

Cheers
Dave

Re: [Dave R] All list links point to same detail listing?

By Jason - July 9, 2012

Hi Dave,

Thank you for your patience, it's really appreciated!

I think I see what you are getting at now. If you could post a link to your list page, and attach the code for your detail page, I think we can figure out why your detail page is always displaying the same content.

Hope this helps,
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Dave R] All list links point to same detail listing?

By Jason - July 10, 2012

Hi Dave,

Thank you for the email. I can see what's happening now.

The issue here is that the getRecords() call in your detail page doesn't have any thing in it's WHERE clause. This results in it always retrieving the first record in the list.

Try this instead:

// load record from 'lawyers'
list($lawyersRecords, $lawyersMetaData) = getRecords(array(
'tableName' => 'lawyers',
'where' => whereRecordNumberInUrl(0),
'loadUploads' => true,
'allowSearch' => true,
'limit' => '1',
));


This should take care of the issue for you.

Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] All list links point to same detail listing?

By Dave R - July 10, 2012

[:)] Thanks!