Announcement

Collapse
No announcement yet.

Pasting script for external link new window?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Pasting script for external link new window?

    I'm trying to create a page of links but want them to open in new windows so that customers don't loose my site and have been following some advice but am a little stuck again (sorry):

    1. Go to Design | Text. Click on GoTo and type in the following :
    Phase = -1
    ID = 1191
    Replace the existing value with the following :
    <A HREF="%s" OnClick="setTarget(this)">

    [that's fine]

    2. Add the following javascript function in actiniccore.js (found in C:\ProgramFiles\ActinicV7\Sites\Site 1 folder)

    function setTarget(obj)
    {
    if (document.OpenInNewWindow != undefined)
    {
    obj.target = "_blank";
    }
    }

    [where should I add it???]

    3. Add the following javascript code in the template Act_Primary.html (Design | Options | Layouts, click on Edit next to the Default Overall Layout)

    <FORM NAME="OpenInNewWindow"></FORM>
    This can be placed anywhere in the template after the <body > tag.

    [again, think I can follow this part]

    I can follow part 1 and part 3 but could I please ask where in actiniccore.js I need to paste the above script - can it go anywhere or does it need to go before or after something specific please?

    #2
    where in actiniccore.js I need to paste the above script - can it go anywhere or does it need to go before or after something specific
    Right at the bottom after everything else is safest.

    Also it's best to put that <FORM NAME="OpenInNewWindow"></FORM>an a new line right after the <body.......> line. This is a rather long line (it ends with ">") so make sure you don't put your code in the middle of it.
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Thank you. Well, I did all of that but it didn't seem to work so I must have done something wrong.

      I'm trying to create a list of sites that people might find interesting. Am I putting the information into the wrong place - I've been putting the link sites into fragment pages? Should I be listing these as products instead and putting the urls into the extended info sections?

      Sonia

      Comment


        #4
        I use fragments for links, either direct as in the attached picture, or by using [LINK] in the fragment text and inputting the URL on the second fragment tag.
        Attached Files
        Last edited by wjcampbe; 06-Sep-2005, 01:33 PM. Reason: changed jpeg to show code for opening in new window
        Bill
        www.egyptianwonders.co.uk
        Text directoryWorldwide Actinic(TM) shops
        BC Ness Solutions Support services, custom software
        Registered Microsoft™ Partner (ISV)
        VoIP UK: 0131 208 0605
        Located: Alexandria, EGYPT

        Comment


          #5
          For any JavaScript problem it's better to look at your page in Firefox and use Tools / JavaScript Console to get decent diagnostic messages.
          Norman - www.drillpine.biz
          Edinburgh, U K / Bitez, Turkey

          Comment


            #6
            Hi again & thanks.

            From the live site, the links I've put in all connect to the other sites but not in a seperate window so once someone clicks away, I've lost them. I've viewed the page in Firefox and clicked on the Javascript console but noting happens - sorry for being dumb but how do I use it please?

            Also having a problem with the products pages - extended info seem to open fine with a "more" button click but throws up an error message if you click on the picture instead.

            It's moving in the right direction now - I did a rehash yesterday having worked into the wee hours on Saturday night and changed from Curves (which I couldn't figure out at all) to Smart theme. But have now got so many questions I don't know where to start. This could be the first of quite a lot of questions from me.

            Would appreciate suggestions and lots of advice please.

            http://trials.actinic.com/trials/trial19673/index.html

            Comment


              #7
              Hi Sonia - I also would recommend using Fragments as Bill suggests above - to open the link in a new window and leave your site open beneath simply edit Bills code adding in target="_new" after the <a


              Bikster
              SellerDeck Designs and Responsive Themes

              Comment


                #8
                Sorry - this is probably another of my stupid questions - which html file would I put Bill's code in? I've been puting the url's into fragment pages and using the [link] option but where is this coded?

                Is it in the Act_primary file, the actiniccore.js or in the design | text -or is it somewhere else? Sorry

                Comment


                  #9
                  Just create a new fragment and enter the code straight into the fragment text area - no need to edit any templates or scripts - take another look at Bills attached imaged and it shows what you should see.


                  Bikster
                  SellerDeck Designs and Responsive Themes

                  Comment


                    #10
                    Sonia - you put the code in the fragment text box. Have another look at the picture attached in item #4.
                    Bill
                    www.egyptianwonders.co.uk
                    Text directoryWorldwide Actinic(TM) shops
                    BC Ness Solutions Support services, custom software
                    Registered Microsoft™ Partner (ISV)
                    VoIP UK: 0131 208 0605
                    Located: Alexandria, EGYPT

                    Comment


                      #11
                      As the HTML is all contained in the text area of the fragment there is also no need to mess with LINKS options etc - thats the beauty of Bills method it is very simple and easy to maintain


                      Bikster
                      SellerDeck Designs and Responsive Themes

                      Comment


                        #12
                        How stupid am I - sorry about that & thanks for pointing me back - total lack of sleep seems to finally be taking it's toll - either that or I've become a little obsessed with the primary file.

                        Thanks again - this should make things work a lot better.

                        Comment

                        Working...
                        X