Jump to content

Making a link


IIIce

Recommended Posts

Hi guys! new to forum and to coding. I have poured over the forums and lots of places for an answer. I am not sure if this is due to my thus far limited understanding or, nto a specific enough question was asked. Basically it was suggested to me to make a link on a site from this:

 

 

Search our Catalog:

 

 

 

It was asked that I tie a link to that text and make it sort of a button so that when clicked, it takes someone to our catalog. The site is built with Drupal 6 and uses Danland theme and and a WYSIWYG. WHen I open the gear to edit this section I see:

 

"<P align=right><a href="https://catalog.ncpl.lib.oh.us/polaris/logon.aspx">

Access Library Account</a> -

<a href="https://catalog.ncpl.lib.oh.us/polaris/patronaccount/selfregister.aspx?">

Get a Card</a> -

<a href="http://catalog.ncpl.lib.oh.us/polaris/search/default.aspx">Search

Catalog</a></P>

<!-- // Start of Search form -->

<script language="javascript">

 

String.prototype.trim = function() { return this.replace(/^\s*|\s*$/g,''); }

 

function ProcessInput(e)

{

    if (window.event) // IE

        keyNum = e.keyCode;

    else if (e.which) // Netscape/Firefox/Opera

        keyNum = e.which;

 

if (keyNum == 13)

{

    e.returnValue = false;

    e.cancelBubble = true;

    DoKeywordSearch('KW');

    return false;

}

 

return true;

}

 

function DoKeywordSearch()

{

    if (document.getElementById('textboxTerm').value.trim() != '')

    {

        var strURL = 'http://catalog.ncpl.lib.oh.us/polaris/search/searchresults.aspx?ctx=1.1033.0.0.1';

        var strWindex = document.getElementById('Windex').value;

        var strTerm = escape(document.getElementById('textboxTerm').value);

        window.location = strURL + "&type=Keyword&limit=TOM=*&sort=PD_TI&Page=0&by=" + strWindex + "&term=" + strTerm;

    }

    else

    {

        alert('Please enter a search term');

        document.getElementById('textboxTerm').focus();

    }

}

 

</script>

<noscript>JavaScript must be enabled for catalog!</noscript>

<table border="0">

    <tr>

        <td>

            <label for="search">Search our Catalog:</label>

            <input class="search" type=text id=textboxTerm size=30 onkeypress="return ProcessInput(event)" />

            <select class="search" id="Windex">

              <option value="KW" selected="selected">

                Anywhere

              </option>

              <option value="SU">

                Subject

              </option>

              <option value="TI">

                Title

              </option>

              <option value="AU">

                Author

              </option>

              <option value="KW&fic=1">

                Fiction

              </option>

              <option value="KW&fic=0">

                Nonfiction

              </option>

            </select>

            <input type="submit" class="button" value="Go!" name="submit" onclick="DoKeywordSearch()" />

        </td>

    </tr>

</table>

<!--// End of Search form  -->"

 

My question is where would the code for the link go and is there a good resource i can use to figure out how to write it? Any help is greatly appreciated, thank you. :)

Link to comment
Share on other sites

Going to try and explain easiest way i can.

 

If is wrapped with double quotes, you must use single quotes within, or escape the double quote " with a backslash \"

 

//same window
echo "<a href='http://my-link.com/'>click me</a>";
echo "<br />";
echo "<a href=\"http://my-link.com/\">click me</a>";
echo "<br />";

//new window
echo "<a href='http://my-link.com/' target='_blank'>click me</a>";
echo "<br />";
echo "<a href=\"http://my-link.com/\" target=\"_blank\">click me</a>";

Link to comment
Share on other sites

I see, well this particular page is the search script...the place you want to send them to.

 

You would want to place a hyperlink somewhere other than this page, like in your index file, or within your sites main theme

 

If sent your index file, or your themes main page, would be easier to see a good place.

 

But you just need to place a link that looks exactly like this somewhere.

 

if is not within php code

<a href="http://catalog.ncpl.lib.oh.us/polaris/search/">Search our Catalog</a>

 

if is within php code

echo "<a href='http://catalog.ncpl.lib.oh.us/polaris/search/'>Search our Catalog</a>";

 

I do see a search link already there that leads to this address just called Search

http://catalog.ncpl.lib.oh.us/polaris/search/default.aspx?ctx=3.1033.0.0.3&type=Default

 

I guess would have to be more specific in where you would like the link to be added, because I already see a link there.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.