Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Display <a title="bla blah"> in category links


mreigle

Recommended Posts

Posted

I'm still learning PHP and I'm trying to display the title=" " in the category tree for each category.

 

I've began moving things around and seeing what I can do and I feel like i've made some progress.

 

Here's what I have

 

if ($tree[$counter]['parent'] == 0) {

$cPath_new = 'cPath=' . $counter;

} else {

$cPath_new = 'cPath=' . $tree[$counter]['path'];

}

$categories_string .= tep_href_link('index.php', $cPath_new) . '" title="';

echo $categories_string .= $tree[$counter]['name'] . '">';

// display category name

$categories_string .= $tree[$counter]['name'];

 

$categories_string .= '</a><br /><br class="px3"></td></tr>';

}else{

$categories_string .= '<tr><td width="15" align="left"></td><td width="185">';

for($i=0;$i<$tree[$counter]['level'];$i++)

$categories_string .= ' ';

$categories_string .= '- <a class="ml" href="';

 

 

I took the $categories_string .= $tree[$counter]['name']; and tried to splice it into the <a for the category listing but I'm getting a few problems...

 

Here's what happens: The menu gets all chopped up and the categories all appear sparadically 10+ times. Does anyone see the problem with that code?

Posted

Nevermind, did it like this:

 

if ($tree[$counter]['parent'] == 0) {

$cPath_new = 'cPath=' . $counter;

} else {

$cPath_new = 'cPath=' . $tree[$counter]['path'];

}

$categories_title .= $tree[$counter]['name'];

$categories_string .= tep_href_link('index.php', $cPath_new) . '" title="' . $categories_title . '">';

 

// display category name

$categories_string .= $tree[$counter]['name'];

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...