Hi,

I have noticed that QR code is not shown on a frontpage (ie http://www.example.org/). I am using multi-language setup (if this has something to do with it).

I have put an Mobile Code Node URL block onto a Page (footer section). It worked correct on all pages exept on a frontpage. As I looked over the sourcecode, I have noticed that in block.inc is a function called mobile_codes_block_node_url_view (last one in file).

I have replaced it with this:

function mobile_codes_block_node_url_view() {
	if (arg(0) == 'node' && arg(2) == '') {
    return array(
      'subject' => t('Node URL'),
      'content' => theme('mobilecode', array('data' => url(((arg(1) != '') ? ('node/' . arg(1)) : ''), array('absolute' => TRUE, 'alias' => TRUE)), 'attributes' => array('#preset' => variable_get('mobile_codes_block_node_url_preset', 'block_node_url'))))
    );
  }
}

ie. I have replace condition and added parameter:

	if (arg(0) == 'node' && arg(2) == '') {

and

'data' => url(((arg(1) != '') ? ('node/' . arg(1)) : '')

Since I have noticed that function url('') returnes correct URL for frontpage.

Please review this change and comment if you have any security/working concern.

Kind regards,
Miroslav

Comments

deciphered’s picture

Status: Needs review » Closed (works as designed)

It's intentional for this block, the Block is called 'Node URL', if the frontpage isn't a Node then, well, it's not a Node...

You could make a custom block, box, mini-panel, etc.