showing search results on web page?
-
- Commander (CMDR)
- Posts: 182
- Joined: Tue Jan 27, 2009 2:29 pm
showing search results on web page?
I am working on some landing pages for certain key words. How do I get a web page that acts like a category page but shows specific search results? Here is an example: I am advertising for " horse jewelry" on Google ads. When someone clicks on that I want them to land on a web page that has some sales info and then below the out put from http://www.cameojewelrysupply.com/Search.aspx?k=horse How do I do that?
Thanks
Chris
Thanks
Chris
Re: showing search results on web page?
Here's one way to do that.
Hopefully this will get you started.
- 1. Make a copy of the Search.aspx in the root store folder and name it something like LandingPage.aspx
- 2. Make a copy of the content scriptlet "Search" and name it something like Landing Page
- 3. Browse to the LandingPage.aspx page (logged in as an admin)
- 4. Change the content from Search to Landing Page
- 5. Edit the Landing Page content scriptlet to include your sales information
- 6. Change your link from Search.aspx?k=horse to LandingPage?k=horse
Hopefully this will get you started.
-
- Commander (CMDR)
- Posts: 182
- Joined: Tue Jan 27, 2009 2:29 pm
Re: showing search results on web page?
David thanks a lot for the help. I did as you said... and it works. I was wondering if the problem could also be solved by altering the conlib? right now if I use [[ConLib:SearchPage]] it outputs all items in the inventory. How difficult is it to create search conlibs that output specific keywords?
Thanks Again
Chris
Thanks Again
Chris
Re: showing search results on web page?
Hi Chris,
You probably need this http://www.plugables.com/Product-Tags-Module-P11.aspx
Supports tag based search both in merchant admin as well as retail store.
Tags can be searched and sorted based on their tag name and creation date.
You probably need this http://www.plugables.com/Product-Tags-Module-P11.aspx
Supports tag based search both in merchant admin as well as retail store.
Tags can be searched and sorted based on their tag name and creation date.
Re: showing search results on web page?
Chris,
You could create a new version of the SearchPage ConLib control and pass in your search keyword.
To see how to hard code a version of the SearchPage, change the
inside the ProcessSidebarEvent and the RefreshCriteria functions to
Then when you browse to the page with this new searchpage control, it will automatically search for products matching horse. You'll have a little more work to do to add a parameter to the SearchPage.ascx and SearchPage.ascx.cs files, but once you do that you can just call your new ConLib control like this:
If you don't want the CategorySearchSidebar to display, you can hide it by changing the left hand column to:
This control has to be on the page but not visible. The left hand column will still display so you'll probably want to put something else in there too.
You could create a new version of the SearchPage ConLib control and pass in your search keyword.
To see how to hard code a version of the SearchPage, change the
Code: Select all
_Keywords = searchSidebar.Keyword;
Code: Select all
_Keywords = "horse";
Code: Select all
[[Conlib:Custom\KeywordSearch Term="horse"
Code: Select all
[[ConLib:CategorySearchSidebar Visible="false"]]
-
- Commander (CMDR)
- Posts: 182
- Joined: Tue Jan 27, 2009 2:29 pm
Re: showing search results on web page?
David, I tried this but I must be missing a step.
I made a copy of the searchpage.ascx and searchpage.ascx.cs renamed them to searchpagehorse.ascx and searchpagehorse.ascx.cs and placed them in the custom folder.
I then replaced "horse" in the two areas you told me. This is in the searchpagehorse.ascx.cs
I went and created a scriptlet [[ConLib:Custom/SearchPagehorse]]
Adding that to my web page I get this error .....Page content for horse cameo [[ConLib:Custom/SearchPagehorse]] The file '/ConLib/Custom/SearchPage.ascx.cs' does not exist.
obviously I have to change something else it is not even looking for the correct file. it is looking for searchPage as opposed to searchpage horse ?? What do you think?
Thanks again
Chris
I made a copy of the searchpage.ascx and searchpage.ascx.cs renamed them to searchpagehorse.ascx and searchpagehorse.ascx.cs and placed them in the custom folder.
I then replaced "horse" in the two areas you told me. This is in the searchpagehorse.ascx.cs
I went and created a scriptlet [[ConLib:Custom/SearchPagehorse]]
Adding that to my web page I get this error .....Page content for horse cameo [[ConLib:Custom/SearchPagehorse]] The file '/ConLib/Custom/SearchPage.ascx.cs' does not exist.
obviously I have to change something else it is not even looking for the correct file. it is looking for searchPage as opposed to searchpage horse ?? What do you think?
Thanks again
Chris
Re: showing search results on web page?
Chris,
Sorry, I did my work directly in the SearchPage.ascx.cs file so I did forget a step. You need to change the first line of your new SearchPageHorse.ascx file to say:
Otherwise it is trying to reference the old SearchPage.ascx.cs for the code behind.
Hopefully that will get it working.
Sorry, I did my work directly in the SearchPage.ascx.cs file so I did forget a step. You need to change the first line of your new SearchPageHorse.ascx file to say:
Code: Select all
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="SearchPageHorse.ascx.cs" Inherits="ConLib_SearchPage" %>
Hopefully that will get it working.
-
- Commander (CMDR)
- Posts: 182
- Joined: Tue Jan 27, 2009 2:29 pm
Re: showing search results on web page?
I think I have this working however,How do I get an individual page ( the horse page) to use different content and side bar settings then the rest of the web site? I have created a web page under a category I named informational pages....when I change the standard sidebar 1 ( which is what I use through the whole site to "search sidebar" it effects a lot of other pages, same thing happens when I try to change content from "web page" to my custom "search horse" now my other web pages all switched to "search horse"
Re: showing search results on web page?
It sounds like you're using the same .aspx page to accomplish multiple tasks. Can you provide me this information:
When logged in as an ADMIN, browse to the page in the store you are trying to use as the "search horse" page. Then scroll to the bottom where you can see the Mode dropdown where you can switch between view and edit. To the far right of that dropdown is the name of the webpage you are using - something like ~/SearchPage.aspx. What does that say?
The solution will depend on your answer to that question.
When logged in as an ADMIN, browse to the page in the store you are trying to use as the "search horse" page. Then scroll to the bottom where you can see the Mode dropdown where you can switch between view and edit. To the far right of that dropdown is the name of the webpage you are using - something like ~/SearchPage.aspx. What does that say?
The solution will depend on your answer to that question.
-
- Commander (CMDR)
- Posts: 182
- Joined: Tue Jan 27, 2009 2:29 pm
Re: showing search results on web page?
I have to create a unique .aspx page in the root folder for each landing page? Is that it? . Changing layout on any dynamically created webpage.aspx seems to effect any other webpage.aspx .... unless I am missing something.
Thanks
Chris
Thanks
Chris
-
- Commander (CMDR)
- Posts: 182
- Joined: Tue Jan 27, 2009 2:29 pm
Re: showing search results on web page?
Yes you are correct, I was just using "add a web page" under a category to create these landing pages. They are all named webpage.aspx
Re: showing search results on web page?
You can create a copy of the webpage.aspx and name it something else and then switch display page to that version in the admin for your new landing pages.
I would recommend you edit the new .aspx page and change the <Name>Basic Webpage</Name> to something else like Landing Page.
I would recommend you edit the new .aspx page and change the <Name>Basic Webpage</Name> to something else like Landing Page.
-
- Commander (CMDR)
- Posts: 182
- Joined: Tue Jan 27, 2009 2:29 pm
Re: showing search results on web page?
Yeah that's it, got it now.....Thanks so much for all your help Dave. I really do appreciate that. It would be impossible for me to figure things like this out without help and guidance from people like you on this board . Thanks again... really.
Chris
Chris
-
- Commander (CMDR)
- Posts: 182
- Joined: Tue Jan 27, 2009 2:29 pm
Re: showing search results on web page?
Dave, do you think it is possible to create create a custom conlib advancedsearch for a specific keyword.... the same way you told me to do with the regular search? That has worked well but now I have some landing pages where the keyword has to be pulled from the description. What do you think?
Thanks
Chris
Thanks
Chris
Re: showing search results on web page?
Chris - what version of AbleCommerce are you using? Starting with 7.0.3 the search can use the SQL Full Text Search and the standard search will search the description field.
But, I was also able to modify the AdvancedSearchPage ConLib control to let you pass a keyword. Notice that the AdvancedSearchPage uses an ObjectDataSource on the .ascx page to set up the search parameters. That means we have to take a different approach is we're going to use the advanced search method.
First, modify the AdvancedSearchPage.ascx so that the Description checkbox is checked by default. If you want, you can uncheck the Name and SKU.
Then, modify the AdvancedSearchPage.ascx.cs code inside the Page_Load from:
to
Then you can call the advanced search page like this:
From there you should be able to create custom versions of the advanced search page like you have the search page.
Hope that helps,
But, I was also able to modify the AdvancedSearchPage ConLib control to let you pass a keyword. Notice that the AdvancedSearchPage uses an ObjectDataSource on the .ascx page to set up the search parameters. That means we have to take a different approach is we're going to use the advanced search method.
First, modify the AdvancedSearchPage.ascx so that the Description checkbox is checked by default. If you want, you can uncheck the Name and SKU.
Code: Select all
<asp:CheckBox ID="SearchDescription" runat="server" Text="Description" Checked="true" />
Code: Select all
if (!Page.IsPostBack)
{
InitializeCategoryTree();
}
Code: Select all
if (!Page.IsPostBack)
{
InitializeCategoryTree();
if (!String.IsNullOrEmpty(Request.QueryString["k"])) // checks to see if a parameter was passed
{
Keywords.Text = Request.QueryString["k"]; // set the keywords field with the parameter
BindProductsGrid(); // do the search
}
}
Code: Select all
http://www.mysite.com/advancedsearch.aspx?k=horse
Hope that helps,
-
- Commander (CMDR)
- Posts: 182
- Joined: Tue Jan 27, 2009 2:29 pm
Re: showing search results on web page?
I am using 7.0.2 I will play around with this and see if I can get it to work. Thanks Chris
-
- Commander (CMDR)
- Posts: 182
- Joined: Tue Jan 27, 2009 2:29 pm
Re: showing search results on web page?
Dave, Yeah that works good. If I wanted to create a custom versions of this advanced search should I just replace ["k"] with ["horse] ?
Thanks
Chris
Thanks
Chris
Re: showing search results on web page?
You need to keep the "k" but replace the values you send on the query string. For example:
to search for horse versus
to search for submarine.
Code: Select all
http://www.mysite.com/advancedsearch.aspx?k=horse
Code: Select all
http://www.mysite.com/advancedsearch.aspx?k=submarine
-
- Commander (CMDR)
- Posts: 182
- Joined: Tue Jan 27, 2009 2:29 pm
Re: showing search results on web page?
Yes I understand that. I am getting the correct search output. That is working. http://www.cameojewelrysupply.com/advan ... px?k=horse
it is just that each unique address( ?=keyword) brings you to the same page. You can't really have unique content on that landing page.... like you showed me with the regular search.
http://www.cameojewelrysupply.com/Horse ... Glass.aspx
Is there a way for the advancedsearch to spit out a specific keyword result and used as a conlib ? or will it only do by adding the ?=keyword
Thanks again
Chris
it is just that each unique address( ?=keyword) brings you to the same page. You can't really have unique content on that landing page.... like you showed me with the regular search.
http://www.cameojewelrysupply.com/Horse ... Glass.aspx
Is there a way for the advancedsearch to spit out a specific keyword result and used as a conlib ? or will it only do by adding the ?=keyword
Thanks again
Chris
Re: showing search results on web page?
I think I understand your question.
Are you looking for a page that just shows the results and maybe some custom text at the top? You don't need the advanced search controls at the top?
Try this. In your new custom control, delete all the form stuff (I think it's all in a table). Then modify the <asp:ObjectDataSource at the bottom of the ascx page to this:
This hard codes all of the search values. You'll see "horse" is the keyword and this says we don't care about the rest of the search values.
In the .cs file, you'll need to delete some code that will now produce errors. Just keep running your page until you get no errors.
Then add this line to end of your Page_Load function:
and reload the page. It should now display the advanced search results for "horse". You can add your custom text in the control or in each landing page. You can make multiple copies of this control for each keyword or you can change the keyword back to a controlparameter and have a hidden field that you use for the search term.
Make sense?
Are you looking for a page that just shows the results and maybe some custom text at the top? You don't need the advanced search controls at the top?
Try this. In your new custom control, delete all the form stuff (I think it's all in a table). Then modify the <asp:ObjectDataSource at the bottom of the ascx page to this:
Code: Select all
<asp:ObjectDataSource ID="ProductDs" runat="server" DataObjectTypeName="CommerceBuilder.Products.Product"
OldValuesParameterFormatString="original_{0}" SelectMethod="AdvancedSearch" SelectCountMethod="AdvancedSearchCount" SortParameterName="sortExpression" TypeName="CommerceBuilder.Products.ProductDataSource">
<SelectParameters>
<asp:Parameter Name="keyword" Type="String" DefaultValue="horse" />
<asp:Parameter Name="categoryId" Type="Int32" DefaultValue="0" />
<asp:Parameter Name="manufacturerId" Type="Int32" DefaultValue="0" />
<asp:Parameter Name="searchName" Type="boolean" DefaultValue="false"/>
<asp:Parameter Name="searchDescription" Type="boolean" DefaultValue="true" />
<asp:Parameter Name="searchSKU" Type="boolean" DefaultValue="false" />
<asp:Parameter Name="lowPrice" Type="decimal" DefaultValue="0" />
<asp:Parameter Name="highPrice" Type="decimal" DefaultValue="0" />
</SelectParameters>
</asp:ObjectDataSource>
In the .cs file, you'll need to delete some code that will now produce errors. Just keep running your page until you get no errors.
Then add this line to end of your Page_Load function:
Code: Select all
BindProductsGrid();
Make sense?
-
- Commander (CMDR)
- Posts: 182
- Joined: Tue Jan 27, 2009 2:29 pm
Re: showing search results on web page?
Dave,
Awesome, yeah that works perfect. Just what I wanted. You just selling your reporting tool or do you also do custom side work? Feel free to send me a personal message if your soliciting business. Thanks Again
Awesome, yeah that works perfect. Just what I wanted. You just selling your reporting tool or do you also do custom side work? Feel free to send me a personal message if your soliciting business. Thanks Again