Creating fixtures
⚠️ Note: Fixtures are primarily intended for testing and accelerating the DegDitor team’s development process. Their current implementation is quick and pragmatic, but improvements are planned for future releases.
DegDitor fixtures have been appended to
Sylius default suite
fixtures.
This means that running$ php bin/console sylius:fixtures:load
will load also our fixtures.
DegDitor fixtures must be defined and executed in the following order:
degditor_image
degditor_category
degditor_page
degditor_block
Below, you can find a sample fixture with some annotations:
1sylius_fixtures:
2 suites:
3
4 default:
5
6 listeners:
7 orm_purger: ~
8 logger: ~
9 images_purger: ~
10
11 fixtures:
12
13 degditor_image:
14 options:
15 images:
16 placeholder_image:
17 path: '@FiftyDegSyliusDegditorBasePlugin/Resources/fixtures/placeholder-image.jpeg'
18 translations:
19 en_US:
20 alt: 'Alternate text'
21
22 degditor_category:
23 options:
24 categories:
25 blog_category:
26 admin_title: Blog
27 # image: use the image file name, without extension
28 image: 'placeholder-image'
29 is_enabled: true
30 position: 0
31 # channels: enabled Sylius channels by code
32 channels: [ 'FASHION_WEB', 'IT_FASHION_WEB' ]
33 # publish_from: can be null or a vald argument for DateTime constructor
34 publish_from: 'now'
35 # publish_to: can be null or a vald argument for DateTime constructor
36 publish_to: '+30 days'
37 translations:
38 en_US:
39 slug: 'blog'
40 preview_title: The fashion store blog
41 preview_description: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur finibus justo ac aliquam fermentum. Duis eget tempus lorem. Sed congue nisl quis urna accumsan eleifend. Quisque a euismod risus, venenatis luctus urna. Vivamus at tempor nisl, mollis suscipit mauris. Cras imperdiet velit sapien, sed tincidunt velit fringilla eget. Fusce vehicula felis eu sem finibus, a lacinia turpis laoreet. Mauris a nibh sagittis, lacinia magna id, semper mauris. Interdum et malesuada fames ac ante ipsum primis in faucibus. Duis vitae turpis eu diam venenatis imperdiet vel et est. Quisque auctor magna enim, non ornare orci maximus vel.
42 og_title: The fashion store blog
43 og_description: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
44 seo_title: The fashion store blog
45 seo_description: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
46
47
48 degditor_page:
49 options:
50 pages:
51
52 homepage:
53 admin_title: Homepage
54 # image: use the image file name, without extension
55 image: 'placeholder-image'
56 is_enabled: true
57 is_homepage: true
58 is_shown_in_menu: false
59 # fragment: default null, if set must reference one of the existing fragments; see fragments.md for further details.
60 fragment: null
61 position: 0
62 # channels: enabled Sylius channels by code
63 channels: [ 'FASHION_WEB', 'IT_FASHION_WEB' ]
64 categories: [ ]
65 recommended_pages: []
66 # publish_from: can be null or a vald argument for DateTime constructor
67 publish_from: null
68 # publish_to: can be null or a vald argument for DateTime constructor
69 publish_to: null
70 translations:
71 en_US:
72 slug: 'homepage'
73 preview_title: Homepage
74 preview_description: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur finibus justo ac aliquam fermentum. Duis eget tempus lorem. Sed congue nisl quis urna accumsan eleifend. Quisque a euismod risus, venenatis luctus urna. Vivamus at tempor nisl, mollis suscipit mauris. Cras imperdiet velit sapien, sed tincidunt velit fringilla eget. Fusce vehicula felis eu sem finibus, a lacinia turpis laoreet. Mauris a nibh sagittis, lacinia magna id, semper mauris. Interdum et malesuada fames ac ante ipsum primis in faucibus. Duis vitae turpis eu diam venenatis imperdiet vel et est. Quisque auctor magna enim, non ornare orci maximus vel.
75 og_title: homepage
76 og_description: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
77 seo_title: homepage
78 seo_description: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
79
80 blog_page:
81 admin_title: Blog page
82 image: 'placeholder-image'
83 is_enabled: true
84 is_homepage: true
85 is_shown_in_menu: false
86 # fragment: default null, if set must reference one of the existing fragments; see fragments.md for further details.
87 fragment: null
88 position: 0
89 # channels: enabled Sylius channels by code
90 channels: [ 'FASHION_WEB', 'IT_FASHION_WEB' ]
91 # categories: create a relation with those categories whose admin_title matches the SQL query "LIKE %Blog%"
92 categories: [ 'Blog' ]
93 # categories: create a relation with those pages whose admin_title matches the SQL query "LIKE %Homepage%"
94 recommended_pages: [ 'Homepage' ]
95 # publish_from: can be null or a vald argument for DateTime constructor
96 publish_from: 'now'
97 # publish_to: can be null or a vald argument for DateTime constructor
98 publish_to: '+30 days'
99 translations:
100 en_US:
101 slug: 'blog-page'
102 preview_title: Blog page
103 preview_description: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur finibus justo ac aliquam fermentum. Duis eget tempus lorem. Sed congue nisl quis urna accumsan eleifend. Quisque a euismod risus, venenatis luctus urna. Vivamus at tempor nisl, mollis suscipit mauris. Cras imperdiet velit sapien, sed tincidunt velit fringilla eget. Fusce vehicula felis eu sem finibus, a lacinia turpis laoreet. Mauris a nibh sagittis, lacinia magna id, semper mauris. Interdum et malesuada fames ac ante ipsum primis in faucibus. Duis vitae turpis eu diam venenatis imperdiet vel et est. Quisque auctor magna enim, non ornare orci maximus vel.
104 og_title: Blog page
105 og_description: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
106 seo_title: Blog page
107 seo_description: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
108
109 degditor_block:
110 options:
111 blocks:
112 homepage_all_attributes_block:
113 admin_title: 'HP - All attributes block'
114 position: 0
115 # parent: leave null if this is a root block, otherwise reference a parent by using its yaml key
116 parent: null
117 # categories: create a relation with that page whose admin_title matches the SQL query "LIKE %Homepage%"
118 page: 'Homepage'
119 type: 'all_attributes_block'
120 translations:
121 en_US:
122 # attributes: a json_encoded set of attributes (it's recommended to copy and paste them from DB)
123 attributes: "{\"aspect_ratio\":\"ratio ratio-1x1\",\"boolean\":true,\"border_color\":\"border-primary\",\"border_width\":\" \",\"link\":{\"id\":\"14\",\"entity\":\"product\"},\"markup\":\"<p dir=\\\"ltr\\\"><span style=\\\"white-space: pre-wrap;\\\">Lorem ipsum.<\\/span><\\/p>\",\"input_text\":\"Lorem ipsum.\",\"input_number\":\"123\",\"input_url\":\"https:\\/\\/google.com\",\"color\":\"#ff0000\",\"product\":\"14\",\"taxon\":\"9\",\"page\":\"1\",\"category\":\"1\",\"image_source\":1}"
124
125 homepage_all_attributes_child_block:
126 admin_title: 'HP - All attributes child block'
127 position: 0
128 # parent: leave null if this is a root block, otherwise reference a parent by using its yaml key
129 parent: homepage_all_attributes_block
130 # categories: create a relation with that page whose admin_title matches the SQL query "LIKE %Homepage%"
131 page: 'Homepage'
132 type: 'all_attributes_block'
133 translations:
134 en_US:
135 # attributes: a json_encoded set of attributes (it's recommended to copy and paste them from DB)
136 attributes: "{\"aspect_ratio\":\"ratio ratio-1x1\",\"boolean\":true,\"border_color\":\"border-primary\",\"border_width\":\" \",\"link\":{\"id\":\"14\",\"entity\":\"product\"},\"markup\":\"<p dir=\\\"ltr\\\"><span style=\\\"white-space: pre-wrap;\\\">Lorem ipsum.<\\/span><\\/p>\",\"input_text\":\"Lorem ipsum.\",\"input_number\":\"123\",\"input_url\":\"https:\\/\\/google.com\",\"color\":\"#ff0000\",\"product\":\"14\",\"taxon\":\"9\",\"page\":\"1\",\"category\":\"1\",\"image_source\":1}"
137
138 blog_page_all_attributes_block:
139 admin_title: 'Blog - All attributes block'
140 position: 0
141 parent: null
142 page: 'Blog page'
143 type: 'all_attributes_block'
144 translations:
145 en_US:
146 # attributes: a json_encoded set of attributes (it's recommended to copy and paste them from DB)
147 attributes: "{\"aspect_ratio\":\"ratio ratio-1x1\",\"boolean\":true,\"border_color\":\"border-primary\",\"border_width\":\" \",\"link\":{\"id\":\"14\",\"entity\":\"product\"},\"markup\":\"<p dir=\\\"ltr\\\"><span style=\\\"white-space: pre-wrap;\\\">Lorem ipsum.<\\/span><\\/p>\",\"input_text\":\"Lorem ipsum.\",\"input_number\":\"123\",\"input_url\":\"https:\\/\\/google.com\",\"color\":\"#ff0000\",\"product\":\"14\",\"taxon\":\"9\",\"page\":\"1\",\"category\":\"1\",\"image_source\":1}"
148
149
Three, two, one...
Ready for DegDitor?
Try the plugin
Experience the best features at no cost
Get a better understanding of DegDitor and how it works
Test it risk-free and see the results
Get a demo
Get a personalized demo tailored to your unique needs
Preview our pricing plans
Evaluate DegDitor against your requirements
We are here for you
After months of intense development, it’s time to put DegDitor to work. For feedback, questions or information please contact us!
Contact us