File tree Expand file tree Collapse file tree 4 files changed +18
-9
lines changed Expand file tree Collapse file tree 4 files changed +18
-9
lines changed Original file line number Diff line number Diff line change
1
+ ## 1.0.5 - 2023-06-08
2
+ ### Changed
3
+ - ` atoms ` config option now supports an array of paths
4
+
1
5
## 1.0.4 - 2020-02-15
2
6
### Fixed
3
7
- Fix error when using nested atom name (` / ` ) in closing tag
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " ether/atom" ,
3
3
"description" : " Adding enhanced modularity to Craft CMS Twig templating" ,
4
- "version" : " 1.0.4 " ,
4
+ "version" : " 1.0.5 " ,
5
5
"type" : " craft-plugin" ,
6
6
"license" : " MIT" ,
7
7
"minimum-stability" : " dev" ,
Original file line number Diff line number Diff line change @@ -53,21 +53,25 @@ public static function renderAtom (
53
53
) : void {
54
54
$ view = Craft::$ app ->getView ();
55
55
56
- $ template = self ::$ _config ['atoms ' ] . '/ ' . $ handle ;
56
+ $ atomPaths = self ::$ _config ['atoms ' ];
57
+ if (!is_array ($ atomPaths )) $ atomPaths = [$ atomPaths ];
57
58
58
59
$ variables ['children ' ] = new Markup ($ children , 'utf8 ' );
59
60
60
- if (! $ view -> doesTemplateExist ( $ template ) )
61
+ foreach ( $ atomPaths as $ path )
61
62
{
62
- Craft::error (
63
- "Error locating template: {$ template }" ,
64
- __METHOD__
65
- );
63
+ $ template = $ path . '/ ' . $ handle ;
66
64
67
- return ;
65
+ if ($ view ->doesTemplateExist ($ template )) {
66
+ echo $ view ->renderTemplate ($ template , $ variables );
67
+ return ;
68
+ }
68
69
}
69
70
70
- echo $ view ->renderTemplate ($ template , $ variables );
71
+ Craft::error (
72
+ "Error locating template: {$ handle }" ,
73
+ __METHOD__
74
+ );
71
75
}
72
76
73
77
}
Original file line number Diff line number Diff line change 7
7
* _Defaults to `_atoms`_
8
8
*
9
9
* The location of your atoms, relative to your `templates` directory.
10
+ * Can also be an array of paths, in descending order of priority.
10
11
*/
11
12
'atoms ' => '_atoms ' ,
12
13
];
You can’t perform that action at this time.
0 commit comments