Needs review
Project:
CCK Formatters
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
9 Mar 2010 at 17:58 UTC
Updated:
25 May 2011 at 18:10 UTC
This module, submitted to be a submodule of the cck_formatters collection, provides a formatter which puts span tags around month, day, and year, all wrapped in div with past, current (in next 12 hours), and future.
It comes out looking like this, in an event referencing DrupalCon Paris:
<div class="past"><span class="month">Sep</span><span class="day">25</span><span class="year">2009</span></div>
Well, that's what it looks like in code, it's supposed to look quite a bit better.
Questions for potential users:
- Should there be configuration options (show time, change order of date elements)?
- Should CSS for theming this be included in the module?
(Background, see more than one way to span a date.)
| Comment | File | Size | Author |
|---|---|---|---|
| cck_formatters-spandate-new-module.patch | 2.16 KB | mlncn |
Comments
Comment #1
danny englanderI tried this patch and it works great, however the issue I am still struggling with is when I use this format in views, I still end up with a div inside a span. I have tried various methods to try to remove the span tag but with no luck. In my case it's
<span class="field-content">before the date div that keeps getting me.The rendered HTML as I see it is:
I am thinking I will have to do some views custom .tpl theming or a template.php override to get rid of that field or at least change it to a div.
Comment #2
mlncn commented@highrockmedia - glad it helped! The Semantic CCK module should also be able to clean up the surrounding span for you.
@anyone - Note that the key part of the code could be used in a theme as well as a module.