如何在silverstripe 3中的设定日期取消发布页面?

问题描述 投票:1回答:1

我想将页面设置为在silverstripe 3上的设定日期自动取消发布。

我已经在网上看到了多种解决方案,主要是使用某些模块,但这些模块都没有与silverstripe 3兼容,很多模块说他们现在已经放弃了,如果不是我在作曲家上得到以下错误

[InvalidArgumentException]                                                                                                        
  Could not find a matching version of package xxxxxxxx. Check the package spelling, your version constr  
  aint and that the package is available in a stability which matches your minimum-stability (dev).

有没有人有完整的silverstripe 3解决方案?

silverstripe
1个回答
1
投票

您正在寻找的最有可能是禁运模块(https://github.com/silverstripe-terraformers/silverstripe-embargo-expiry)。与用于计划作业的queuedjobs模块(https://github.com/symbiote/silverstripe-queuedjobs)结合使用可以安排DataObjects的发布和取消发布(例如页面)。

您可以使用以下命令安装模块:

composer require silverstripe-terraformers/embargo-expiry symbiote/silverstripe-queuedjobs

并将配置添加到SiteTree:

SiteTree:
  extensions:
    - SilverStripe\Versioned\Versioned
    - Terraformers\EmbargoExpiry\Extension\EmbargoExpiryExtension

之后运行dev / build,您应该能够在CMS中设置日期。

在您的生产环境中,您需要确保配置与此类似的cronjob:

*/1 * * * * php /path/to/silverstripe-project/framework/cli-script.php dev/tasks/ProcessJobQueueTask

对于本地测试,您应该能够运行:

php ./framework/cli-script.php dev/tasks/ProcessJobQueueTask

通过上述步骤,您应该能够在SilverStripe 3.x中设置页面到期。

干杯,彼得

© www.soinside.com 2019 - 2024. All rights reserved.