Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Making anchor tags (internal page linking) work with Clean URLs?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 06-06-2010, 03:46 PM
 
TheWrongGrape TheWrongGrape is offline
 

Advanced Member
  
Join Date: Nov 2002
Location: Los Angeles, CA
Posts: 68
 

Default Making anchor tags (internal page linking) work with Clean URLs?

Hey all,

A problem I've just encountered is that anchor tags aren't working correctly and I think this is related to using clean urls.

For example, when viewing a product, I want to have a link that says "Jump to Reviews" above the fold which would link like this <a href="#reviews">Jump to Reviews</a> And right near the beginning of my reviews section down the page is <a name="reviews></a>Customer Reviews ...

With clean urls, instead of the link being interpreted as http://www.mydomain.com/current-page.html#reviews it's http://www.mydomain.com/#reviews. Also, if I go ahead and hard code it as <a href="{$http_location}/{$product.clean_url}.html#reviews> the page refreshes then jumps down instead of jumping down directly.

Any ideas of a workaround?
Reply With Quote
  #2  
Old 06-07-2010, 07:16 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Making anchor tags (internal page linking) work with Clean URLs?

Use <a href="current-page.html#reviews">. For product page for example use it like this

<a href="product.php?productid={$product.productid}#r eviews">Reviews</a>
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following user thanks cflsystems for this useful post:
TheWrongGrape (06-07-2010)
  #3  
Old 06-07-2010, 10:14 PM
 
TheWrongGrape TheWrongGrape is offline
 

Advanced Member
  
Join Date: Nov 2002
Location: Los Angeles, CA
Posts: 68
 

Thumbs up Re: Making anchor tags (internal page linking) work with Clean URLs?

That worked perfectly. Thank you so much!
Reply With Quote
  #4  
Old 08-31-2011, 03:01 PM
  ARW VISIONS's Avatar 
ARW VISIONS ARW VISIONS is offline
 

X-Man
  
Join Date: Jan 2007
Location: Pensacola, FL
Posts: 2,536
 

Default Re: Making anchor tags (internal page linking) work with Clean URLs?

what about a category page?
__________________
xcart 5.1.2
Reply With Quote
  #5  
Old 08-31-2011, 06:01 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Making anchor tags (internal page linking) work with Clean URLs?

<a href="home.php?cat={$cat}#reviews">Reviews</a>
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following user thanks cflsystems for this useful post:
ARW VISIONS (08-31-2011)
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 07:58 AM.

   

 
X-Cart forums © 2001-2020