Unpublished / restricted items in Sitecore showing default values

Is it possible in usercontrols / xslt to visualize a check that an element has a publication restriction or is not available for publication in Sitecore CMS? We get some situations where we explain to CMS users how to set publishing restrictions and return questions about items that display standard values ​​on a website. For instance:

  • I have an element and it contains fields with information.
  • I am posting this item and everything is fine. Content is displayed on the website.
  • I change the publication restrictions and say that it can be published only from 02/23/2010 to 02/25/2010.
  • What is happening now is that when I publish the website again, the element that was displayed correctly now shows the standard values.

EDIT:

  • The item I'm talking about has only one version. (Dutch - version 1) An element has just been made from an insert from a template and filled with information. Once it is filled with information, publication restrictions are set. When this is done, and the item will not be subject to a date limit, I see the standard values ​​@ front.

Can publication restrictions be used to make sure that information is displayed only in a certain period of time? Is this something we can fix in our code? Is it possible to verify that an item is not in the public relay / unpublished range?

+3
2

, , .

CMS Sitecore , , , :

  • /, .
  • , .

, , , , , Item.Empty.

, Sitecore, :

? → item.Versions.Count

? → !item.Publishing.IsValid(DateTime.Today, false)

??? → item.Visualization.GetLayout(Sitecore.Context.Device)

, - -!

+2

. , , ( , ), . , , , .

. , , .

, /XSL- (, sc: fld function). , - . , , /.

, .

0

Source: https://habr.com/ru/post/1733372/


All Articles