Loading ...
Sorry, an error occurred while loading the content.

Inserting an ID into a link

Expand Messages
  • Mike Breiding
    Greetings, I am (still!) using NT 4.95 What must I use in a clip so an ID is inserted to mirror the linked text? For graphics id= ^%imagename% is used, as in
    Message 1 of 13 , Jun 5, 2008
    • 0 Attachment
      Greetings,
      I am (still!) using NT 4.95

      What must I use in a clip so an ID is inserted to mirror the linked text?
      For graphics "id="^%imagename%" is used, as in the example below.
      But I am not sure what would be used to assign an ID which is the linked
      text.


      ^!InsertHtml <a href="hres/^%imagename%"><img src="^%imagename%"
      width="^%ImgWidth%" height="^%ImgHeight%" title=" Click to view
      larger image " alt="^%imagename%" id="^%imagename%"/></a>^p<p
      class="comments">  </p>^p^p
      ----------------
      How I want it to be:
      <a href="off_site/l_cavendish_obit.html" title="Biography of Lawrence
      Cavendish" ID="Lawrence Cavendish">Lawrence Cavendish</a>

      Clip for above:
      Internal Link
      ^!InsertHtml <a ^?[(T=T;F="Files|*")Link to Internal File=]
      target="_blank" title=" ^& ">^&</a>


      <a
      href='http://epicroadtrips.us/dad/journals/travel/central-states-north_trip_june_2-15_1977.htm'
      title=" Central States North trip - June 2-15, 1977 "
      ID="Central States North trip - June 2-15, 1977">Central States North
      trip - June 2-15, 1977</a>

      Clip for above:
      External Link
      <a href='^?[Paste External Web Link=]' title=" ^& ">^&</a>

      Is this a practical way to go about having links in pages which will
      have a link as a target?
      Am I making sense?

      Thanks!
      -Mike
      www.EpicRoadTrips.us
    • Mike Breiding
      Greetings, I am (still!) using NT 4.95 What must I use in a clip so an ID is inserted to mirror the linked text? For graphics id= ^%imagename% is used, as in
      Message 2 of 13 , Jun 9, 2008
      • 0 Attachment
        Greetings,
        I am (still!) using NT 4.95

        What must I use in a clip so an ID is inserted to mirror the linked text?
        For graphics "id="^%imagename%" is used, as in the example below.
        But I am not sure what would be used to assign an ID which is the linked
        text.


        ^!InsertHtml <a href="hres/^%imagename%"><img src="^%imagename%"
        width="^%ImgWidth%" height="^%ImgHeight%" title=" Click to view
        larger image " alt="^%imagename%" id="^%imagename%"/></a>^p<p
        class="comments">  </p>^p^p
        ----------------
        How I want it to be:
        <a href="off_site/l_cavendish_obit.html" title="Biography of Lawrence
        Cavendish" ID="Lawrence Cavendish">Lawrence Cavendish</a>

        Clip for above:
        Internal Link
        ^!InsertHtml <a ^?[(T=T;F="Files|*")Link to Internal File=]
        target="_blank" title=" ^& ">^&</a>


        <a
        href='http://epicroadtrips.us/dad/journals/travel/central-states-north_trip_june_2-15_1977.htm'

        title=" Central States North trip - June 2-15, 1977 "
        ID="Central States North trip - June 2-15, 1977">Central States North
        trip - June 2-15, 1977</a>

        Clip for above:
        External Link
        <a href='^?[Paste External Web Link=]' title=" ^& ">^&</a>

        Is this a practical way to go about having links in pages which will
        have a link as a target?
        Am I making sense?

        Thanks!
        -Mike
        www.EpicRoadTrips.us



        ------------------------------------

        Fookes Software: http://www.fookes.com/
        NoteTab website: http://www.notetab.com/
        NoteTab Discussion Lists: http://www.notetab.com/groups.php

        ***
        Yahoo! Groups Links
      • ebbtidalflats
        Mike, You question is a bit murky. Your sample code seems to be fairly competent in using variables, yet you seem to be asking if you can use the same variable
        Message 3 of 13 , Jun 9, 2008
        • 0 Attachment
          Mike,

          You question is a bit murky.

          Your sample code seems to be fairly competent in using variables, yet
          you seem to be asking if you can use the same variable twice.

          Variables don't wear out you know.

          But you need to read up on id attributes. What their syntax is, and
          how they are used. THAT is the part that doesn't make sense.

          If you want to use the ID attribute for something other than styles,
          why not jsut use the filename in the first place?


          Finally, why does the version of NoteTab matter to your question?



          Eb


          --- In ntb-clips@yahoogroups.com, Mike Breiding <mike@...> wrote:

          > Am I making sense?
        • Mike Breiding
          ... The competence is that of another as I did not write the clip. ... Because I do not know how to write a clip which will use the filename as an ID when
          Message 4 of 13 , Jun 9, 2008
          • 0 Attachment
            ebbtidalflats wrote:
            > Mike,
            > You question is a bit murky.
            > Your sample code seems to be fairly competent in using variables, yet
            > you seem to be asking if you can use the same variable twice.
            >

            The competence is that of another as I did not write the clip.
            > Variables don't wear out you know.
            >
            > But you need to read up on id attributes. What their syntax is, and
            > how they are used. THAT is the part that doesn't make sense.
            >
            > If you want to use the ID attribute for something other than styles,
            > why not jsut use the filename in the first place?
            >

            Because I do not know how to write a clip which will use the filename as
            an ID when creating a hyper link.
            When the user gets to the linked page there will be a "Back" link which
            link to the page and used the link ID to take them back to that part of
            the page from whence they came.
            Here is an example:
            http://epicroadtrips.com/test/test.html

            > Finally, why does the version of NoteTab matter to your question?
            >
            On at least one occasion the solution presented on the list to one of my
            problems would not work with the 4.X version.
            I am trying to get in the habit of letting people know I am still using
            it so they do not waste their time on a possible solution which would
            not work for that version.

            Thanks,
            -Mike
          • Mike Breiding
            Still trying with this. What would the linked text be called in the clip below? If I know this, can I use something like: id= ^%linked_text% in the clip to
            Message 5 of 13 , Jun 10, 2008
            • 0 Attachment
              Still trying with this.

              What would the linked text be called in the clip below?
              If I know this, can I use something like:
              id="^%linked_text%" in the clip to insert an ID which is the linked text?

              If so,this would this work?

              External Link
              <a href='^?[Paste External Web Link=]' id="^%linked_text%"
              target="_blank" title="^&, from Wikipedia, the free encyclopedia
               =>OFF SITE">^&</a>

              For an ID to be placed which is he name of an image file this variable
              is used: id="^%imagename%"
              But it is not obvious to me what the linked text would be called when
              using it as a variable.

              Thanks,
              -Mike
            • Dave
              Hi the way you have the test page works fine .if you use the same as the test page it works ? THANKYOU DAVE M ... From: Mike Breiding
              Message 6 of 13 , Jun 10, 2008
              • 0 Attachment
                Hi
                the way you have the test page works fine .if you use the same as the test
                page it works ?
                THANKYOU DAVE M

                ----- Original Message -----
                From: "Mike Breiding" <mike@...>
                To: <ntb-clips@yahoogroups.com>
                Sent: Tuesday, June 10, 2008 9:46 PM
                Subject: Re: [Clip] Inserting an ID into a link


                >
                > Still trying with this.
                >
                > What would the linked text be called in the clip below?
                > If I know this, can I use something like:
                > id="^%linked_text%" in the clip to insert an ID which is the linked text?
                >
                > If so,this would this work?
                >
                > External Link
                > <a href='^?[Paste External Web Link=]' id="^%linked_text%"
                > target="_blank" title="^&, from Wikipedia, the free encyclopedia
                >  =>OFF SITE">^&</a>
                >
                > For an ID to be placed which is he name of an image file this variable
                > is used: id="^%imagename%"
                > But it is not obvious to me what the linked text would be called when
                > using it as a variable.
                >
                > Thanks,
                > -Mike
                >
                >
                > ------------------------------------
                >
                > Fookes Software: http://www.fookes.com/
                > NoteTab website: http://www.notetab.com/
                > NoteTab Discussion Lists: http://www.notetab.com/groups.php
                >
                > ***
                > Yahoo! Groups Links
                >
                >
                >
              • Mike Breiding
                ... I inserted the ID manually on the test page. I want to the clip to do the work just as in the image variable clip. -Mike
                Message 7 of 13 , Jun 10, 2008
                • 0 Attachment
                  Dave wrote:
                  > Hi
                  > the way you have the test page works fine .if you use the same as the test
                  > page it works ?

                  I inserted the ID manually on the test page.
                  I want to the clip to do the work just as in the image variable clip.
                  -Mike
                • Axel Berger
                  ... Mike, this might be what you are looking for: ^!Set %vfile%=^?{(T=T;F= Files|* )Link to Internal File=}; %vtitle%=^?{Enter the title for this link};
                  Message 8 of 13 , Jun 10, 2008
                  • 0 Attachment
                    Mike Breiding wrote:
                    > I want to the clip to do the work just as in the image
                    > variable clip.

                    Mike, this might be what you are looking for:

                    ^!Set %vfile%=^?{(T=T;F="Files|*")Link to Internal File=};
                    %vtitle%=^?{Enter the title for this link};
                    %vtext%=^?{Enter the text for this link}
                    ^!InsertWizardHtml <A HREF="^%vfile%"
                    TITLE="^%vtitle%" ID="^%xtext%">^%vtext</A>^&

                    These are TWO long lines, I broke them for legibilty. While the
                    other syntax is a bit more elegant I usually prefer having the ^!Set
                    and the ^!Insert in separate lines for legibility, especially when
                    using a single variable more than once like here.

                    I have omitted your TARGET= here. Cluttering up other people's
                    screens unbidden is rightly considered very bad form, it is a bit
                    like letting your dog defacate on their front lawn. If they want to
                    open a link in a new window, they know how to do it in their own
                    chosen browser. (And if they don't even know that, then I at least
                    do not consider it right to always let the least qualified and the
                    least informed make the rules all the others, who nearly by
                    definition use things much more intensively and thus are much more
                    in need of being spared extra useless effort, have to suffer under.)

                    Axel

                    P.S: Thank you for reminding us of your version, you're doing the
                    right thing there.
                  • Axel Berger
                    ... Correction: ID= ^%vtext% I let my variables begin with a v to avoid any possible problems that might arise out of variable names and keywords being the
                    Message 9 of 13 , Jun 10, 2008
                    • 0 Attachment
                      Axel Berger wrote:
                      > TITLE="^%vtitle%" ID="^%xtext%">^%vtext</A>^&

                      Correction: ID="^%vtext%"

                      I let my variables begin with a "v" to avoid any possible problems
                      that might arise out of variable names and keywords being the same.
                      As far as I know this is totally superfluous in NoteTab, but I do it
                      all the same.

                      Axel
                    • Mike Breiding
                      ... Hi Alex, This works - but I am LAZY! I was hoping for a clip which would simply insert the ID based on what the linked text string would be. This is how
                      Message 10 of 13 , Jun 10, 2008
                      • 0 Attachment
                        Axel Berger wrote:
                        > Mike Breiding wrote:
                        >
                        >> I want to the clip to do the work just as in the image
                        >> variable clip.
                        >>
                        > Mike, this might be what you are looking for:
                        >
                        > ^!Set %vfile%=^?{(T=T;F="Files|*")Link to Internal File=};
                        > %vtitle%=^?{Enter the title for this link};
                        > %vtext%=^?{Enter the text for this link}
                        > ^!InsertWizardHtml <A HREF="^%vfile%"
                        > TITLE="^%vtitle%" ID="^%xtext%">^%vtext</A>^&

                        Hi Alex,
                        This works - but I am LAZY!
                        I was hoping for a clip which would simply insert the ID based on what
                        the linked text string would be.
                        This is how the image clip I use works. I think you and Don both had a
                        hand in it's creation:

                        ^!InsertHtml <a href="hres/^%imagename%"><img src="^%imagename%"
                        width="^%ImgWidth%" height="^%ImgHeight%" title=" Click to view
                        larger image " alt="^%imagename%" id="^%imagename%"/></a>^p<p
                        class="comments">  </p>^p^p

                        I don't know if this can work with a link clip since the ID would be a
                        text string. The %imagename% variable is selecting the filename.
                        Maybe I am thinking apples and oranges when associating these two clips
                        with each other.
                        Thanks!
                        -mb
                        p.s. Re: target="_blank"
                        I disagree. ;-)
                      • Mike Breiding
                        ... Alex, Can this be made to with external links? Thanks, -Mike The more you get the more you want -dad
                        Message 11 of 13 , Jun 10, 2008
                        • 0 Attachment
                          Mike Breiding wrote:
                          > Axel Berger wrote:
                          >
                          >>
                          >> his might be what you are looking for:
                          >>
                          >> ^!Set %vfile%=^?{(T=T;F="Files|*")Link to Internal File=};
                          >> %vtitle%=^?{Enter the title for this link};
                          >> %vtext%=^?{Enter the text for this link}
                          >> ^!InsertWizardHtml <A HREF="^%vfile%"
                          >> TITLE="^%vtitle%" ID="^%xtext%">^%vtext</A>^&
                          Alex,
                          Can this be made to with external links?
                          Thanks,
                          -Mike
                          "The more you get the more you want"
                          -dad
                        • Axel Berger
                          ... Yes, I had understood that. But unless that string is brought by the Easter Bunny, you have to type it somewhere, so why not here? If you get it from
                          Message 12 of 13 , Jun 10, 2008
                          • 0 Attachment
                            Mike Breiding wrote:
                            > I was hoping for a clip which would simply insert the ID based
                            > on what the linked text string would be.

                            Yes, I had understood that. But unless that string is brought by the
                            Easter Bunny, you have to type it somewhere, so why not here? If you
                            get it from somewhere else I will need more context to see where
                            it's from and how to read it out.

                            > This is how the image clip I use works.

                            Yes, but where does ^%imagename% come from?

                            > Maybe I am thinking apples and oranges when associating these
                            > two clips with each other.

                            Not at all. you might need to cast your net a bit wider and think a
                            little more out of the box, but in principle a link is a link.

                            > I disagree. ;-)

                            Up to you of course. I've stated my case and rest it there. For our
                            party page I was asked to open new windows too, and I refused. (The
                            additional rerason here was, that with "show pdf in browser window"
                            off, as every sensible user has it, they would all have been empty
                            windows.)

                            Axel
                          • Axel Berger
                            ... Easily. I was rather surprised about your ^?{(T=T;F= Files|* )Link to Internal File=}; to be honest. What I use myself is this (with a slightly different
                            Message 13 of 13 , Jun 10, 2008
                            • 0 Attachment
                              Mike Breiding wrote:
                              > Can this be made to with external links?

                              Easily. I was rather surprised about your
                              ^?{(T=T;F="Files|*")Link to Internal File=};
                              to be honest. What I use myself is this (with a slightly different
                              filename):

                              ^!Set %varURL%=^?{(T=O;
                              F="Link Files|*.*htm*;*.php;*.pdf;*.pl;*.cgi")
                              Enter a URL (add "a")};
                              %varDSC%=^?{Enter a description for this link}
                              ^!IfTrue ^$IsUrl("^%varURL%a.htm")$ SKIP
                              ^!Set %varURL%=^$FileToUrl("^$GetRelativeName(^%varURL%)$")$
                              ^!Set %varURL%=^$StrReplace("../";"/";"^%varURL%";False;False)$
                              ^!Set %varURL%=^$StrReplace("&";"&";"^%varURL%";False;False)$
                              ^!Set %varURL%=^$StrReplace
                              ("&amp;";"&";"^%varURL%";False;False)$
                              ^!If "^$StrCopyRight("^%varURL%";2)$" <> "/a" SKIP
                              ^!Set %varURL%=^$StrDeleteRight("^%varURL%";1)$
                              ^!InsertHtml <A HREF="^%varURL%">^%varDSC%</A>^&

                              You will want to change the extensions you're looking for a bit.
                              Having chosen the file I do the following:

                              1) If it is a valid URL -- perhaps ending in "/", so adding "a.htm"
                              will make it a fully resolved one, if not NotTab sees
                              "page.htm.a.htm" as a valid name -- skip the next line.
                              2) (If not skipped) take the chosen file, make its absolute path a
                              relative one, and make a URL out of the path.
                              3) The file I'm working on is typically one folder down from the
                              root on my sites, i.e. all .htm are in folders but only one level
                              deep. If so the relative destination "../" is equivalent to root "/"
                              and should be written as such.
                              4) URLs copied from the browsers often contain data. The separator
                              "&" should be written as an entity "&"
                              5) But only once.

                              Now it gets slightly more complicated. Often URLs end in a "/" like
                              my own homepage "www.berger-odenthal.de/" NoteTab does not like
                              these URLs. So up top I remind myself:
                              <Enter a URL (add "a")>. So after pasting the above example I do
                              just that and make it "www.berger-odenthal.de/a". (Iirc it's the
                              FileToUrl that requires this). So now it's time to rid ourselves of
                              that superfluous "a" again.

                              6) Check if it's there in the first place, if not skip the following
                              line.
                              7) If not skipped delete the last letter of the URL.

                              Done.

                              Axel

                              P.S: It is Axel, not Alex, please.
                            Your message has been successfully submitted and would be delivered to recipients shortly.