0
Welcome Guest! Login
0 items Join Now

ROCKETTHEME IS CLOSING ON JUNE 30, 2025. As a thank-you to our community, enjoy 50% off all themes with the promo code THANKYOU before we shut down. Read our Farewell Blog Post for more details.

Anchor malfunction!

  • Anchor malfunction!

    Posted 13 years 2 months ago
    • I'm working on a site which was originally written for Joomla 1.5. I've changed the template from Hyperion to Camber and Joomla 2.5.3.

      One thing that has stumped me is that anchor objects that are intended to link from the top of the page to lower down on the same page are instead taking the user to the last article in the same category. So a link like:
      <a href="#songs">Song List</a>
      should move the user to
      <a name="songs"></a>

      but the link in the browser is:
      nscad.dyndns.org:8888/jupgrade/kurt-weil...works/by-title#songs

      The site has SEF Urls turned on and URL rewriting on. When I turn off SEF Urls, the problem goes away, but of course the links are now ugly and user's old bookmarks are useless, so I need SEF Urls.

      The page in question is: nscad.dyndns.org:8888/jupgrade/index.php...21:weill-works#songs .
    • Last Edit: 13 years 2 months ago by Michael B LeBlanc.
    • Cliff Pfeifer's Avatar
    • Cliff Pfeifer
    • Preeminent Rocketeer
    • Posts: 8444
    • Thanks: 20
    • Website Developer

    Re: Anchor malfunction!

    Posted 13 years 2 months ago
    • Hi, you have to put a hashmark in front of the name in the href to designate it as a page anchor, like:
      <a href="#songs">Song List</a>

      Edit: I see you have that on your page, but you didn't put it in the code here.

      When I went to your link, the anchors did what they should, I wasn't redirected to another page, it added the #name at the end. It just doesn't do much in this case because your content is so close together. I would say using hyperlinks on that page doesn't really accomplish much because all of the linked content is already visible on the screen. I'm just not seeing the issue.
    • The difficult we do immediately, the impossible takes a little longer.
  • Re: Anchor malfunction!

    Posted 13 years 2 months ago
    • Ugh... yeah, I neglected to type it out correctly in the post, thanks for pointing that out. I've corrected the mistake in the initial post.

      After an extended session of futzing about late last night, I found a solution to the problem. (I should have done this posting right away, but I was out of steam for the day) I installed the Artio JoomSEF plugin. I decided to do this on the hunch that it might provide finer control over the SEF function, rather than using the single button on/off that comes with Joomla. At first it didn't help, but with some trial and error I found that I had to enable the advanced mode: if I set the base page href value to Yes--always use full SEO URL, the anchor problem was cleared up.

      Further to your point about short pages not needing it, you're right, some don't, but other pages are much longer and it's very useful.

Time to create page: 0.057 seconds