Jump to content

category link on products page


Guest

Recommended Posts

Does anyone know if there is a way to make the Category breadcrumb at the top og the boxContent a link

When you go into the Product page the trail isn't a link, but it would be very useful if it was as a quick way back to the category index.

Im in the process of heavily modifying the cart visually, as the shopping functionality only needs adding at a later date. But the above query is really bugging me. (if i get it all working i'll liscense cart and the search engine friendly mod, which seems brilliant)

an example of the problem can be seen

http://lcp4.hotchilli.net/~blues14682/stor...y-desk/p_8.html

how can i get Location: » C3 Cantilever Desking to be a link back to the category?

Cheers Tim

Link to comment
Share on other sites

Cheers, i did that, but the only hack/s i could find, completely cocked up the search engine friendly mod up.

I tried this one for example and that starts setting the page title etc to a link, or at least tries to, so you get the <a href = ..... as the title.

Any other ideas :unsure:

Edit: yep thats the one i tried and it was a no go :ninja:

Link to comment
Share on other sites

This is what i did for 3.0.2. Looks like the same change should work for 3.0.3, but I haven't tried it yet.

This is different to the code in that other thread. The if() statement in the following code prevents the category name being a link when you're viewing the category itself.

Edit includes/functions.inc.php

Replace:

$dirArray[0] = $config['dirSymbol'].$catName;


With: 
	// When viewing a product, provide link to its category

if(isset($_GET['act']) && $_GET['act']=="viewProd")

{

    $dirArray[0] = $config['dirSymbol']."<a href='".$GLOBALS['rootRel']."index.php?ccUser=".$sessId."&amp;catId=".$catId."&amp;act=viewCat' class='txtLocation'>".$catName."</a>";

}

else {

    $dirArray[0] = $config['dirSymbol'].$catName;

}

Link to comment
Share on other sites

Personally i think the problem is with your search engine friendly mod :unsure:

Why would the search engine friendly mod be using the same function (getCatDir) to create the page title? Because the getCatDir function has always put html links into the output.

Did the search engine friendly mod also require changes to the getCatDir function?

Link to comment
Share on other sites

was a tadge short the answer by Kinetic.

Estelle, yes i only made the one change you said. Im using the search engine mod in the downloads section.

If i cant get it to work, i will stick with the seo mod as its more important but it would be nice if i could do both.

Cheers Tim

Link to comment
Share on other sites

In functions.inc.php make this change if you have the search engine friendly mod on and want to make this mod. Remember getCatDir() function is used not only to create links but also return the category structure hence it is vital you check whether the caller requested it to be returned as links.

Replace

$dirArray[0] = $config['dirSymbol'].$catName;




with this




if($link == TRUE){

	/* <rf> search engine friendly mods */	

	if($config['sef'] == 0) {  

  $dirArray[0] = $config['dirSymbol']."<a href='".$GLOBALS['rootRel']."index.php?ccUser=".$sessId."&amp;catId=".$catId."&amp;act=viewCat' class='txtLocation'>".$catName."</a>";

	} else {  	

  $dirArray[0] = $config['dirSymbol']."<a href='".$GLOBALS['rootRel']."index.php?act=viewCat&amp;catId=".$catId."' class='txtLocation'>".$catName."</a>";  	

	}

	/* <rf> end mod */

} else {  	

	$dirArray[0] = $config['dirSymbol'].$catName;	

}

p.s I haven't tested this so use at your own risk :(

Link to comment
Share on other sites

Guest tbladecki

Take a look at my site and see if that is what you are looking for.... I have a breadcrumb trail that allows you to click on the links to the dirs above.

If so I will copy the code that i entered to do it and post it for you. Mine has worked fine and i have not had any problems, I do not have the search mod installed and I am using 3.0.2

Link to comment
Share on other sites

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...