Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
651 views
in Q2A Core by
edited by

On questions, where it shows the date there is a span element with a time (assuming it's UTC format). But there is nothing inside the element and the actual date ("1 week ago" etc) is outside it. Here's a sample:

<span class="qa-q-view-when">
  <span class="qa-q-view-when-data">
    <span class="published">
      <span class="value-title" title="2011-07-12T18:10:37+0000"></span>
      1 week
    </span>
  </span>
  <span class="qa-q-view-when-pad"> ago</span>
</span>

Also, do we really need so many HTML tags for just 3 words? Why not something like the below? EDIT: better example containing all the classes:

<span class="qa-q-view-when published">
    <span class="qa-q-view-when-data value-title" title="2011-07-12T18:10:37+0000">1 week</span>
    <span class="qa-q-view-when-pad"> ago</span>
</span>

Wouldn't that be better? Here you get to keep all the microformats while trimming useless HTML tags, and fixing the bug with the exact time not appearing when hovering the 'fuzzy time'.

However, I'm not 100% sure if it's possible to have the 'published' class only on the 'qa-q-view-when' tag, since that part is generated in one generic function (it seems to add published to the 'qa-q-view-when-data' tag as well).

Q2A version: 1.5.1

2 Answers

0 votes
by

It's due to the incorporation of microformats information into the question page, while also applying the -data and -pad CSS class pattern used in many other places.

If this stuff is annoying, you can remove it by setting 'microformats' => false in the array in qa_post_html_defaults(...) in qa-app-options.php.

by
But doesn't my example cover everything? Apart from `-data` which you could add to the `published` span. Then you have all the appropriate classes without the 4 nested levels of tags.
by
Just coming back to this now. I've updated my question with a better solution, do you think that would work better?
0 votes
by

[response to the updated question]

It would be possible to do this, but it would mean mixing more of the part of Q2A that generates the microformats into that part of the theme class that generates the -data and -pad tags. At the moment these are completely separated.

...