Closed libreliodev closed 9 years ago
@libreliodev
Done.
Tested with the following Template for /drpat/drpat-2015-0243_20150428/toc_20150428.plist
.
Librelio
"My Title"=[librelio id="Header.Title"]
"Date"=[librelio id="date('Y-m-d', Header.Date)"]
[librelio foreach="document as item"]
[librelio id="item.Title"]
___________________________
[librelio endforeach]
And with following template for /dph/dph-2015-1001_20150309/toc_20150309.plist
.
Librelio
[librelio foreach="document as item"]
[librelio id="item.Title"]
___________________________
[librelio endforeach]
@serverfire
Tested as you suggested with http://www.droit-patrimoine.fr/librelio.php?watemplate=sommaire&waurl=/drpat/drpat-2015-0243_20150428/toc_20150428.plist
This returns an error Object does not contain property: Header
Also tested with http://www.droit-patrimoine.fr/librelio.php?watemplate=sommaire&waurl=/dph/dph-2015-1009_20150504/toc_20150504.plist
This returns the same error
@libreliodev Apparently this file is changed.
/drpat/drpat-2015-0243_20150428/toc_20150428.plist
.
I uploaded another plist file in there. Now the error has changed to Object does not contain property: FileName
.
Please change template as follows.
[librelio id="item.Title"]
In #31, we implemented iterator for plists. This assumes that the root element of the plist is an array.
Now, in some cases, we need to have a header.
In this case, the structure of the file will be as follows
The parser should iterate the "Items" element.
It should be possible to access the header elements using a syntax such as "Header.Title"
Also, please pay attention to the fact that we need to be able to keep using legacy plists, with Array at the root level.