libreliodev / wordpress

Librelio Wordpress plug-in
0 stars 1 forks source link

Improve shortcodes for plists #31

Closed libreliodev closed 9 years ago

libreliodev commented 9 years ago

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:

AlirezaAlgo commented 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]
libreliodev commented 9 years ago

@serverfire

So the shortcode will get repeated for each plistitem.

Yes.

How about implementing foreach for shortcodes

Great suggestion, thanks.

AlirezaAlgo commented 9 years ago

@libreliodev

How about implementing foreach for shortcodes

Great suggestion, thanks.

We're not going to use the suggestion. Are we?

libreliodev commented 9 years ago

@serverfire

How about implementing foreach for shortcodes

Great suggestion, thanks.

We're not going to use the suggestion. Are we?

Yes, we are!

AlirezaAlgo commented 9 years ago

@libreliodev Done. Tested with /Magazines.plist. With following template.

[librelio foreach="document as item"]
[librelio id="item.FileName"]
[librelio endforeach]
libreliodev commented 9 years ago

@serverfire Successfully tested with cloudsearchdetail.php?waurl=/dph/dph.plist&watemplate=hebdos