1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to code this?

Discussion in 'XenForo Questions and Support' started by Mike Law, Apr 29, 2011.

  1. Mike Law

    Mike Law Active Member

    Hi all,

    I keep asking questions, I guess part of it is because I am NOT a coder.
    I hope someone can be so kind to show me how to implement this below HTML code into my header on the far right..

    Any support would be greatly appreciated. It is one of those custom things that got lost in my XF move from VB

    HTML:
    <table>
      <tbody>
        <tr>
          <td valign="top">
          <form method="get"
    action="http://cgi-bin/search_preprocess.cgi"><input
    size="45" name="all" type="text"><br>
    in
            <select name="mask_path">
            <option value="/" selected="selected">All
    Databases</option>
            <option value="uk">United Kingdom</option>
            <option value="ew wales uk/cases/UKPC uk/cases/UKHL">England
    &amp; Wales</option>
            <option value="nie uk/cases/UKPC uk/cases/UKHL">Northern
    Ireland</option>
            <option value="scot uk/cases/UKPC uk/cases/UKHL">Scotland</option>
            <option value="ie">Ireland</option>
            <option value="eu">Europe</option>
            </select>
            <input name="results" value="200" type="hidden">
            <input value="Search" name="submit"
    type="submit"><input name="sort" value="rank"
    type="hidden"><input name="callback" value="on"
    type="hidden"><input name="highlight" value="1"
    type="hidden"></form>
          </td>
          <td></td>
        </tr>
      </tbody>
    </table>
     
  2. Jake Hakoda Shirley

    Jake Hakoda Shirley Active Member

    Try placing it in the ad_header template.
     
  3. Mike Law

    Mike Law Active Member

    Hi,

    I tried that, but it makes it show on top of the logo on the right..
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    Moved from template modifications to general support.

    Try wrapping it in a div which is floated right or positioned using right, top, etc.
     
  5. borbole

    borbole Well-Known Member

    Do you mean to have it like at the screenshot attached below?

    If so at the logo_block template find the following code:

    Code:
    <div id="logo"><a href="{$logoLink}">
                    <span><xen:comment>This span fixes IE vertical positioning</xen:comment></span>
                    <img src="@headerLogoPath" alt="{$xenOptions.boardTitle}" />
                </a></div>
    And after it add this code:

    Code:
    <div style="float:right; margin-top: 5px"><form method="get"
    action="http://cgi-bin/search_preprocess.cgi"><input
    size="45" name="all" type="text"><br>
    in
            <select name="mask_path">
            <option value="/" selected="selected">All
    Databases</option>
            <option value="uk">United Kingdom</option>
            <option value="ew wales uk/cases/UKPC uk/cases/UKHL">England
    &amp; Wales</option>
            <option value="nie uk/cases/UKPC uk/cases/UKHL">Northern
    Ireland</option>
            <option value="scot uk/cases/UKPC uk/cases/UKHL">Scotland</option>
            <option value="ie">Ireland</option>
            <option value="eu">Europe</option>
            </select>
            <input name="results" value="200" type="hidden">
            <input value="Search" name="submit"
    type="submit"><input name="sort" value="rank"
    type="hidden"><input name="callback" value="on"
    type="hidden"><input name="highlight" value="1"
    type="hidden"></form></div>
    Or you can create a class at the EXTRA.css file with the css codes and then wrapp your code inside it at the logo_block template. Both ways would work fine. Hope it helps.

    The end result can be seen at the attched screenshot btw.
     

    Attached Files:

    Mike Law likes this.
  6. Mike Law

    Mike Law Active Member

    borbole likes this.
  7. borbole

    borbole Well-Known Member

    It depends. In what way do you want to make it better? The more details you give us, the better.
     
    Mike Law likes this.
  8. Mike Law

    Mike Law Active Member

    Well,

    As you can see it is very minimal now,

    here is the code I used in the end

    Code:
    <div id="logoBlock">
        <div class="pageWidth">
            <div class="pageContent">
                <xen:include template="ad_header" />
                <xen:hook name="header_logo">
                <div id="logo"><a href="{$logoLink}">
                    <span><xen:comment>This span fixes IE vertical positioning</xen:comment></span>
                    <img src="@headerLogoPath" alt="{$xenOptions.boardTitle}" />
                </a></div><div style="float:right; margin-top: 5px">
    
    <form action="http://www.someurl.com/cgi-bin/search_preprocess.cgi" method="post" class="right">
    
    <input type="hidden" name"=mode" value="case">
    <input type="search" name="citation" size=27 value="" placeholder="e.g. [2000] 1 AC 360">
    <input type="submit" value="Go"><br>
    
    <input type="hidden" name"=mode" value="case">
    <input type="search" name="titleall" size=25 value="" placeholder="e.g. barber v somerset">
    <input type="submit" value="Go"><br>
    
    <input type="hidden" name="mode" value="legis">
    <input type="search" name="all" size=25 value="" placeholder="e.g. sustainable energy">
    <input type="submit" value="Go"><br>
    
    </form></div>
                </xen:hook>
                <span class="helper"></span>
            </div>
        </div>
    </div>
    What I like is there to be a cool box around it, with a title saying "Case/Legislation Law"

    I really like below samples. Now I have 3 search boxes, but if those could be with a select option and just 1 search box it would be awesome, but as the code shows they look for different areas.

    [​IMG]

    [​IMG]

    Also,

    These searches are done on another website, no mine. So the results go to that other website.
    What would be UBER cool is for the results to be shown either on my site ?!? or in a pop-up page.
     

Share This Page