Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 11 of 11
  1. #1
    New Coder
    Join Date
    Oct 2011
    Posts
    31
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Anchor not supported-> Workaround?

    I am building a web site in SmugMug, which provides a base web site that you can customize to an extent. The problem I am facing is that they do not support anchors.

    I want to be able to link form one page, to an item in the middle of another page. What happens when I create an anchor on the page I want to link to, instead of taking me to the anchor itself in the middle of the page, it just takes me to the top of the page.

    Anyone know of a workaround to this problem?
    Last edited by ewingr; 11-22-2011 at 01:11 AM.

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello ewingr,
    I have not messed with SmugMug much (re: not at all) but I would first question how you're writing your anchors. Do you have some example of the code you're using?
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #3
    New Coder
    Join Date
    Oct 2011
    Posts
    31
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Excavator View Post
    Hello ewingr,
    I have not messed with SmugMug much (re: not at all) but I would first question how you're writing your anchors. Do you have some example of the code you're using?
    I understand your thoughts. I followed the instructions and examples from the W3Schools.com site. However, I have validated on their forums that they do not support anchors, but no-one has any idea of a work around.

    I am presuming that there is no work around.

  • #4
    Senior Coder alykins's Avatar
    Join Date
    Apr 2011
    Posts
    1,753
    Thanks
    41
    Thanked 191 Times in 190 Posts
    Quote Originally Posted by ewingr View Post
    I understand your thoughts. I followed the instructions and examples from the W3Schools.com site. However, I have validated on their forums that they do not support anchors, but no-one has any idea of a work around.

    I am presuming that there is no work around.
    can we see the code you've written?

    which provides a base web site that you can customize to an extent.
    Anchors are a core html element restricting users to not be able to use them in real bad idea; maybe there is something else worng that you are not seeing. The code you are using would be better

    I code C hash-tag .Net
    Reference: W3C W3CWiki .Net Lib
    Validate: html CSS
    Debug: Chrome FireFox IE

  • #5
    New Coder
    Join Date
    Oct 2011
    Posts
    31
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by alykins View Post
    can we see the code you've written?



    Anchors are a core html element restricting users to not be able to use them in real bad idea; maybe there is something else worng that you are not seeing. The code you are using would be better
    Sure. I certainly may have it wrong. I'll be happy to try any suggestions provided. Here is what I have.

    On this page, I have an anchor:

    Code:
    <div align="center"><font size="3" <a name="Giclee"></a> ><strong> Giclée Canvas and Watercolor Prints </strong></font></div><br>
    Then, on this page, I have this code :

    Code:
    <div class="myText">
    				<p><br>Make a bold impact with ShutterMaster's wide assortment of Wall Clusters and Splits! Clusters and Splits can be assembled with multiple images, or use a single image across prints for a dramatic mosaic effect. Cluster packages are discounted at 20% less than the individual mounted print prices, and are designed to be hung 1" apart. In order to insure that you get a product that is satisfactory to you, Clusters and Splits can not be ordered via the buy buttons on this site. Please see <a href="http://www.shuttermaster.co/Other/Purchasing-Prints/20109727_kVdRfW#Giclee">this page</a> for detailed ordering information, or you can  <a href="%3Ca%20href=" "="" onclick="return false;" class="customContactButton">contact us</a> by e-mail for more information.
    				</p>
    When I click the link on the page right above, it takes me to the other page, but to the top, not to the anchor.

    Thanks for any thoughts...

  • #6
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,292
    Thanks
    10
    Thanked 282 Times in 281 Posts
    You have a missing right bracket (red) and extra one (green) here:
    Code:
    <div align="center"><font size="3"><a name="Giclee"></a> ><strong> Giclée Canvas and Watercolor Prints </strong></font></div><br>
    That may make the difference. Also I think modern usage of anchors is to use an ID, not a name for them, for example changing that div to:
    Code:
    <div id="Giclee" align="center">
    and omitting the <a name.... entirely.

    Then last but not least, here's a summary of the 95 errors on the page that may or may not impact its functionality...

    Dave

    Dave

  • #7
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    This might work with your current method of inline styling -
    <font size="3" id="Giclee"> &gt;<strong> Giclée Canvas and Watercolor Prints </strong></font>


    I did go look at the SmugMug forums and found a working example:


    Click <a href="#takemetoyourleader">here</a> to take me to the end of the text.
    takes you to
    Code:
    This is a lot of HTML
    <br>
    <br>
    This is a lot of HTML
    <br>
    <br>
    <br>
    The anchor &lt;a name="takemetoyourleader"&gt;&lt;/a&gt; is right here.
    <br>
    <a name="takemetoyourleader"></a>
    </div>
    Last edited by Excavator; 11-21-2011 at 04:00 AM.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #8
    New Coder
    Join Date
    Oct 2011
    Posts
    31
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by tracknut View Post
    You have a missing right bracket (red) and extra one (green) here:
    Code:
    <div align="center"><font size="3"><a name="Giclee"></a> ><strong> Giclée Canvas and Watercolor Prints </strong></font></div><br>
    That may make the difference. Also I think modern usage of anchors is to use an ID, not a name for them, for example changing that div to:
    Code:
    <div id="Giclee" align="center">
    and omitting the <a name.... entirely.

    Then last but not least, here's a summary of the 95 errors on the page that may or may not impact its functionality...

    Dave

    Dave
    Thanks Dave. I corrected that first error, and it didn't help.

    That error list is interesting. I'm thinking that some of it is because of the way this page has to be created, and gets a lot of other code added by SmugMug. Quite a few of those 'errors' are actually in the code that gets pushed in by SmugMug. An unfortunate situation for me is that i am quite new to developing HTML without using a generator. I posted that link to those errors on the SMugMug forum to get some thoughts.

    Quote Originally Posted by Excavator View Post
    This might work with your current method of inline styling -
    <font size="3" id="Giclee"> &gt;<strong> Giclée Canvas and Watercolor Prints </strong></font>


    I did go look at the SmugMug forums and found a working example:


    Click <a href="#takemetoyourleader">here</a> to take me to the end of the text.
    takes you to
    Code:
    This is a lot of HTML
    <br>
    <br>
    This is a lot of HTML
    <br>
    <br>
    <br>
    The anchor &lt;a name="takemetoyourleader"&gt;&lt;/a&gt; is right here.
    <br>
    <a name="takemetoyourleader"></a>
    </div>
    Turns out you found that on my thread that I posted there last night to try to verify again whether or not they support anchors.

    The problem with that code is that it is an anchor to the same page. I am attempting to do one to the middle of a different page. That code results in the same thing I already had: takes me to the other page, but not the anchor.

    I've posted back in that thread my results, including the error list posted by tracknut above.

    If I come up with an answer, I'll post back here. And if any of you have further suggestions, I'm happy to try them.

    Folks...thanks for your input.

  • #9
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    The name attribute should no longer be used for providing anchor points to jump to in a web page. Many new browsers no longer support them as the id attribute replaced it for that purpose long ago.

    The last browser that didn't support being able to jump to any id within a web page was Netscape 4.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #10
    New Coder
    Join Date
    Oct 2011
    Posts
    31
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by felgall View Post
    The name attribute should no longer be used for providing anchor points to jump to in a web page. Many new browsers no longer support them as the id attribute replaced it for that purpose long ago.

    The last browser that didn't support being able to jump to any id within a web page was Netscape 4.
    That may very well be. I failed to mention it, but I did change to the suggestion of using ID= per Excavator's suggestion. That meant a change to the anchor on the page I'm linking to, no changes to the link itself.Made zero difference.

    I have it that way now. Still searching for answer. Thanks for the suggestions, folks.

  • #11
    New Coder
    Join Date
    Oct 2011
    Posts
    31
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Solved

    The code that I'm working with is per entering HTML code in the description of a gallery. The tutorials on the SmugMug Forum say to use "Old Journal" style.

    After a few posts back and forth about "this works for me" and I say "it isn't for me", finally one of the guys over there figured it out. Here is what he said:

    The difference is that your pages are in the Journal format and Smugmug is EATING the hash tag so it WILL NOT WORK. My pages are Smugmug view and it does seem to work there. This is a limitation of Smugmug's javascript interpretation of hash tags. They are eating your tags so they won't work.

    Summary: some Smugmug gallery styles are not compatible with customized anchor navigation.
    I was pretty sure it was a limitation of some kind imposed by the methodology on SMugMug, and it was the Old Journal style indicated to use in the Tutorial. (It's always so hard to keep documentation current )

    Currently my code is back to name=, but I"m going to experiment with what has been posted here as the way that it should be done, via ID=

    Thanks folks for your replies.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •