🚨 This is an advanced task, intended for technical users. For tasks like these, the Mechanic team only offers support with platform-level issues. For help with task-level issues (e.g. debugging, configuration, customization, monitoring, etc), see Hire a Mechanic developer.
Tags: Advanced, Publish, Schedule, Sections, Unpublish
This advanced task allows you to schedule section publishing and unpublishing for your store. To use this task, enter a datetime to publish, a theme ID, and template names paired with one or more section IDs to publish or unpublish. If the configured datetime matches the current task run time at a scheduled 10 minute interval, then it will publish and/or unpublish the theme sections as configured.
- View in the task library: tasks.mechanic.dev/advanced-scheduled-section-publishing
- Task JSON, for direct import: task.json
- Preview task code: script.liquid
{
"datetime_to_publish__required": null,
"theme_id__number_required": null,
"template_names_and_section_ids_to_publish__keyval_multiline": {},
"template_names_and_section_ids_to_unpublish__keyval_multiline": {}
}
Learn about task options in Mechanic
mechanic/scheduler/10min
mechanic/user/trigger
mechanic/actions/perform
Learn about event subscriptions in Mechanic
This advanced task allows you to schedule section publishing and unpublishing for your store. To use this task, enter a datetime to publish, a theme ID, and template names paired with one or more section IDs to publish or unpublish. If the configured datetime matches the current task run time at a scheduled 10 minute interval, then it will publish and/or unpublish the theme sections as configured.
Important Notes:
- The datetime to publish must be in the format of "YYYY-MM-DD HH:MM" with a 24 hour clock time having minutes that are a multiple of 10, since that is the smallest scheduler interval available.
- Template names should be entered without the .json suffix (e.g. index, page.contact).
- Template names can appear in both the publish and unpublish keyval configurations, but they may only appear once in each since they are the left-hand keys.
- Section IDs should be entered in the right-hand value fields, paired with their respective template.
- Multiple section IDs being (un)published for the same template must be entered on multiple lines of the same entry field.
Example configuration
- Datetime to publish: 2022-07-31 13:30
- Theme ID: 1234567890
- Template names and section IDs to publish:
- index
- collage
- 123456abcdef
- index
- Template names and section IDs to unpublish:
- index
- 234561bcdefa
- index
Find this task in the library at tasks.mechanic.dev, and use the "Try this task" button. Or, import this task's JSON export – see Importing and exporting tasks to learn how imports work.
Found a bug? Got an improvement to add? Start here: ../../CONTRIBUTING.md.
Submit your task requests for consideration by the Mechanic community, and they may be chosen for development and inclusion in the task library!