It should be simple enough to use a <blockquote> tag instead of <div>. This would avoid conflict with HTML filters (if they are configured to allow blockquotes, which are slightly more benign than divs). It would also be more semantically correct, and therefore better for accessibility. It's also possible to use a valid HTML format to store the citation information, by having the option to use:

<blockquote title="Username" cite="http://link-to-post">Quoted stuff</blockquote>

...instead of [quote]. This would allow the user input to be more consistent when using an HTML input format.

CommentFileSizeAuthor
#3 quote_change_div_to_blockquote.1.patch2.54 KBJaypan
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mallory99’s picture

Good suggestion. I'd like to see this, too.

meustrus’s picture

I would like to clarify the last part of my suggestion some. I'm suggesting that the input filter accept two formats, the normal [quote=Username] format, and a new <blockquote title="Username"> format. There would be an option in the module configuration as to which format would be generated by "Quote" buttons under comments.

Both formats should result in the same code after formatting:

[quote=Username]Quoted stuff[/quote]
OR
<blockquote title="Username">Quoted stuff</blockquote>
becomes
<blockquote title="Username" class="quote-msg"><div class="quote-author">Username</div>Quoted stuff<blockquote>

The HTML filter could also have a link-back feature, like so:

<blockquote title="Username" cite="http://link-to-stuff">Quoted stuff</blockquote>
becomes
<blockquote title="Username" cite="http://link-to-stuff" class="quote-msg"><div class="quote-author">Username<a href="http://link-to-stuff" class="quote-cite"><span>Link to cited content</span></a></div>Quoted stuff<blockquote>

Then there would be CSS for .quote-cite would be something like:

  .quote-cite {
    display: block;
    float: right;
    background: url('cite.gif') no-repeat 50% 50%;
    width: 10px;
    height: 10px;
  }
  .quote-cite span {
    display: none;
  }

That would replace the citation link with "cite.gif" (which is 10x10 pixels) and remove the accessibility text.

Hopefully this new feature would not just be an accessibility bonus, but also lead to a simple way to create new features (like the citation link). However, just changing the <div> to a <blockquote> would not require all this work, and is a useful accessibility feature in the interim.

Jaypan’s picture

Ive just created a patch that gives an option on the settings page to change from divs to blockquotes (in order to preserve legacy, I set it as divs by default). I didn't include the 'cite' attributes however, as I wanted to keep the patch fairly simple, and that would have required re-writing the preprocess function to pass the theme function a link to the original post.

I did upload another patch earlier today however that does generate this link and pass it to the theme function. Combining the two patches would enable the cite attribute to be added quite easily.

I'm attaching the patch.

Jaypan’s picture

As a side note, for an interim solution, you can solve this problem by overriding the theme function in your site theme. Add the following code to your template.php file (Drupal 6)

Use this code:

function [THEME_NAME]_quote($quote_content, $quote_author) {
  $quote_output = '<blockquote class="quote-msg">';
  if ($quote_author != '') {
    $quote_output .= '<div class="quote-author">'. t('%name wrote:', array('%name' => $quote_author)) .'</div>';
  }
  else {
    $quote_output .= '<div class="quote-author">'. t('Quote:') .'</div>';
  }
  $quote_output .= $quote_content;
  $quote_output .= '</blockquote>';

  return $quote_output;
}

Where [THEME_NAME] is the name of the theme on your site. Make sure to clear the cache on your site or these changes will not take effect.

meustrus’s picture

Thanks for the progress. How about my idea of the [quote] button generating <blockquote> tags instead of [quote] tags? Is that a good idea or a bad idea?

Jaypan’s picture

That's what this patch gives the option of doing.

meustrus’s picture

I don't mean instead of div's, I mean the "quote" link under a post inserts <blockquote> directly into the comment instead of inserting [quote]. While using instead of div's in the actual theming fixes the accessibility issue, this additional (more complicated) option would make the Quote button's output fit with HTML-based filters.

Jaypan’s picture

Ahh, I see what you mean.

Actually, now that you mention that, I'd prefer that as well!

Zen’s picture

Version: 6.x-1.1-beta2 » 7.x-1.x-dev
Assigned: Unassigned » Zen

The optional mark-up option is interesting. Many, many moons ago, nested blockquotes was not considered to be valid HTML. I will retest shortly.

Cheers,
-K

Everett Zufelt’s picture

From #2

  .quote-cite span {
    display: none;
  }

That would replace the citation link with "cite.gif" (which is 10x10 pixels) and remove the accessibility text.

setting an element to display:none makes it completely inaccessible to all, including screen-reader and other assistive technlogy users.

Also, putting information in the e@site attribute makes the content completely inaccessible to (well pretty much anyone). As long as this is duplicated as a link in the content of the bq then it shouldn't be a problem for accessibility.

Worth reading http://html5doctor.com/blockquote-q-cite/

Zen’s picture

I've committed the blockquote change to D7. Nested quotes work well and validate fine. I'll introduce the cite attribute once #911952: Link to quoted post is resolved.

Looking at the html5doctor link as per #10, what are your opinions on defaulting to a "footer" style attribution? Obviously using the <footer> element is out. But we could nevertheless move the DIV to the bottom.

This patch will eventually make it through to 6-2.

Thanks,
-K
P.S. Leaving this open for the time being.

Everett Zufelt’s picture

My gut feeling, based on no data, is that attribution is almost always at the end of a quote, at least in north american english quotations.

Zen’s picture

True. But are node and comment quotes on a par with "literary" quotes? Rather than to embed quotes within content per se, the default use of this module is to quote content in order to reply to it (a la e-mail conversations).

Everett Zufelt’s picture

In that case, it would seem to me that citation at the top of the quote is best.

mermemladeK’s picture

I though this functionality was committed 2 years ago... is it still going to be in the module?

fugazi’s picture

I'm also interested is this still upgraded

ivnish’s picture

Assigned: Zen » Unassigned
Issue summary: View changes
Status: Active » Needs review
ivnish’s picture

Fixed in the new 2.x branch

ivnish’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.