ASPX templates
Version 4.x > ASPX templates > SelectOnlyPublished, what does it do? View modes: 
User avatar
Member
Member
random0xff - 6/1/2009 12:22:49 PM
   
SelectOnlyPublished, what does it do?
According to the documentation:

SelectOnlyPublished: Indicates if only published documents should be displayed.

Yeah, againnot so clear that documtation. Does that mean if the current date is between the PublishFrom and PublishTo dates?

I have a repeater that selects all pages in the path, but SelectOnlyPublished is set to true, and many of the pages have Publish to set to last month. It shouldn't select ALL pages right? I'm confused, how does this work?

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 6/1/2009 2:27:34 PM
   
RE:SelectOnlyPublished, what does it do?
Hi,

"Published" documents are those documents, which are in workflow step "Publish" (if workflow is used) and/or if the date range set in Publish from/to fields is valid. So, the document with expired Published to field value are no longer published and therefore are not displayed.
You can see whether the document is published or not on its Properties tab -> General

Best Regards,
Juraj Ondrus

User avatar
Member
Member
random0xff - 6/11/2009 4:10:12 PM
   
RE:SelectOnlyPublished, what does it do?
Ok, I understand. Thanks!

User avatar
Member
Member
ricardo.fiel - 2/5/2010 5:56:05 AM
   
RE:SelectOnlyPublished, what does it do?
Picture this scenario:

A node is NOT published, but it's children and grandchildren are. I don't want those child nodes to be returned by SelectNodes (with SelectOnlyPublished=true).

At the moment, those nodes are being returned, even if their parent is unpublished.

How can I change this behavior to the one I want?

Thanks,
Ricardo

User avatar
Kentico Consulting
Kentico Consulting
kentico_mirekr - 2/9/2010 6:09:35 AM
   
RE:SelectOnlyPublished, what does it do?
Hi,

You need to write your own logic for this request. You can use SelectSingleNode method to get particular document. If the document it not published, you will not proceed and you will not try to get any sub-nodes. Otherwise, if the document is published, you can go ahead and use SelectNodes method to get all of the documents under previous node and again check if the documents are published or not. I hope this will help you.

Best regards,
Miroslav Remias.