Hidden record showing in list but is hidden in detail

11 posts by 3 authors in: Forums > CMS Builder
Last Post: September 1, 2011   (RSS)

This is a weird one,

I have a record which is marked as hidden. In the detail page the record is hidden, and only shows when the record is no longer ticked as hidden.

However, in the record list page, the record shows regardless of it's hidden setting.

Any ideas people?

Thanks in advance.

Paul

Re: [Pixels & Beats] Hidden record showing in list but is hidden in detail

By gkornbluth - August 30, 2011 - edited: August 30, 2011

Hi Paul,

Maybe I'm not understanding, but if you mean on the "admin" record list page, I think that's how it's supposed to work.

If the record was hidden on the list, how could you find it to un-hide it if you wanted to?

You could add hidden to the ListPage Fields so that you'd have an indication of whether a particular record is hidden from the web site viewer pages.

Jerry Kornbluth
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [gkornbluth] Hidden record showing in list but is hidden in detail

Hi Jerry,

Just to clarify I am referring to the special fieldname that allows you to hide posts using the 'hidden' checkbox (fieldname: hidden).

More info at:
http://www.interactivetools.com/docs/cmsbuilder/special_fieldnames.html

As far as I am aware it should hide a record regardless. In the detail page the record is hidden, however in the listing page of records it is showing.

Here is an example. Look for the first post named as 'Test':

The listing page in which is shows is:
http://demo1.sachsbikes.co.uk/news.php

If you try to click it you will end up back on the listing page as CMSB is setup to redirect to the listing page, if a record is not found (this is to deal with old pages which had been indexed by search engines).

Hope this helps to give a better idea of this weird problem :)

Paul

Re: [gkornbluth] Hidden record showing in list but is hidden in detail

Nah my bad for not describing better Jerry ;)

I did test it as you described and everything worked as it should.

I am merging records together and wondering if somehow this causing the problem. Here is an example of my merge method:

// put all the records in one list
$allRecords = array_merge( $dealer_newsRecords, $www_newsRecords );
$allMetaData = array_merge( $dealer_newsMetaData, $www_newsMetaData );


// sort them by date
function createdDateCompareFunction($a, $b) { return -strcmp($a['createdDate'], $b['createdDate']); }
usort($allRecords, 'createdDateCompareFunction');

Re: [Pixels & Beats] Hidden record showing in list but is hidden in detail

Not sure, but maybe a 'where' => " hidden = '0' ", in the load records call(s) would help?

Jerry
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [gkornbluth] Hidden record showing in list but is hidden in detail

BOOM! Bang on the button Jerry!

I think the fact that I was using:
'where' => 'target_website="Peugeot"',
'orWhere' => 'target_website="All"',

Was causing the hidden function to be over ridden.

Adding:
'where' => 'target_website="Peugeot"',
'orWhere' => 'target_website="All"',
'orWhere' => 'hidden="0"',

Fixed it..... Nice work and thanks!

Paul

Re: [Pixels & Beats] Hidden record showing in list but is hidden in detail

Gaaaaa! Spoke to soon!

It does work, but it shows ALL records that are not set to hidden and so overrides my other 'where' statements.

Any ideas?

Re: [Pixels & Beats] Hidden record showing in list but is hidden in detail

Take a look at http://www.interactivetools.com/forum/gforum.cgi?post=64426. it may have a way to do what you're looking for in the code.
'where' => " color = 'red' AND year <= '2000' ",

Jerry

You fix one thing and you break another. So goes the war...
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [Pixels & Beats] Hidden record showing in list but is hidden in detail

By Jason - August 31, 2011

Hi,

So, if I understand correctly, you want to return records where the "hidden" check box is not checked and "target_website" is either 'Peugeot' or 'All'. Is that right?

If so, try this:

'where' => "(target_website = 'Peugeot' OR target_website = 'All') AND hidden = '0'",
'ignoreHidden' => true,


We set ignoreHidden = true because we're handling it ourselves with "hidden = 0".

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/