Need help placing form code correctly in index.template.php

Started by ApplianceJunk, February 04, 2013, 10:37:13 PM

Previous topic - Next topic

ApplianceJunk

Not sure what board to post this in.

I have a parts search form that I'm trying to place directly under the user login info are of the index.template.php.

Here is the code I'm using for the form.


<div>
<strong>Shop for Parts</strong><br/>

<!-- RC SmartSearch -->
<form name="SmartSearch" method="get" target="_blank" action="http://www.repairclinic.com/Shop-For-Parts">

<input type="hidden" value="24039" name="RCAID" />
<input type="text" id="searchText" name="searchText" size="35" maxLength="60" />
<Input type="submit" value="Search" name="Search" title="RC SmartSearch" class="button_submit">

</form><IMG width="1" height="1" border="0" src="http://appliancejunk.com/images/rc1x1blank.png"><br/>
<a href="http://www.repairclinic.com/General/Help-Me-Find-My-Model-Number?RCAID=24039" title="Help me find my model number" target="_blank">Help me find my model number</a>
<!-- RC SmartSearch -->

</div>


I would like the parts search box to show up for everyone, guest and members.
I have been trying to place the code in a number of different locations in index.template.php, but just can't seem to get it right.

I have attached a screenshot of my closest attempt. That is how I want it to look, but the problem with the way it is there is a scroll bar shows up as I pointed out with the red arrow.

So close, yet so far...

Any help would be greatly appreciated.

Thanks,

Mick.

Try this...

Find:
</div>
<br class="clear" />';

// Define the upper_section toggle in JavaScript.


Add before:
<div id="search_parts">
<strong>Shop for Parts</strong><br/>

<!-- RC SmartSearch -->
<form name="SmartSearch" method="get" target="_blank" action="http://www.repairclinic.com/Shop-For-Parts">

<input type="hidden" value="24039" name="RCAID" />
<input type="text" id="searchText" name="searchText" size="35" maxLength="60" />
<Input type="submit" value="Search" name="Search" title="RC SmartSearch" class="button_submit">

</form><IMG width="1" height="1" border="0" src="http://appliancejunk.com/images/rc1x1blank.png"><br/>
<a href="http://www.repairclinic.com/General/Help-Me-Find-My-Model-Number?RCAID=24039" title="Help me find my model number" target="_blank">Help me find my model number</a>
<!-- RC SmartSearch -->
</div>


index.css add at the very end...
#search_parts
{
float: left;
        margin-top: 20px;
}

ApplianceJunk

Tried it and the attachment shows how it ends up looking.

No scroll bar, but it's not under the login/member area anymore.


Mick.


ApplianceJunk

Yes, I added the css part.

When I remove the css part it looks the this attachment.
Notice the text below the text box shift back over to the left.


Mick.


ApplianceJunk

tried that and it moves it over to the left, but has a big empty space below the login area.

Mick.

lol, now try where i said earlier...

before this...
</div>

<br class="clear" />';

Mick.

http://idesign360.com/dev/index.php

Look..
// Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings['enable_news']))
echo '
<h2>', $txt['news'], ': </h2>
<p>', $context['random_news_line'], '</p>';

echo '
</div>

<div id="search_parts">
<strong>Shop for Parts</strong><br/>

<!-- RC SmartSearch -->
<form name="SmartSearch" method="get" target="_blank" action="http://www.repairclinic.com/Shop-For-Parts">

<input type="hidden" value="24039" name="RCAID" />
<input type="text" id="searchText" name="searchText" size="35" maxLength="60" />
<Input type="submit" value="Search" name="Search" title="RC SmartSearch" class="button_submit">

</form><IMG width="1" height="1" border="0" src="http://appliancejunk.com/images/rc1x1blank.png"><br/>
<a href="http://www.repairclinic.com/General/Help-Me-Find-My-Model-Number?RCAID=24039" title="Help me find my model number" target="_blank">Help me find my model number</a>
<!-- RC SmartSearch -->
</div>

</div>

<br class="clear" />';

ApplianceJunk

Well now I'm going crazy...

Still back in the middle. Just to make sure I did not have something messed up in index.template.php and index.css I started with fresh copies and tried again. Same results for me, displays the search box back in the middle, lol...

I'm attaching my index.template.php and index.css
Maybe you can take a look and see what I have screwed up as I see it works just fine in the example you posted a link to.

Thanks,

Mick.

index.template looks fine.  Remove the margin-top bit from the css.

ApplianceJunk

Quote from: Mick. on February 04, 2013, 11:41:36 PM
index.template looks fine.  Remove the margin-top bit from the css.

It moved it up a little higher, but it's still in the center, crazy.. lol..

Mick.

I see what the prob is.

I have my test site set to 80% width in theme settings.  You?

ApplianceJunk

It was at 90% but I just tried changing it to 80% and it's still displayed towards the center.


ApplianceJunk

I found the problem, don't know the solution.... but if I put some text in the news box (copy and pasted your news) then it looks good.

Mick.


ApplianceJunk

ok, on my live site sometimes I have news and sometimes not.

Thanks for all the help with this...

Mick.

here you go...
find:
</div>

<div class="news normaltext">


add before:
                   <br />
<div id="search_parts">
<strong>Shop for Parts</strong><br/>

<!-- RC SmartSearch -->
<form name="SmartSearch" method="get" target="_blank" action="http://www.repairclinic.com/Shop-For-Parts">

<input type="hidden" value="24039" name="RCAID" />
<input type="text" id="searchText" name="searchText" size="35" maxLength="60" />
<Input type="submit" value="Search" name="Search" title="RC SmartSearch" class="button_submit">

</form><IMG width="1" height="1" border="0" src="http://appliancejunk.com/images/rc1x1blank.png"><br/>
<a href="http://www.repairclinic.com/General/Help-Me-Find-My-Model-Number?RCAID=24039" title="Help me find my model number" target="_blank">Help me find my model number</a>
<!-- RC SmartSearch -->
</div>


and add to the css bit..
overflow: hidden;

ApplianceJunk

That did the trick, thanks a million!
I never would have figured that one out by myself.


Mick.

Quote from: ApplianceJunk on February 05, 2013, 12:18:31 AM
That did the trick, thanks a million!
I never would have figured that one out by myself.



Glad it worked. My fault tho. Darn text in the news area threw me off. lol


Advertisement: