Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-10-30 01:04:32

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,434
Website GitHub

smd_pullquote: Magazine-style quotes from article text

For those who like magazine-style pullquotes, this could be right up your street. Features:

  • No need to handle two separate bits of text for quotes: using HTML markup you tell the plugin which bits of your article body are to be displayed and styled separately
  • Words from the full body text can be cut from the quotes to make them shorter; omitted words are replaced with characters of your choice
  • Display one or more quotes randomly from a page, optionally removing the originals
  • Position the quotes anywhere you like via CSS, or use rudimentary maths to keep the quote near to its source on the page
  • MLP-aware

It uses jQuery to do its magic so you’re better off with v4.0.5 or later of textpattern. Even so, it might be an idea to get the latest version of jquery because it’s not been tested on anything below v1.2.1. Let me know if it works on earlier versions.

It also requires smd_lib.

Have a play with it and see how you get on. Send any enhancement requests, naughty bugs, features or general comments here and I’ll see if I can make it more useful as time goes on.

Download smd_pullquote

Revision history
————————

  • 30 Oct 07 | 0.1 | Initial release
  • 02 Nov 07 | 0.1a | Removed bogus leading slash on <script> tag. Thanks sgoodwin

Last edited by Bloke (2009-04-11 21:15:15)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#2 2007-10-30 09:55:18

sthmtc
Member
From: CGN, GER
Registered: 2005-01-17
Posts: 586
Website

Re: smd_pullquote: Magazine-style quotes from article text

sounds great! bookmarking it for future reference.

Offline

#3 2007-10-30 10:04:47

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,078
Website GitHub Mastodon Twitter

Re: smd_pullquote: Magazine-style quotes from article text

Bloke wrote

it might be an idea to get the latest version of jquery…

… which unfortunately crashes safari 1.3.x for OSX.3.x

Last edited by colak (2007-10-30 10:05:10)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#4 2007-10-30 10:10:19

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,434
Website GitHub

Re: smd_pullquote: Magazine-style quotes from article text

colak wrote:

the latest version of jquery… unfortunately crashes safari 1.3.x for OSX.3.x

Boooo :-( Well you might get away with an earlier version. I don’t think I’m using anything bleeding edge from the library. Try whichever version you have that’s stable on OSX and let me know how it fares. If the plugin breaks I could always see if I can find a way round it using an older syntax.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#5 2007-10-31 14:43:11

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: smd_pullquote: Magazine-style quotes from article text

great job, thanks again Stef.

Offline

#6 2007-11-02 14:57:29

sgoodwin
Member
From: Boston, MA
Registered: 2006-05-11
Posts: 13

Re: smd_pullquote: Magazine-style quotes from article text

I had to edit line 40 of the plugin to get it to work for me… I removed an extra slash before “text” on the script type attribute:

BEFORE: $ret .= '<script type="/text/javascript" src="'.$jquery.'"></script>';
AFTER: $ret .= '<script type="text/javascript" src="'.$jquery.'"></script>';

and now it works just great!!! Thank you Stef!

Offline

#7 2007-11-02 15:08:57

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,434
Website GitHub

Re: smd_pullquote: Magazine-style quotes from article text

sgoodwin wrote:

I removed an extra slash before “text” on the script type attribute

Ooops, well spotted. Code updated to v0.1a. Can’t have bugs in it now can we!

Thanks.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#8 2008-01-07 23:31:06

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: smd_pullquote: Magazine-style quotes from article text

Can i see the demo work of this plugin? :)


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

#9 2008-01-07 23:37:22

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,434
Website GitHub

Re: smd_pullquote: Magazine-style quotes from article text

nemotv

The pullquotes on the left are randomly generated from predefined bits of content within the “screen” (refresh the page to see more)

EDIT: look at the source code and search for class="pq" to see the way the quotes are defined.

Last edited by Bloke (2008-01-07 23:39:42)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#10 2009-08-18 11:13:02

candyman
Member
From: Italy
Registered: 2006-08-08
Posts: 684

Re: smd_pullquote: Magazine-style quotes from article text

Is there the possibility to use a custom field to tell the plugin which text should pulled out of the post into its own element so that I can style it as quotation?

I’ve read the docs but I haven’t understood how can I easily choose the text for quotations from the article body in the TXP write page.

Thanks for your help.

Last edited by candyman (2009-08-18 11:48:40)

Offline

#11 2009-08-19 08:20:34

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,434
Website GitHub

Re: smd_pullquote: Magazine-style quotes from article text

candyman wrote:

Is there the possibility to use a custom field to tell the plugin which text should pulled out of the post into its own element

No. The plugin uses inline markup in your body to indicate what is a quote. By default, wrap a portion of your body text in <span class="pq">...</span> and it will be used as a quote.

However, the idea of using a custom field is intriguing. I can half see an application where you define a custom field and simply paste your quotes in there for the plugin to extract and render as markup. But the other half of me says it’s unnecessary because you could a) do that manually anyway with built-in tags, b) use smd_random_text to pull your quotes out of the custom field.

If you mean that the custom field could contain an HTML DOM ID or CSS class name of elements in that article to extract as quotes, that’s doable but why would you want different pullquote markup per article? What usage did you have in mind?

P.S. I have an updated version that removes the stupid jquery and jq_clashvar attributes. The plugin was written before jQuery was part of the core and before I understood how to use it properly! If your idea makes sense I’ll roll it into this version and release it.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#12 2009-08-19 09:17:32

candyman
Member
From: Italy
Registered: 2006-08-08
Posts: 684

Re: smd_pullquote: Magazine-style quotes from article text

I have in mind a http://txpq.com/ version of quotes (they use custom fields) with the code provided by a plugin and not pasted into the site code.
Next step is the use of a colorpicker to choose the coordinated colour of the code.

Thank you for your attention.

p.s.: where can I find the updated version?

Last edited by candyman (2009-08-19 09:20:38)

Offline

Board footer

Powered by FluxBB