Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
That depends on what you mean by custom… If you're making your own field in code, you could ostensibly just load and use the Typogrify class in the field formatter.
Here's an example use case: You have a content type for events with a CCK date field. You're displaying the dates with AM/PM appended and you really wish those were spanned with a class so you could shrink them down. (Looks particularly terrible in fonts like Georgia where the numbers are tiny and the caps ARE HUGE.)
But the complexities of the date module make it hard to do this through the field template (which seemed like the most logical way) because of the possibilities of a date range and the PHP date formatting choices for each piece of the date. It seems to me you'd need a module that works with Date module and allows you to insert HTML classes into the date as it's being built and frankly that's far above my developer skills.
So if there were a way to apply Typogrify to a field like this, that would be great. Do you have an example of "loading and using the Typogrify class in the field formatter"? I am reasonably good at modifying existing code but don't have any idea how one would do this from scratch.
Thanks. This is a great module and makes those of us with designer/typographer sensibilities very happy.
Comments
Comment #1
miklThat depends on what you mean by custom… If you're making your own field in code, you could ostensibly just load and use the Typogrify class in the field formatter.
Comment #2
adam_b commentedSubscribe... I'd like this too, and there's no way I'm making my own field in code ;)
Comment #3
miklWell, please specify what it is you want then :)
Comment #4
brightboldHere's an example use case: You have a content type for events with a CCK date field. You're displaying the dates with AM/PM appended and you really wish those were spanned with a class so you could shrink them down. (Looks particularly terrible in fonts like Georgia where the numbers are tiny and the caps ARE HUGE.)
But the complexities of the date module make it hard to do this through the field template (which seemed like the most logical way) because of the possibilities of a date range and the PHP date formatting choices for each piece of the date. It seems to me you'd need a module that works with Date module and allows you to insert HTML classes into the date as it's being built and frankly that's far above my developer skills.
So if there were a way to apply Typogrify to a field like this, that would be great. Do you have an example of "loading and using the Typogrify class in the field formatter"? I am reasonably good at modifying existing code but don't have any idea how one would do this from scratch.
Thanks. This is a great module and makes those of us with designer/typographer sensibilities very happy.
Comment #5
brightboldHere's a discussion on Typogrifying the title field. I haven't tried this yet but for anyone else who's looking for this: #358882: Typogrify in title.