Closed (fixed)
Project:
Mobile Codes
Version:
6.x-1.x-dev
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
10 Feb 2010 at 23:05 UTC
Updated:
23 Jul 2012 at 15:42 UTC
Is there a way of creating an QR/Datamatrix code on the fly for each node pointing to its own URL?
I find your module very interesting but I find no way to creat the codes dynamically for each node. Maybe some examples in your documentation could help...
Thanks anyway!
psc
Comments
Comment #1
mwhalen commentedI think most people would love this too!
Comment #2
szantog commentedOk, I made it.
Download the module computed_field.
Enable it, then make a computed field cck field.
On field settings page use this code in computed code field:
On Display Fields page set the field display mode "Computed Value".
Comment #3
hixster commentedhey szantog, many thanks for this solution - can you give any pointers for the other computed field settings that might be necessary - I can't seem to get this to work??Got it working after removing the php tags
Comment #4
skizzo commentedAnother option: as I was already using the Rules module, I added a couple of rules
- trigger: on save/update content
- condition: for specific Content Type
- action: populate 'field_mobile_code' with token [node:node-url]
Comment #5
deciphered commentedThere are plenty of other ways to achieve this result, I personally would create a block to do it... which is exactly what I have done in 6.x-2.x.
Enjoy.
Comment #7
itivet commentedI can't find out how to set rules "- action: populate 'field_mobile_code' with token [node:node-url]"
can anyone help me? thx a lot.
Comment #8
skizzo commentedon your rule you should click on "Add an action" and select the action "Populate a field" (from CCK list ). Pick "created content" as argument and select the machine name of the field you want to populate (I use a text field added for that purpose), then enter something like http://www.yoursite.com/node/[node:nid]
Comment #9
skolesnyk commentedSkizzo, not sure I understand why CCK field is of text type? Should that be file type so that generated QR code is saved as a file?
I'm profoundly confused: and where's invocation of Mobile Codes to generate the actual code? I did what you suggested and, obviously, the field is populated with node id. I just don't get.
Comment #10
skizzo commentedOk, the field is populated with the node URL (http://www.yoursite.com/node/nid). Now, the Mobile Codes module "provides the ability to render Text, URLs or any other form of informaton as a Mobile Code", so you only need to pick the right formatter in the CCK field display configuration, and Mobile Codes will render it for you. Note that using the provided Node URL block would be a more efficient way of doing it.
Comment #11
skolesnyk commentedThanks! Yes, Node URL block generates QR code just fine, but I'd love that extra flexibility of having QR code as a file.
Comment #12
Buckminster_Bond commentedskolesnyk - this may help you - it's a link to another issue on the queue where the filepath of the code is output via custom formatters/views...
http://drupal.org/node/1135594
Comment #13
mattbk commentedI couldn't get #2 to work in D7, even after changing $node_field to $entity_field, so I'm assuming something else would need to be changed and could use some help.
I'm using #4 as a workaround right now*, but this method requires the node to be edited before the field will populate, which obviously means a lot of work for existing nodes. Thanks for the help, though!
*In D7 Rules i works out to "Set a data value--Parameter: Data: [node:field-mobile-code], Value: [node:url]" for the third step.
Comment #14
socialnicheguru commentedcould I use custom_formatters to create this just for the Content:Link in a view?