I originally posted this issue in (http://drupal.org/node/774854).

I am using pathauto to create the node alias, and all of that is working correctly. I'm using Token to get the node alias into Mobile Codes and the image is being created. But the one problem I'm having is with Views, once I want to use the field that contains the url information that generates the qr code, it stops after the "/" in the url and produces a new qr code for the domain only.

So to clarify.

The CCK field produces a qr code that leads to: http://example.com/2232 - that's what i want.

But when brought over into views a new qr code is created for: http://example.com/

Everything after the slash is dropped, so the url alias is missing only on the view. It's weird, it's as if Mobile Codes produces a new qr code everytime the node is accessed.

Comments

Anonymous’s picture

Category: task » support

Mobile Codes store image on a specific files/mobile_codes directory.
Then you can answer your question "Mobile Codes produces a new qr code everytime the node is accessed".

Things I have in mind :

  1. check if in Views you select the right data : maybe there are specific things reagrding URL alias handling
  2. consult Views module page, looking ticket regarding URL alias
newToo’s picture

I think I discovered it. Views (or Mobile Codes w/views?) may only recognize "Global" tokens and not "Node" tokens. I did a test and only used global tokens. the qr code remained the same in Views and included the "slash" ...

example: http://example.com/1 (that's how the test should have looked)

So now my question is how can I access the "author-uid" and "nid" as global tokens? I'm using the code you replied with to create a custom token "token_custom_mobilecode" and chose the "Global" type option....


<?php
   global $base_url;

   # compute node alias
   $node_alias = $base_url.url("node/$node->nid");  

   # render QR Code
   print theme('mobilecode', $node_alias, array('preset' => 'default'));
?>

But the image only produces "http://example.com/node/" the nid portion is cut off.

mwhalen’s picture

hi there,
Im using mobile codes via cck, and was wondering how to get the pathauto output into mobile tools using tokens as you have.
I have pathauto, mobile codes and token working, but have to manually input the url when i create a node.
Any chance of a mini guide of what you have done so far?
Thanks from a noob!
mikey

deciphered’s picture

Status: Active » Fixed

New version of Mobile Codes should resolve the actual Mobile Codes related parts of this issue.

Status: Fixed » Closed (fixed)

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