Quantcast
Channel: Question and Answer » formatters
Browsing all 10 articles
Browse latest View live

How to theme a field formatter?

Context: using the registration module, I am trying to customize the entity registration form depending on the user: show a ‘please login in order to register’ to anonymous visitors show a ‘edit...

View Article



Image may be NSFW.
Clik here to view.

Which settings to use in hook_field_formatter_view?

Looking at the page of hook_field_formatter_view, the explanation for $display is: The display settings to use, as found in the ‘display’ entry of instance definitions. The array notably contains the...

View Article

Creating a Custom Formatter to replace a Link with an Icon / Image

I would like to replace links in a view I have created with icons. The links are dynamic(varying URLS) but will be be within 5 domains, eg: www.example.com/page7 www.example.com/page2...

View Article

Get Node ID in hook_field_formatter_view()

I’m currently working in a custom video player. For that I’ve created a content type which uses a field_collection (for the video file and other stuff) and a field_caption for a XML file. The video...

View Article

Image may be NSFW.
Clik here to view.

Multiple formatters for a field collection – best approach?

I’m building a site with a “function” content type, to manage a list of functions and their arguments. Because arguments can be zero or more, and have multiple properties (name, required, usage notes)...

View Article


Custom field formatter to create byline?

I’m using the taxonomy module for authors on a site, which is sometimes recommended as a flexible way to store and display author information, since it makes it easy to list content by author. For some...

View Article

Custom field widget that displays a button with JS action and a hidden textbox

I have no background in working with the Drupal API, so answers will have to explain it like I’m a child. I am trying to create a custom field module. The widget should show a button with JS onClick...

View Article

Image may be NSFW.
Clik here to view.

Views: how to remove ending zeros from decimal field

Suppose, we have a view with a decimal field: It is output like this: 5 000.000 Is it possible to remove the ending zeros, so it looked like this: 5 000 But if there are meaningful values in the field,...

View Article


Preventing users from registering with xxx@yyy format email address

Drupal seems to let users register with emails like xxx@yyy I heard that this kind of email address can exist. But I want users to register with only emails like xxx@yyy.zzz Is there any way to...

View Article


Download file field dependent on user role vs role field values

I have a type downloadable_item which has a field field_roles_allowed that is based on the Role Field Module. My goal is to have a field_download of file type that will show the file for download if...

View Article
Browsing all 10 articles
Browse latest View live




Latest Images