Closed libreliodev closed 9 years ago
@libreliodev So the shortcode will get repeated for each plistitem. I believe it should have a format for displaying content. Something like this.
<div class="plistitem">
<h3>Title</h3>
<p>Subtitle</p>
</div>
Is it true?
And also i have suggestion. How about implementing foreach for shortcodes. Where format is up to the document. Something like this.
[librelio foreach="plistDocument as item"]
<div class="plistitem">
<h3>[librelio id="item.Title"]</h3>
<p>[librelio id="item.Subtitle"]</p>
</div>
[librelio endforeach]
@serverfire
So the shortcode will get repeated for each plistitem.
Yes.
How about implementing foreach for shortcodes
Great suggestion, thanks.
@libreliodev
How about implementing foreach for shortcodes
Great suggestion, thanks.
We're not going to use the suggestion. Are we?
@serverfire
How about implementing foreach for shortcodes
Great suggestion, thanks.
We're not going to use the suggestion. Are we?
Yes, we are!
@libreliodev Done.
Tested with /Magazines.plist
.
With following template.
[librelio foreach="document as item"]
[librelio id="item.FileName"]
[librelio endforeach]
@serverfire Successfully tested with cloudsearchdetail.php?waurl=/dph/dph.plist&watemplate=hebdos
In #14, we implemented short codes for external files.
If external file is a plist, we will usually have an array at the root level and not a dictionary. We need to make improvements:
div
withclass="plistitem"
Title,
Subtitleand
Dontcare, using short code
[librelio id="Title,Subtitle"]should display the Title and Subtitle, but not
Dontcare`