Jump to content

Category links


Guest

Recommended Posts

Guest wendym

Me -> :) doh!! *slaps head*

My apologies.

All you need to do:-

  • in the file functions.inc.php (in the 'includes' dircectory) go to the 'Get Category Directory' section
  • find the following line : $dirArray[0] = $config['dirSymbol'].$catName
  • and change it something similar to this : $dirArray[0] = $config['dirSymbol']." <a href='".$GLOBALS['rootRel']."index.php?ccUser=".$sessId."&amp;catId=".$catId."&amp;act=viewCat' class='txtLocation'>".$catName."</a> ";

Doing that got the desired affect, that I was after.

I'll get back to you on having a link to the homepage, as *the* top-level link, as I havent sorted this yet.

But it should be easy enough, just by adding an a suitable value in the $lang['front']['viewCat'] and $lang['front']['viewProd'] arrays (may be able to get by with just adding a new array to hold the link - probably a better idea) in language/en/lang.in.php

Then in both viewCat.inc.php and viewProd.inc.php adding a line similar to:

$view_cat->assign("TXT_LINK_HOME",array_identifier);

After which it should just be a case of edting the viewCat.tpl and viewProd.tpl files (in skins/your-skin/styleTemplates/content/) to show the link.

Can you tell me how to do this in version 3.08?

Thanks

Link to comment
Share on other sites

Guest wendym

Thanks, I should have opened my eyes wider, I couldn't see the line of code you were talking about. Just had a look again, found the code and made the changes and it works. Thanks again.

Link to comment
Share on other sites

Thanks, I should have opened my eyes wider, I couldn't see the line of code you were talking about. Just had a look again, found the code and made the changes and it works. Thanks again.

No problem :)

I think it could be worthwhile me uploading this as a mod to CubeCart.org, especially given the interest it has generated.

I'll get it done for the end of the day.

(The Breadcrumb Navigation stuff that is. Theres about 3 or 4 different things on here lol!)

Link to comment
Share on other sites

  • 1 month later...
Guest alienbob

Nice mods, thanks :o

Just wondered how you get the breadcrumb at the top of the centre column as you have on your Freetime site instead of on the bottom as on mine!?

Cheers

Ab

Link to comment
Share on other sites

  • 2 months later...
Guest luvs2ride1979

Woo Hoo! You're the man webpresentations... Worked great and I didn't even screw it up! lol I'm going to copy and paste all of those instructions and keep them in my ever-growing cube cart modifications folder :w00t:.

Link to comment
Share on other sites

  • 1 month later...
Guest katherinedenger

Well, I gave up on this problem for awhile, but now i have to go back to it... :)

I have posted about this before but have never found the solution. After finding this thread, i had renewed hope, but after checking functions.inc.php, I found the code seems to be correct already. I am using ver 3.0.9 (with SEO mod and several others); the address is www.promolifestore.com.

The problem is when I click on my breadcrumbs, rather than going to the category on my page, it goes to www.categoryname instead.

I have also read all I can find on making sure i have the root rel entered correctly and it seems that it is.

$glob['rootDir'] = '/var/www/html/promolifestore.com/html/www';

$glob['rootRel'] = '/';

$glob['storeURL'] = 'http://www.promolifestore.com';

?>




here is the relevent code in functions.inc.php:


/* <rf> search engine friendly mods */	

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

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

		} else {			

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

		}

		/* <rf> end mod */

	} else {			

		if ($link == TRUE && $last_link == TRUE) {



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

		

		} else {

		

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

		}

If anyone can help me i'll be extremely grateful. I know it must be something simple i've overlooked but I just can't figure it out. I'd hate to have to take the breadcrumbs out all together. I think they are a very important navigational tool.

Link to comment
Share on other sites

  • 2 weeks later...
Guest tars21

Thanks, I should have opened my eyes wider, I couldn't see the line of code you were talking about. Just had a look again, found the code and made the changes and it works. Thanks again.

No problem ;)

I think it could be worthwhile me uploading this as a mod to CubeCart.org, especially given the interest it has generated.

I'll get it done for the end of the day.

(The Breadcrumb Navigation stuff that is. Theres about 3 or 4 different things on here lol!)

Is this mod up? And if so, where is it please?

When I do a "breadcrumb" search I only get one result (and strangely, this thread is not the one listed!)

Thanks for the help!

Link to comment
Share on other sites

  • 3 months later...

Hi WebPresentations

Nice mod for Category links,

at my site the Category links/subcat are shown below the categories, I want them to be at the top, how can i do it please. for example below is the image.

storehome.jpg

Kind Regards

Yunus

Link to comment
Share on other sites

  • 3 months later...
Guest badges

Is this mod up? And if so, where is it please?

When I do a "breadcrumb" search I only get one result (and strangely, this thread is not the one listed!)

Thanks for the help!

Interested in this too. Have searched dot org with no luck.

Alternatively, perhaps someone can anyone confirm that the instructions in this thread work for version 3.0.15?

Thanks.

Link to comment
Share on other sites

  • 1 year later...

Hello, I'm sorry to drag up this old thread but I have an issue that is related.

I am using the style "classic" and have implemented the mods for both the homepage link and the current sub catagory link succesfully for my viewprod page and the viewcat page when there are products to see however no matter what I try I can't get them to show up on the subcat pages which have no products.

missingstuff.jpg

You can see that the viewcat page with the products on has the link at the top but the viewcat page without any products on is missing the links at the top, it's highlited subtley in red by the way :rolleyes:

Here's my code for the viewcat page

<!-- BEGIN: view_cat -->

<div class="boxContentMid">

	<div class="boxTitleMid"><span class="txtContentTitle">{TXT_CAT_TITLE}</span></div>

	<br />

	<div class="txtDefault"><a href="index.php" class="txtDefault">{TXT_LINK_HOME}</a> {CURRENT_DIR}</div>

	<br clear="all" />

	<!-- BEGIN: sub_cats -->

	<div id="subCats">

		<!-- BEGIN: sub_cats_loop -->

		<div class="subCat">

			<a href="index.php?act=viewCat&amp;catId={TXT_LINK_CATID}" class="txtDefault"><img src="{IMG_CATEGORY}" alt="{TXT_CATEGORY}" border="0" title="{TXT_CATEGORY}" /></a><br />

			<a href="index.php?act=viewCat&amp;catId={TXT_LINK_CATID}" class="txtDefault">{TXT_CATEGORY}</a> ({NO_PRODUCTS})

		</div>

		<!-- END: sub_cats_loop -->

	</div>

	<!-- END: sub_cats -->

	<br clear="left" />

	<!-- BEGIN: cat_img -->

	<img src="{IMG_CURENT_CATEGORY}" alt="{TXT_CURENT_CATEGORY}" border="0" title="{TXT_CURENT_CATEGORY}" />

	<!-- END: cat_img -->

	<div class="pagination">{PAGINATION}</div>

<div id="sortform">

<script language="JavaScript">

function goto(form) { var index=form.select.selectedIndex

if (form.select.options[index].value != "0")

	 {

location=form.select.options[index].value;

	}

}

</SCRIPT>

 <form name="sortcat" >

Sort by: <select name="select" onchange="goto(this.form)">

<option value="" >Choose a sorting method</option>

<option value="{CURRENT_URL}&order=popularity">Popular Products</option>

<option value="{CURRENT_URL}&order=az">Filter: A-Z</option>

<option value="{CURRENT_URL}&order=za">Filter: Z-A</option>

<option value="{CURRENT_URL}&order=newest" >Newest Products First</option>

<option value="{CURRENT_URL}&order=oldest">Oldest Products tFirst</option>

<option value="{CURRENT_URL}&order=lowhigh">Price: Lowest First</option>

<option value="{CURRENT_URL}&order=highlow">Price: Highest First</option>

</select></form>

</div>

<br/> 





<!-- BEGIN: productTable -->

<table border="0" width="100%" cellspacing="0" cellpadding="3" class="tblList">

  <tr>

	<td class="tdListTitle"><strong>{LANG_IMAGE}</strong></td>

	<td class="tdListTitle"><strong>{LANG_DESC}</strong></td>

	<td class="tdListTitle"><strong>{LANG_PRICE}</strong></td>

	<td class="tdListTitle">&nbsp;</td>

  </tr>

  <!-- BEGIN: products -->

  <tr>

	<td align="center" class="{CLASS}"><a href="index.php?act=viewProd&amp;productId={PRODUCT_ID}" target="_self"><img src="{SRC_PROD_THUMB}" alt="{TXT_TITLE}" border="0" title="{TXT_TITLE}" /></a></td>

I simply cannot see why the links are visible on the page with products and not on the page without them :rolleyes:

Link to comment
Share on other sites

  • 2 weeks later...
Guest Vibegaz

Me -> :yeahhh: doh!! *slaps head*

My apologies.

All you need to do:-

  • in the file functions.inc.php (in the 'includes' dircectory) go to the 'Get Category Directory' section
  • find the following line : $dirArray[0] = $config['dirSymbol'].$catName
  • and change it something similar to this : $dirArray[0] = $config['dirSymbol']." <a href='".$GLOBALS['rootRel']."index.php?ccUser=".$sessId."&amp;catId=".$catId."&amp;act=viewCat' class='txtLocation'>".$catName."</a> ";

Doing that got the desired affect, that I was after.

I'll get back to you on having a link to the homepage, as *the* top-level link, as I havent sorted this yet.

But it should be easy enough, just by adding an a suitable value in the $lang['front']['viewCat'] and $lang['front']['viewProd'] arrays (may be able to get by with just adding a new array to hold the link - probably a better idea) in language/en/lang.in.php

Then in both viewCat.inc.php and viewProd.inc.php adding a line similar to:

$view_cat->assign("TXT_LINK_HOME",array_identifier);

After which it should just be a case of edting the viewCat.tpl and viewProd.tpl files (in skins/your-skin/styleTemplates/content/) to show the link.

Can you tell me how to do this in version 3.08?

Thanks

I really need to do have the sub cat link in v 3.0.18, but unfortunately the code is different.

Can anybody help me?

Link to comment
Share on other sites

  • 11 months later...

Right,

To sort the problem of no breadcrumb navigation showing on categories which have no product ....

in viewCat.inc.php look for the 'repeated region' section

look for the following statement

} elseif(isset($_GET['searchStr'])) {




there should be 'else' statement nearby



insert the following code, after the closing brace }




$view_cat->assign("TXT_LINK_HOME",$lang['front']['showLinks']['home']);

	$view_cat->assign("CURRENT_DIR",getCatDir($currentCat[0]['cat_name'],$currentCat[0]['cat_father_id'], $currentCat[0]['cat_id'], $link=TRUE));




this should be sitting above the 'no products' code, i.e.




$view_cat->assign("TXT_NO_PRODUCTS",$lang['front']['viewCat']['no_prods_in_cat']);

	$view_cat->parse("view_cat.noProducts");

I just now need to sort something similar for a search results page (viewCat.inc.php again).

Anyway hope this helps for now. I'm off to try and wrap my head around how to have a copy of the shopping cart box on a brochure site linked to a Cube Cart store. Having nightmarish problems with sessions. (Mainly because the brochure site is content managed with its own session, and the shopping cart box needs a session so that it will correctly display the basket contents.) :yeahhh:

I am borrowing the thread a little.

The breadcrumb links works fine but I get them under the category title and picture of the folder. How do I make the line to show above? Just like I see in the product page?

Link to comment
Share on other sites

  • 1 month 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...