3 Replies Latest reply: Jul 17, 2014 8:31 PM by 3ddds RSS

    How to write code for Multiple hyperlinks in one sentence

    3ddds Community Member

      I am converting an Indesign CC book to epub. It contains many glossary words that are hyper linked from the body copy to a list of glossary terms. All single words are linking fine, but in two instances there are combined words, such as "children's/adults" and "face out/spine out".

      Each of these words "children's", "adult", "face out", "spine out" in the body copy link to the combined word "children's/adult", "face in/spine out"  in the glossary.

      Here is the code as is (which is not validating):

       

      <p class="GlossaryCopy"><span class="glosseryTerm _idGenCharOverride-2"><a id="children's"></a></span> <a href="../Text/CarinEpubTest-6.xhtml#children-s-1"></a><a id="adult"></a><a href="../Text/CarinEpubTest-6.xhtml#adult-1"><span class="glosseryTerm _idGenCharOverride-2">children's/adult</span></a>—notice that <span class="italics _idGenCharOverride-2">children’s</span> is plural and possessive while <span class="italics _idGenCharOverride-2">adult</span> is singular. Yes, this is completely inconsistent and yet it’s the conventional reference for each of the segments of publishing.</p>

       

      I know only enough html/CSS to fix some small things but I cannot figure this one out.

       

      Any help would be appreciated.

        • 1. Re: How to write code for Multiple hyperlinks in one sentence
          TheBCMan Community Member

          Can you rephrase your question I don't understand what you want to achieve.

          • 2. Re: How to write code for Multiple hyperlinks in one sentence
            3ddds Community Member

            The word "children's" and the word "adult" are terms used in an InDesign file. They are EACH hyper linked within the story to jump to their meanings in the Glossary of Terms.

            In the glossary, those two words are listed as one result: "children's/adult" with a definitions following:

            "children’s/adult—notice that children’s is plural and possessive while adult is singular. Yes, this is completely inconsistent and yet it’s the conventional reference for each of the segments of publishing. "

             

            This is the resulting code, but it will not validate thru epub checker.

            <p class="GlossaryCopy"><span class="glosseryTerm _idGenCharOverride-2"><a id="children's"></a></span> <a href="../Text/CarinEpubTest-6.xhtml#children-s-1"></a><a id="adult"></a><a href="../Text/CarinEpubTest-6.xhtml#adult-1"><span class="glosseryTerm _idGenCharOverride-2">children's/adult</span></a>—notice that <span class="italics _idGenCharOverride-2">children’s</span> is plural and possessive while <span class="italics _idGenCharOverride-2">adult</span> is singular. Yes, this is completely inconsistent and yet it’s the conventional reference for each of the segments of publishing.</p>

             

            This code allows the hyperlink to work with the "adult" word, but not the "children's" word, I assume because the code does not directly link the first word "children's" with the action at the end (a href).

             

            Sorry I can't explain this more technically. If I could, I would probably know the code and how to do it.

            • 3. Re: How to write code for Multiple hyperlinks in one sentence
              3ddds Community Member

              Sorry, I guess I need to specify what I want my result to be:

              When the reader click's on the word "children's" in the story, I want it to link to the definition: "children's/adult"  in the glossary and then return to the word  "children's" in the story.

              When the reader clicks on the word "adult" in the story, I want it to link to the definition: "children's/adult" in the glossary and then return to the word  "adult" in the story.

               

              The above code is not doing that and this is the error generated by Epub Checker:

               

              ERROR: /Users/diana/Documents/DWGraphic Design/Clients_Diana/Misc Clients/MIS 201C Publishing E-book/epub/CarinEpubTest.epub/OEBPS/Text/CarinEpubTest-51.xhtml(27): bad value for attribute "id"

              ERROR: /Users/diana/Documents/DWGraphic Design/Clients_Diana/Misc Clients/MIS 201C Publishing E-book/epub/CarinEpubTest.epub/OEBPS/Text/CarinEpubTest-6.xhtml(61): 'children-s': fragment identifier is not defined in 'OEBPS/Text/CarinEpubTest-51.xhtml'