View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003267 | OXID eShop (all versions) | 1.04. Content, static (register, contact etc.) pages | public | 2011-09-22 15:39 | 2012-01-24 09:24 |
Reporter | tjungcl | Assigned To | |||
Priority | high | Severity | major | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 4.5.2 revision 38481 | ||||
Fixed in Version | 4.6.0_beta3 | ||||
Summary | 0003267: onpage anchors (#) not working | ||||
Description | When you use onpage anchors in CMS pages, they point to the shop-root directory instead of the current directory. See the attached screenshot, where I did the following: - edit the agb cms so that "3." is linked with href="#test" - add a div with name="test" so there is something to jump to when successfull - in the agb page now mouse-over the new link: in the statusbar you already see, that the target of the link know is ".../enterprise-edition/#test" although it should be ".../enterprise-edition/agb/#test". - click the link and you are loading the start-page I tested with and without Javascript in Chrome, FF77 and IE8. I have no clue, what goes wrong here. Its quite absurd... | ||||
Tags | No tags attached. | ||||
Attached Files | |||||
Theme | Both | ||||
Browser | All | ||||
PHP Version | any | ||||
Database Version | any | ||||
|
little mistake in the description: instead of the 'div name="test"' it should be an 'a name="test"' the problem stays the same, though |
|
could somebody please look into this? I also tried the more common structure: a href="#test" ... div id="test" Its always the same: the link will open www.shoproot.com/#test instead of www.shoproot.com/contentpage/#test This IS reproducable in the demoshop, so its not a faulty server configuration. |
|
This is because of base href: http://www.ninthavenue.com.au/blog/using-base-href-with-anchors |
|
thanks for the hint! I read the comments there and added my own suggestion on the bottom: $("a[href^='\#'][href!='\#']").each( function (i,e){ var href = $(e).attr("href"); if ($(href).length || $("a[name='" + href.substring(1) + "']").length) $(e).attr("href", $(location).attr("href").split("#",1)[0] + href); } ); But I still hope, this will not be neccessary much longer. The base href usage seems to be not the best way to have... |
|
Removed <base href="[{ $oViewConf->getBaseDir() }]"> as it is not needed now, so need to do some javascript workarounds. |