Hello my friends
how to make block title linked to archive?
thanks and best regards

Comments

fgm’s picture

Status: Active » Needs review

Hi,

I'm not sure I understand your question. If you want to have the title of a taxonews block be a A HREF like the "archive" link at the bottom of the block, there is just no direct way: Block titles in Drupal are typically not links, so this would break consistency and you can't do it in the block admin UI, and taxonews itself has no mechanism for this.

Since this would not be consistent with the rest of Drupal, I suggest you don't do this, and theme the "archive" link instead, to give it more visibility.

Does this answer your question ?

math_1048’s picture

yes that exactly what Iam looking for;
thank you for your help,I just try using
_preprocess_block(&$vars)
function in my theme
by adding the lines

if (isset($vars['block']->module) && ($vars['block']->module == 'taxonews')) {
    
        $vars['block']->subject = l($vars['block']->subject, $taxonews_block_title->tid,array('absolute' => TRUE));
  }

while the variable $taxonews_block_title - carry the $tid form the theming function of the taxonews as a global variable
theme_taxonews_block_view()
but its get success for just one block display of taxonews blocks - if more that one all blocks title will link to latest block link value :(
any suggestion
thank you

fgm’s picture

This might be because you don't differentiate on the block delta.

math_1048’s picture

yes, you get right, and its works now :)
my modification on _preprocess_block(&$vars)
was:

 if (isset($vars['block']->module) && ($vars['block']->module == 'taxonews')) {
    
       $vars['block']->subject = l($vars['block']->subject, 'taxonomy/term/'.$taxonews_block_title[$vars['block']->delta]->tid,array('absolute' => TRUE));
  }

and on theme_taxonews_block_view()
was:

+  global $taxonews_block_title;
    ............................................................................
    if (variable_get(Taxonews::VAR_SHOW_ARCHIVE, TRUE))
      {

+      $taxonews_block_title["$delta"]->tid=$tid;

      $ret .= '<span class="more-link">'
           .  l(t('Archive'), "taxonomy/term/$tid", array('absolute' => TRUE))
           .  '</span> ' ;
      }

thank you very much
best regards

fgm’s picture

Status: Needs review » Fixed

Glad it works.

Status: Fixed » Closed (fixed)

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