Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Sharepoint and the out of the box search control

  Asked By: Erik    Date: Jan 04    Category: Sharepoint    Views: 2875

I am trying to change the format of the search box, the one that has the
drop-down and then right next to has the text area you fill in,
I think it is a delegate control. What I need to do is to change the format of
that by having the text area on top of the drop-down so basically have a break
between both controls. I have looked for 3 days now and have had no luck.

Share: 

 

12 Answers Found

 
Answer #1    Answered By: Mansi Revenkar     Answered On: Jan 04

The Search box  is indeed loaded as a delegate  control. That means that the
actual control  is an .ASCX or server control that is loaded programmatically by
a feature. In the case of the search  box its a user control called
SearchArea.ascx that is stored in the Template\ControlTemplates directory of the
12 hive. What you want to do is create your own formatted version of the
SearchArea.ascx control and then load it using a custom feature instead of the
default SearchArea.ascx. Take a look at the following MSDN article for further
information.

msdn.microsoft.com/en-us/library/ms470880.aspx

 
Answer #2    Answered By: Lizette Mcconnell     Answered On: Jan 04

I have finshed all the steps and went back to my application, but the changes
do not show. Do i have to go to the default.master and point to the new name of
newsearchbox somehow how does the site know that i have changed it to
newsearchbox.

 
Answer #3    Answered By: Rosanna Parrish     Answered On: Jan 04

If you are using the default.master it should show as soon as you activate the
feature. If you are using a different master page then you'll need to verify
that the master page is still loading the search box  via a delegate  control
feature. Some things to check:

1) The sequence number of your feature must be lower than the one that is
currently loading
2) Make sure you are pointing to the right .ascx file in your feature and that
the path is correct.
3) Make sure that the feature is activated in the right scope. Control
(Delegate) features can be activated at any of the 4 scopes. That controls  the
area of effect of the feature.

 
Answer #4    Answered By: Kalash Karmakar     Answered On: Jan 04

1. i choose 99 the original one had 100
2. here is my new feature:
<?xml version="1.0" encoding="utf-8"?>
<Feature Id="5E1DB5E7-3C54-415B-9D85-A56C9C4A8086"
Title="$Resources:core,contentlightupFeatureTitle;"
Description="$Resources:core,contentlightupFeatureDesc;"
Version="12.0.0.0"
Hidden="TRUE"
DefaultResourceFile="core"
Scope="Web"
xmlns="http://schemas.microsoft.com/sharepoint/" target="_blank" rel="nofollow">http://schemas.microsoft.com/sharepoint/">
<ElementManifests>
<ElementManifest Location="controls\SearchArea.xml" />
</ElementManifests>
</Feature>

--- could the problem be in the above code i still have
core,contentlightupFeatureTitle
-- i still do not see how activate a new feature will work because the old one
is still there so no you have multiple references to the id=SmallSearchInputBox

and here is my new xml file:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/" target="_blank" rel="nofollow">http://schemas.microsoft.com/sharepoint/">
<Control
Id="SmallSearchInputBox"
Sequence="99"
ControlSrc="~/_controltemplates/newSearchArea.ascx">
</Control>
<CustomAction
Id="ExportEventToolbarButton"
Location="DisplayFormToolbar"
Title="$Resources:ContentLightup_EventToolbar_ExportEventButton;"
RegistrationType="List"
RegistrationId="106">
<UrlAction
Url="~site/_vti_bin/owssvr.dll?CS=109&Cmd=Display&List={ListId}&Cach\
eControl=1&ID={RecurrenceId}&Using=event.ics"/>
</CustomAction>
<CustomAction
Id="ExportContactToolbarButton"
Location="DisplayFormToolbar"
Title="$Resources:ContentLightup_EventToolbar_ExportContactButton;"
RegistrationType="List"
RegistrationId="105">
<UrlAction
Url="~site/_vti_bin/owssvr.dll?CS=109&Cmd=Display&List={ListId}&Cach\
eControl=1&ID={ItemId}&Using=vcard.vcf"/>
</CustomAction>
</Elements>

 
Answer #5    Answered By: Mauricio Tanner     Answered On: Jan 04

The Title and Description won't matter, but I would change  them anyway. But the
name of the Feature subdirectory and the GUID will. Did you change both? Also,
since the feature is scoped as a WEB feature it would need to be activated on
every site in a site collection. Since Delegate controls  can be scoped at any
level I would scope it for Site, WebApplication, or Farm level. I would also
change Hidden to False so I could see the feature in the user interface to make
sure it was activated. Finally, are you sure that newSearchArea.ascx is a valid
ascx control  and located where you say it is?

 
Answer #6    Answered By: Gina Freeman     Answered On: Jan 04

I did what the url you gave me said copied what was in ContentLightup and made a
new folder called NewSearchBox, then I open the feature.xml file and created a
new guid, changed the title and description set hidden=false, scope=Site

then i open up SearchArea.xml

and change  this line of code to point to a new ascx file
ControlSrc="~/_controltemplates/newSearchArea.ascx">

where newSearchArea.ascx is a duplicate copy of file that is called
SearchArea.ascx

then i did the stsadm commands but still nothing,

-- I still do not see how just by activating a new feature it will take over the
old one there is no place where you reference the feature on default master

<td style="padding-top:8px;" valign=top>
<asp:ContentPlaceHolder id="PlaceHolderSearchArea" runat="server">
<SharePoint:DelegateControl runat="server" ControlId="SmallSearchInputBox"/>
</asp:ContentPlaceHolder>
</td>

so how does sharepoint  know what feature to use for
ControlId="SmallSearchInputBox"

 
Answer #7    Answered By: Tyrell Nash     Answered On: Jan 04

The Feature tells SharePoint to load the ASCX referenced by the feature into the
delegate control. It loads them in reverse order based on the sequence number.
It knows which one to load where based on the ID of the delegate  control
referenced by the Feature.

 
Answer #8    Answered By: Silvia Wilkinson     Answered On: Jan 04

Thanks, for all your help it works now the problem was the secquence number was
to high i set it from 99 to 2 and it worked .

 
Answer #9    Answered By: Candy Walter     Answered On: Jan 04

I think the problem is that the article is written from the context of WSS. In
WSS there is only one Feature that loads Search. In MOSS the WSS feature
(ContentLightup) loads with a sequence of 100 and then some other feature loads
the MOSS search box  on top  with a sequence number below that. Using 99 I think
you were loading it between the two so the MOSS search  box took precedence. You
needed to get below the sequence number for the MOSS search.

 
Answer #10    Answered By: Leanne Rios     Answered On: Jan 04

Everything works now and the search  box's are now split, but the advance link
that is usually to the right of the search text box  seemed to disappear was that
part of the original searcharea.ascx page that i copied and must have deleted by
mistake, or is that found somewhere else that i may have over wrote when i
activated the new feature below

 
Answer #11    Answered By: Zachary Roberts     Answered On: Jan 04

But the problem is I have seemed to lost
the advance search  link that used to be to the right off the search text  box
area. I have looked everywhere in the 12 hive and there is no mention of the
advance search link. Once i go back to the out-of-box searcharea.ascx file it
appears. Is there a reason why that advance search link does not show when all i
did was copy the searcharea file and made a new file like the link said.

 
Answer #12    Answered By: Maura Durham     Answered On: Jan 04

OK, I did some more research last night and here's what I found. As I suspected
there are two features that load the SmallSearchInputBox delegate  control.

OSearchBasicFeature is the one that loads the WSS search  user control
searcharea.ascx. It has a sequence of 50 and loads first.

If you have MOSS installed there is also a feature called
OSearchEnhancedFeature. This one loads a compiled server control  called
Microsoft.SharePoint.Portal.WebControls.SearchBoxEx. It has a sequence of 25
and overrides the OSearchBAsicFeature if present and activated. This is the one
with the Advanced Search link built in.

So to get the Advanced Search link you will need to edit your searcharea.ascx
control that you are adding to the page to add the Advanced Search link into the
control.

 
Didn't find what you were looking for? Find more on Sharepoint and the out of the box search control Or get search suggestion and latest updates.




Tagged: