Paste the content of the plugin file under the Admin > Plugins, upload it and install;

July 7, 2016 · View on GitHub

h1. oui_quote

Easily display your own quote or pull one from the following services:

"Download":https://github.com/NicolasGraph/oui_quote/releases | "Donate":https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=PREHX3MZMXEUN

h2. Table of contents

  • "Plugin requirements":#requirements
  • "Installation":#installation
  • "Preferences":#prefs
  • "Tags":#tags ** "oui_quote":#oui_quote ** "oui_quote_body":#oui_quote_body ** "oui_quote_author":#oui_quote_author ** "oui_quote_cite":#oui_quote_cite
  • "Examples":#examples ** "Single tag":#single_tag ** "Container tag":#container_tag
  • "Author":#author
  • "Licence":#licence

h2(#requirements). Plugin requirements

oui_quote’s minimum requirements:

  • Textpattern 4.6+

h2(#installation). Installation

Paste the content of the plugin file under the Admin > Plugins, upload it and install;

Click Options or visit your Admin>Preferences tab to fill the plugin prefs.

h2(#prefs). Preferences / options

  • ServiceDefault: none - The service you want to use to pull the quote;
  • QuoteDefault: unset - The quote in use (automatically filled if a service is selected);
  • ReferenceDefault: unset - The reference of the quote in use (automatically filled by Le Monde only);
  • AuthorDefault: unset - The author of the quote (automatically filled if a service is selected);
  • UrlDefault: unset - The url of the quote source (automatically filled if a service is selected);
  • Cache timeDefault: 60 - Duration of the cache in minutes; avoid too many external queries.

h2(#tags). Tags

h3(#oui_quote). oui_quote

bc. <txp:oui_quote />

or

bc. txp:oui_quote […] </txp:oui_quote>

Displays the quote.

h4. Attributes

(Alphabetical order)

  • @class="…"@ – Default: unset - The css class to apply to the HTML tag assigned to @wraptag@.
  • @label="…"@ – Default: unset - The label used to entitled the generated content.
  • @labeltag="…"@ - Default: unset - The HTML tag used around the value assigned to @label@.
  • @service="…"@ - Default: 1 if a service is selected, or 0 - display the name/link of/to the service from which the quote was pulled (usually required, read terms and conditions of use of the service in use);
  • @wraptag="…"@ - Default: figure (see "here":http://alistapart.com/blog/post/more-thoughts-about-blockquotes-than-are-strictly-required) - The HTML tag to use around the generated content.

h3(#oui_quote_body). oui_quote_body

bc. <txp:oui_quote_body />

Displays the body of the quote.

h4. Attributes

(Alphabetical order)

  • @class="…"@ — Default: unset - The css class to apply to the @img@ HTML tag or to the HTML tag assigned to @wraptag@.
  • @wraptag="…"@ — Default: blockquote - The HTML tag to use around the generated content.

h3(#oui_quote_author). oui_quote_author

bc. <txp:oui_quote_author />

Displays the author.

h4. Attributes

(Alphabetical order)

  • @class="…"@ — Default: unset - The css class to apply to the HTML tag assigned to @wraptag@.
  • @wraptag="…"@ — Default: span - The HTML tag to use around the generated content.

h3(#oui_quote_cite). oui_quote_cite

bc. <txp:oui_quote_cite />

Displays the refernce of the quote and the service from which it was pulled. If an the url preference is filled, it will wrap the service or the source into a link.

h4. Attributes

(Alphabetical order)

  • @class="…"@ — Default: unset - The css class to apply to the HTML tag assigned to @wraptag@.
  • @service="…"@ - _Default: 1 (inherited from the container tag) - display the name/link of the service from which the quote was pulled (usually required, read terms and conditions of use of the service in use);
  • @wraptag="…"@ — Default: cite - The HTML tag to use around the generated content.

h2(#examples). Examples

h3(#single_tag). Example 1: single tag use

bc. <txp:oui_quote label="Citation du jour" labeltag="h1" />

when used with Le Monde will return:

bc..

Citation du jour

Ce n'est pas parce-que vous êtes nombreux à avoir tort que vous avez raison.

Bernard Werber Le Mystère des dieux (2007) via Le Monde

h3(#container_tag). Example 2: container tag use

The previous example with the use of a container tag would look like:

bc. <txp:oui_quote label="Citation du jour" labeltag="h1"> <txp:oui_quote_body />

<txp:oui_quote_author /> <txp:oui_quote_cite />
</txp:oui_quote>

h2(#author). Author

"Nicolas Morand":https://github.com/NicolasGraph Thank you to the Textpattern community and the core team.

h2(#licence). Licence

This plugin is distributed under "GPLv2":http://www.gnu.org/licenses/gpl-2.0.fr.html.