Silverstripe 4 plugin to integrate with Hail (https://get.hail.to)
Run the following command:
composer require firebrandhq/silverstripe-hail "^2.0"
Hail Holder pages are used to display your Hail Content. You can define multiple Hail Holders for your site and personalise them to display different content.
However, your Hail Content doesn't belong to any specific pages in SilverStripe. So in some context, SilverStripe won't know under which Hail Holder the articles need to be displayed. E.g: If a Hail Page is return in search results.
In the Hail Settings page of your SilverStripe site, you can choose a default HailHolder used to display Hail Harticle.
Fetching HailContent can be quite a long process if you have a lots of article. To simplify this process, several background task have been created. However, they require a few appropriate cronjobs to be defined.
The following instructions assumed your site is running in Apache on an Ubuntu/Debian system, but it should be similar on most other *nix system.
To edit your crontab use the following command:
sudo crontab -u www-data -e
This will configure your cronjob to run under the web server user. This has the benefit of avoiding potential file conflicts.
A specific dev task (HailFetchTask) has been created to fetch all your Hail content. You can access this task in your browser (e.g.: http://example.com/dev/tasks/HailFetchTask) however this request is likely to timeout. In most cases, you will want to schedule a regular cronjob to refresh your content.
Add the following entry to your crontab:
0 23 * * * /usr/bin/nice -n 19 /usr/bin/php /var/www/SS_lphs/framework/cli-script.php dev/tasks/HailFetchTask > /dev/null 2>&1
This will fetch all your Hail Content every day at 11PM. If you're running multiple SilverStripe sites with the Hail plugin on your server, try scheduling your cronjobs at slightly different time to avoid having all the jobs running simultaneously.
CMS users can trigger an immediate fetch if they so desire. This will schedule a background job using the silverstripe/queuedjobs plugin.
This plug-in also require a few cronjobs to run. Add the following entries to your crontab.
* * * * * /usr/bin/nice -n 19 php /var/www/SS_lphs/framework/cli-script.php dev/tasks/ProcessJobQueueTask > /dev/null 2>&1 * * * * * /usr/bin/nice -n 19 php /var/www/SS_lphs/framework/cli-script.php dev/tasks/ProcessJobQueueTask "queue=2" > /dev/null 2>&1 */5 * * * * /usr/bin/nice -n 19 php /var/www/SS_lphs/framework/cli-script.php dev/tasks/ProcessJobQueueTask "queue=3" > /dev/null 2>&1
View SilverStripe Queue Jobs - Installing and configuring for more details
Module rating system helping users find modules that are well supported. For more on how the rating system works visit Module standards
Score not correct? Let us know there is a problem