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

Re: [Clip] Inserting an ID into a link

Expand Messages
  • 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 1 of 13 , Jun 10 6:38 AM
      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 2 of 13 , Jun 10 6:53 AM
        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 3 of 13 , Jun 10 6:54 AM
          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 4 of 13 , Jun 10 10:11 AM
            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.