Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: ApplianceJunk on February 04, 2013, 10:37:13 PM

Title: Need help placing form code correctly in index.template.php
Post by: ApplianceJunk on February 04, 2013, 10:37:13 PM
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,
Title: Re: Need help placing form code correctly in index.template.php
Post by: Mick. on February 04, 2013, 10:50:19 PM
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;
}
Title: Re: Need help placing form code correctly in index.template.php
Post by: ApplianceJunk on February 04, 2013, 11:00:37 PM
Tried it and the attachment shows how it ends up looking.

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

Title: Re: Need help placing form code correctly in index.template.php
Post by: Mick. on February 04, 2013, 11:04:36 PM
did you the css part?
Title: Re: Need help placing form code correctly in index.template.php
Post by: ApplianceJunk on February 04, 2013, 11:08:15 PM
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.

Title: Re: Need help placing form code correctly in index.template.php
Post by: Mick. on February 04, 2013, 11:15:27 PM
ok. Try above....
<br class="clear" />';
Title: Re: Need help placing form code correctly in index.template.php
Post by: ApplianceJunk on February 04, 2013, 11:20:44 PM
tried that and it moves it over to the left, but has a big empty space below the login area.
Title: Re: Need help placing form code correctly in index.template.php
Post by: Mick. on February 04, 2013, 11:24:56 PM
lol, now try where i said earlier...

before this...
</div>

<br class="clear" />';
Title: Re: Need help placing form code correctly in index.template.php
Post by: Mick. on February 04, 2013, 11:25:34 PM
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" />';
Title: Re: Need help placing form code correctly in index.template.php
Post by: ApplianceJunk on February 04, 2013, 11:37:34 PM
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,
Title: Re: Need help placing form code correctly in index.template.php
Post by: Mick. on February 04, 2013, 11:41:36 PM
index.template looks fine.  Remove the margin-top bit from the css.
Title: Re: Need help placing form code correctly in index.template.php
Post by: ApplianceJunk on February 04, 2013, 11:43:41 PM
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..
Title: Re: Need help placing form code correctly in index.template.php
Post by: Mick. on February 04, 2013, 11:47:25 PM
I see what the prob is.

I have my test site set to 80% width in theme settings.  You?
Title: Re: Need help placing form code correctly in index.template.php
Post by: ApplianceJunk on February 04, 2013, 11:52:25 PM
It was at 90% but I just tried changing it to 80% and it's still displayed towards the center.

Title: Re: Need help placing form code correctly in index.template.php
Post by: ApplianceJunk on February 04, 2013, 11:56:04 PM
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.
Title: Re: Need help placing form code correctly in index.template.php
Post by: Mick. on February 05, 2013, 12:02:37 AM
Oh.. let me try without the news t4ext.
Title: Re: Need help placing form code correctly in index.template.php
Post by: ApplianceJunk on February 05, 2013, 12:04:45 AM
ok, on my live site sometimes I have news and sometimes not.

Thanks for all the help with this...
Title: Re: Need help placing form code correctly in index.template.php
Post by: Mick. on February 05, 2013, 12:10:19 AM
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;
Title: Re: Need help placing form code correctly in index.template.php
Post by: 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.

Title: Re: Need help placing form code correctly in index.template.php
Post by: Mick. on February 05, 2013, 12:22:34 AM
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
Title: Re: Need help placing form code correctly in index.template.php
Post by: ApplianceJunk on February 05, 2013, 12:25:49 AM
Thanks again, much appreciated.