Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Great module by the way - I'm trying to apply an imagecahce preset to the qr code and it doesn't seem to be doing anything. I've several presets, but it has no affect on the qr image.
Comments
Comment #1
whartwell CreditAttribution: whartwell commentedSame problem here. QR generates fine in the block but the preset doesn't apply. Any suggestions?
Comment #2
ice5nake CreditAttribution: ice5nake commentedI am having similar problems. How are you applying the preset? What is the code you are using?
I can't get the height or width settings to work.
Here's the code I tried inside of a View field template
print theme('qr_codes', $output, 150, 150);
The QR code image displays but the size varies. The $output variable is a URL. Also, I can't find documentation on usage for this module. Any help would be appreciated.
Comment #3
windm CreditAttribution: windm commentedHi there,
(although being not familiar with PHP at all) I would like to integrate the QR Code (containing the [node-url] token) in the
a) Content-Template for several Content Types
b) print.tpl.php for the "printer-friendly-view" managed by the print module
I used the
print theme('qr_codes', $output, 150, 150);
in both cases and got a QR Code displayed (with the correct size) but it does not contain any link or content.The QR-Code-Block (provided by the qr_code module) is configurable - so I defined [node-url] as the content of the block and it works fine.
But how do I get that [node-url] into QR-Code for the content-template and the print.tpl.php ?
Comment #4
windm CreditAttribution: windm commentedOK - I think I solved the issue (post #3) - maybe it´s a workaround but it works:
Due to the fact that I didn´t find a replacement for $node->path that would hand over the enire URL, I use this combination of a hardcoded URL + the current path.
Reading other threads, the $node->path seems to be only available for auth users - doesn´t matter for my special case but is maybe important for others.
I´m still curious if there is a better solution - something like "$node->source_url" or something that could use the token [node-url] which works fine in the QR-Block provided by the module.
Comment #5
ice5nake CreditAttribution: ice5nake commentedI am using a View field template views-view-field--signs--page-1--path.tpl.php
The name of the field in the View is path.
Most of the images are getting output with a width of 99 pixels. This is really driving me crazy. :)
Perhaps an important piece of information is that I am using libqrencode.
Comment #6
IncrediblyKenzi CreditAttribution: IncrediblyKenzi commentedFYI, instead of hardcoding your URL, you can use the drupal global $base_url to achieve this.
I'm not sure if there's a token available for absolute URL in Drupal 6, but will take a look.
Comment #7
IncrediblyKenzi CreditAttribution: IncrediblyKenzi commentedLooks like there are several tokens that should do this, including node-url:
./token.module: $values['current-page-url'] = url($_GET['q'], array('absolute' => TRUE));
./token_node.inc: $values['node-url'] = url('node/' . $node->nid, array('absolute' => TRUE));
so either node-url or current-page-url should return an absolute path.
Comment #8
IncrediblyKenzi CreditAttribution: IncrediblyKenzi commentedwindm: The reason your tokens aren't working is because the token replace happens in the block view code, not in the theme layer. You'll need to invoke the token replace yourself:
newToo: Just realized this thread was hijacked.. I'll take a look at the imagecache code.
Comment #9
pitolek CreditAttribution: pitolek commentedHi there,
had sort of the same problem. Found that the hook_theme function declares the following:
However, the actual theming function uses different parameters:
function theme_qr_codes($data, $width = 150, $height = 150, $margin = 0, $alt = '', $title = '', $imagecache_preset = '', $attributes = array()) {
Removing the $alt and $title from the parameters results in the chosen imagecache preset being used.
Hope this helps ...
Comment #10
borjagut CreditAttribution: borjagut commentedI've a similar problem, but using the block.
If i write a 'static' string, it works perfectly, but when i'm using a token value, it doesn't work.
Then, I use the theme_qr_codes function in my tpl, but the same problem, with strings is great, but with a variable, i.e. $title (simpler impossible), doesn't return something.
Any ideas?
any help would be apreciated, and sorry for my english
Updated:
I'm using the module in a page where I need to use a lot of cache features, could be that the problem? Any solution?
SOLUTION: The problem were the blank spaces of the token
Comment #11
ice5nake CreditAttribution: ice5nake commentedI was trying to add an alt tag to the image but I noticed the same thing as pitolek. Shouldn't the arguments match?