Site Parameter creation

joyanta sen asked on August 22, 2018 06:44

Hi, Could you please tell me is there any way to create Site parameter? We need to assign some date to that parameter and every time a specific task runs we need to update this parameter.

Thanks, Joyanta

Recent Answers


Dawid Jachnik answered on August 22, 2018 08:13

Hi, If you are using Scheduled task, you can use Task Data attribtue and pass data to your task. You can create task for every website. https://docs.kentico.com/k11/custom-development/miscellaneous-custom-development-tasks/scheduling-custom-tasks

if you want global or site parameter (setting) you can create custom setting, which can be accessible through k# macro or by API

https://docs.kentico.com/k11/custom-development/creating-custom-modules/adding-custom-website-settings

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on August 22, 2018 16:40

If you need the date to be dynamic for your scheuled task, you can add macros in the Task data field of the scheduled task. Then in your custom code, you can look at that task data value.

If this doesn't work, I'd suggest using the second option Dawid suggested, custom setting. If you don't want to create a custom module to create this custom setting, you could create a custom table with a few columns in it and have this value stored there. But I think a custom setting as Dawid suggested would be a better scenario.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.