seth_w_jackson
I'm new here

Validity Period

Jump to solution

Hello,

So I get how the validity period can be used to prevent sections or pages from generating but this requires that the content is generated when the validity periods change for each piece of content. What I'd like to do is add the validity period to the XML being generated and use the application layer to handle the time controls. This would allow our content users to stage future content without requiring a generation execution and view the future-state with ContentEditor.

Seth

0 Kudos
1 Solution

Accepted Solutions

That depends on how the rendering logic for the preview was implemented. If you're using

$CMS_VALUE(#global.page.body(…))$

to render the section's content to preview, timecontrol in ContentCreator should work right away.

View solution in original post

0 Kudos
6 Replies
thmarx
I'm new here

Hey Seth,

could you please provide more information.

What is your use case?

What are you generating with FS? Just XML or HTML to?

What is that "the application layer"? Is this some kind of web app developed by yourself?

Thorsten

0 Kudos

Hi Seth,

does anything prevent you from just using getLifeSpan() on a section? Sounds like this is exaclty what you need.

Hannes

EDIT: Nevermind, I just realized that doesn't help you at all. Did you find any appropriate solution for the problem in the mean time? A colleague of mine suggested to configure and save the validity period somewhere else, maybe in the meta data. Could that help you?

0 Kudos
sglock
I'm new here

Hi Seth! Your plan is to render all sections regardless if they are "valid" at the generation point of time, specifically those which will only be valid in the future. Time control is handled "on the glass" based on the timestamps - is that right?

IIRC the behavior depends on how you render the sections:

$CMS_VALUE(#global.page.body(…))$

will always consider the validity period and not contain future or past content.


Using an iteration instead will ignore the validity period and render out all sections:

$CMS_FOR(section, body.getChildren(class("de.espirit.firstspirit.access.store.pagestore.Section")$

$CMS_VALUE(section)$

$CMS_END_FOR$

This also renders those which are excluded from output via checkbox - you might want to filter these and watch out for other side effects.

0 Kudos

Thanks Seb. That makes sense for the XML generation but how does this integrate with WebEdit? Will I need to modify the preview channel when in WebEdit mode to consider the date on the slider and evaluate it in the channel?

0 Kudos

That depends on how the rendering logic for the preview was implemented. If you're using

$CMS_VALUE(#global.page.body(…))$

to render the section's content to preview, timecontrol in ContentCreator should work right away.

0 Kudos
pavone
I'm new here

Hello Seth,   

do you need further help or did Sebastian's reply already help you? If so, it would be great if you marked his reply as "correct answer" so that other community users find the solution easily. If you have already found a solution by yourself, it would be very kind of you, if you posted it here.

Best regards 

Tim

0 Kudos