Hello,
My issue is for a website I made for a friend of mine. You can visit it here: http://www.GoodDog-US.com

My problem is I cannot get the sexybookmark block to display on the frontpage, which uses the "frontpage" view.

I have tried the following to no avail:

  1. Setting "Show on only the listed pages." to: <front>, and "frontpage"
  2. Setting "Show if the following PHP code returns TRUE (PHP-mode, experts only)." to:
    <?php
      if (drupal_is_front_page()) {
        return TRUE;
      }
    ?>
  3. and finally selecting "Show on every page except the listed pages." and leaving it blank

Nothing has worked.

In admin/Sexybookmarks I selected some nodes for SM to display in, and those work when the node is visited directly, but not when the nodes are viewed through a view (like the frontpage).

Any help would be appreciated, I am a noob!
Thanks, Dave

Comments

alfre.d’s picture

You need change the follow code in sexybookmaks.module file:

function sexybookmarks_block($op = 'list', $delta = 0, $edit = array()) {
  switch ($op) {
    case 'list':
      return array(
        array(
          'info' => t('SexyBookmarks'),
        ),
      );

    case 'view':
      if (arg(0) == 'node' && is_numeric(arg(1))) {
        $settings = _sexybookmarks_get_settings();
        $node = node_load(arg(1));
        if (_sexybookmarks_display($settings, $node, array('block' => TRUE))) {
          return array('content' => theme('sexybookmarks', $node));
        }
      }			
      break;
  }
}

for:

function sexybookmarks_block($op = 'list', $delta = 0, $edit = array()) {
  switch ($op) {
    case 'list':
      return array(
        array(
          'info' => t('SexyBookmarks'),
        ),
      );

    case 'view':
      if (arg(0) == 'node' && is_numeric(arg(1))) {
        $settings = _sexybookmarks_get_settings();
        $node = node_load(arg(1));
        if (_sexybookmarks_display($settings, $node, array('block' => TRUE))) {
          return array('content' => theme('sexybookmarks', $node));
        }
      }
	if (drupal_is_front_page()) {
  	  return array('content' => theme('sexybookmarks'));
	}
      break;
  }
}

if you need too show the block in pages with url distinct of node/(number), (i.e. /legal or /gmapslocation), change for the next code:

function sexybookmarks_block($op = 'list', $delta = 0, $edit = array()) {
  switch ($op) {
    case 'list':
      return array(
        array(
          'info' => t('SexyBookmarks'),
        ),
      );

    case 'view':
      if (arg(0) == 'node' && is_numeric(arg(1))) {
        $settings = _sexybookmarks_get_settings();
        $node = node_load(arg(1));
        if (_sexybookmarks_display($settings, $node, array('block' => TRUE))) {
          return array('content' => theme('sexybookmarks', $node));
        }
      }else {
      	return array('content' => theme('sexybookmarks'));
      }
			
      break;
  }
}
deciphered’s picture

Status: Active » Fixed

The blocks in the 6.x-2.x branch are no longer restricted to Nodes. Recommend upgrading.

Status: Fixed » Closed (fixed)
Issue tags: -frontpage, -Sexybookmark Block, -frontpage view, -<front>

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