2

To replace my current CMS I will need to have parts of pages change without the whole page change. As I'm looking at using matrix blocks for building pages, it would seem to be easy for an editor to schedule matrix blocks...

Is there a way to do this or a better approach?

1

The simplest solution would probably to just have two normal Date fields:

  • Start Date
  • End Date

And then in Twig, just show blocks that fall between those dates.

2

Yes you can definitely do this. The huge advantage of Craft is it's ability to customize nearly everything.

You can create a date field in your matrix block and check if the current date {{ now|date }} is lower than the date specified in the field.

If the condition is true, you'll display the matrix block if not you can either just hide it or you could create a plugin with a template variable to delete the block.

craft()->matrix->deleteBlockType($yourBlock);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.