Hi!

I'm using Drupal 7. I got a text field telephone_number which of course stores phone numbers. In display mode I would like its contents to be displayed as a Colorbox Link which opens the relative autogenerated QR Code.

The Input Filter relative to the QR Code I would like to display is

[mobilecodes type="qr" data="phone" size="medium" name="Text here" tinyurl="0"]<strong>content</strong>[/mobilecode]

I though of Custom Formatters to modify how the field contents are displayed, to generate a Colorbox Link.

But I cannot figure out how to redirect the Colorbox to the autogenerated QR code.

May anyone please help me? :)

Comments

Deciphered’s picture

To generate a Mobile Code via an Advanced (PHP) Custom Formatter you would need to use the theme() function not the Filter format.

lsolesen’s picture

Status: Active » Postponed (maintainer needs more info)

What do you mean by redirect colorbox to autogenerated QR Code? Do you mean show the generated code in a colorbox? Please clarify your question, and maybe supply a screenshot on what result you are looking for.

cesareaugusto’s picture

What do you mean by redirect colorbox to autogenerated QR Code? Do you mean show the generated code in a colorbox? Please clarify your question, and maybe supply a screenshot on what result you are looking for.

I try to explain it step by step. I got eg. a phone field. I would like to display it as a linked text. The text would be the field content itself. The link would open a colorbox with the QR code display of the same field.

Eg. I got a phone field whose content is "+393481234567". That should be displayed as a link. Clicking on that link would open a Colorbox with the QR code of "+393481234567".

How could I reproduce it?

Deciphered’s picture

Status: Postponed (maintainer needs more info) » Active

I've written a Custom Formatter for you which I believe will do what you're after, it uses the Colorbox, Mobile Codes and Phone modules to render a Phone field as a link to a Colorbox popup containing the QR Code.

You can find the code at http://customformatters.com/formatters/18/phonetoqr, either use the code, import the exportable into Custom Formatters or use the Drupal API version (after renaming the hooks).

Cheers,
Deciphered.

lsolesen’s picture

Status: Active » Fixed

@Deciphered Thanks for the answer. Setting status to fixed.

Status: Fixed » Closed (fixed)

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

javdich’s picture

I know this is already set as closed, but I'm trying to print the QR code directly to the page instead of using the colorbox as per your example at http://customformatters.com/formatters/18/phonetoqr

Im using the example code for now and its working, but the link to bring up the qr code is just one extra step, which I would like to eliminate. Any help would be much appreciated.

Kind Regards.

cesareaugusto’s picture

@Deciphered: Would it be possible to add the international code to the QR? At present it parses only the number itself, no international prefix...