Forums / Templates, Stylesheets, Page Layout / Altering Search sidebox to work with EZ pages only

Altering Search sidebox to work with EZ pages only

Locked

Views: 2,900

Results 1 to 20 of 21
This thread is locked. New replies are disabled.
27 Jun 2008, 11:20 PM
#1
ctcentralinfo avatar

ctcentralinfo

Totally Zenned

Join Date:
Apr 2005
Posts:
853
Plugin Contributions:
0

Altering Search sidebox to work with EZ pages only

I want to use EZ pages for help related topics only, I would like to create a sidebox that will allow customers to search for help related topics.

Is it possible to modify the search sidebox for Zen-cart to work with EZ pages only and if so how?

Rich People scream, Wealthy people whisper

https://www.cooltechcentral.com

28 Jun 2008, 12:59 AM
#2
ctcentralinfo avatar

ctcentralinfo

Totally Zenned

Join Date:
Apr 2005
Posts:
853
Plugin Contributions:
0

Re: Altering Search sidebox to work with EZ pages only

I think that this would be a great addition to EZ pages, any suggestions?

Rich People scream, Wealthy people whisper

https://www.cooltechcentral.com

28 Jun 2008, 1:12 PM
#3
ctcentralinfo avatar

ctcentralinfo

Totally Zenned

Join Date:
Apr 2005
Posts:
853
Plugin Contributions:
0

Re: Altering Search sidebox to work with EZ pages only

Here is the Search box tpl_search.php file:

<?php /** * Side Box Template * * @package templateSystem * @copyright Copyright 2003-2006 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: tpl_search.php 4142 2006-08-15 04:32:54Z drbyte $ */ $content = ""; $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent centeredContent">'; $content .= zen_draw_form('quick_find', zen_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get'); $content .= zen_draw_hidden_field('main_page',FILENAME_ADVANCED_SEARCH_RESULT); $content .= zen_draw_hidden_field('search_in_description', '1') . zen_hide_session_id(); if (strtolower(IMAGE_USE_CSS_BUTTONS) == 'yes') { $content .= zen_draw_input_field('keyword', '', 'size="18" maxlength="100" style="width: ' . ($column_width-30) . 'px"') . '<br />' . zen_image_submit (BUTTON_IMAGE_SEARCH,HEADER_SEARCH_BUTTON); $content .= '<br /><a href="' . zen_href_link(FILENAME_ADVANCED_SEARCH) . '">' . BOX_SEARCH_ADVANCED_SEARCH . '</a>'; } else { $content .= zen_draw_input_field('keyword', '', 'size="18" maxlength="100" style="width: ' . ($column_width-30) . 'px" value="' . HEADER_SEARCH_DEFAULT_TEXT . '" onfocus="if (this.value == \'' . HEADER_SEARCH_DEFAULT_TEXT . '\') this.value = \'\';" onblur="if (this.value == \'\') this.value = \'' . HEADER_SEARCH_DEFAULT_TEXT . '\';"') . '<br /><input type="submit" value="' . HEADER_SEARCH_BUTTON . '" style="width: 50px" />'; $content .= '<br /><a href="' . zen_href_link(FILENAME_ADVANCED_SEARCH) . '">' . BOX_SEARCH_ADVANCED_SEARCH . '</a>'; } $content .= "</form>"; $content .= '</div>'; ?>

I don't quite get how the search function works, but I am wondering if the line highlighted in red above can be altered to get this effect.

Rich People scream, Wealthy people whisper

https://www.cooltechcentral.com

6 Jul 2008, 4:57 AM
#4
ctcentralinfo avatar

ctcentralinfo

Totally Zenned

Join Date:
Apr 2005
Posts:
853
Plugin Contributions:
0

Re: Altering Search sidebox to work with EZ pages only

I am still interested in figuring out how to modify the default sidebox to search for words or phrases found in EZ pages only.

Rich People scream, Wealthy people whisper

https://www.cooltechcentral.com

6 Jul 2008, 6:13 AM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Altering Search sidebox to work with EZ pages only

At the present time, the site-search only does a search on products.
If you want a search option for EZ-Pages, you'll have to write one.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

7 Jul 2008, 12:33 AM
#6
ctcentralinfo avatar

ctcentralinfo

Totally Zenned

Join Date:
Apr 2005
Posts:
853
Plugin Contributions:
0

Re: Altering Search sidebox to work with EZ pages only

DrByte:

At the present time, the site-search only does a search on products.
If you want a search option for EZ-Pages, you'll have to write one.

I am not a coder, and was hoping for a work around.

Rich People scream, Wealthy people whisper

https://www.cooltechcentral.com

14 Jul 2008, 2:09 AM
#7
paul3648 avatar

paul3648

Zen Follower

Join Date:
Mar 2007
Location:
Taiwan
Posts:
239
Plugin Contributions:
0

Re: Altering Search sidebox to work with EZ pages only

I integrated a 3rd party search engine into my site. The search engine uses a spider to crawl the site, and content can be divided into categories such as products, info... - anything you want. It is not a simple set up, but if anyone is interested I can try to gather all the material and post it.

See my site here:

http://www.teafromtaiwan.com

Search box is in the right column.

14 Jul 2008, 3:14 AM
#8
ctcentralinfo avatar

ctcentralinfo

Totally Zenned

Join Date:
Apr 2005
Posts:
853
Plugin Contributions:
0

Re: Altering Search sidebox to work with EZ pages only

If you can get it to work with EZ populate only, that would be cool.

Rich People scream, Wealthy people whisper

https://www.cooltechcentral.com

14 Jul 2008, 12:02 PM
#9
paul3648 avatar

paul3648

Zen Follower

Join Date:
Mar 2007
Location:
Taiwan
Posts:
239
Plugin Contributions:
0

Re: Altering Search sidebox to work with EZ pages only

ctcentralinfo:

If you can get it to work with EZ populate only, that would be cool.

You have to "train" the search engine - once the site is spidered you can include and exclude any content you like.

15 Jul 2008, 4:04 AM
#10
ctcentralinfo avatar

ctcentralinfo

Totally Zenned

Join Date:
Apr 2005
Posts:
853
Plugin Contributions:
0

Re: Altering Search sidebox to work with EZ pages only

paul3648:

You have to "train" the search engine - once the site is spidered you can include and exclude any content you like.

How do I go about doing that? Could I get your mod?

Rich People scream, Wealthy people whisper

https://www.cooltechcentral.com

19 Jul 2008, 11:13 PM
#12
ctcentralinfo avatar

ctcentralinfo

Totally Zenned

Join Date:
Apr 2005
Posts:
853
Plugin Contributions:
0

Re: Altering Search sidebox to work with EZ pages only

Do you have the material to set the sidebox up yet?

Rich People scream, Wealthy people whisper

https://www.cooltechcentral.com

31 Aug 2008, 11:15 PM
#13
ctcentralinfo avatar

ctcentralinfo

Totally Zenned

Join Date:
Apr 2005
Posts:
853
Plugin Contributions:
0

Re: Altering Search sidebox to work with EZ pages only

paul3648:

Give me a day or two to put the materials together. In the meantime you can check out the search engine and maybe install it on your site in a separate directory:

http://www.greywyvern.com/orca

http://www.greywyvern.com/code/php/orcasearch_2.3.zip

I set up orca in a seperate directory, but I can't figure out how to create the search function. What I did was upload the ediable sidebox, now I am trying to figure out how to create the search box.

Rich People scream, Wealthy people whisper

https://www.cooltechcentral.com

1 Sep 2008, 12:11 AM
#14
paul3648 avatar

paul3648

Zen Follower

Join Date:
Mar 2007
Location:
Taiwan
Posts:
239
Plugin Contributions:
0

Re: Altering Search sidebox to work with EZ pages only

I haven't written this up yet, but I'm attaching the files needed for your ZC directory. The search engine is in the 'search' directory outside of the ZC directory - same level.

Change the folders MY_TEMPLATE to your custom template. There are several.

Let me know if this works.

1 Sep 2008, 1:51 AM
#15
ctcentralinfo avatar

ctcentralinfo

Totally Zenned

Join Date:
Apr 2005
Posts:
853
Plugin Contributions:
0

Re: Altering Search sidebox to work with EZ pages only

Can the size of the search box be adjusted? For some reason I am getting an overlapping effect between the header title and box. The other sideboxes on the right side, which are slightly wider then the left sideboxes, are all look normal I tried to adjust things in the tpl_search sidebox, but it didn't seem to work.

http://www.cooltechcentral.com/pages/about-cool-tech-pv-c0-7.html

Rich People scream, Wealthy people whisper

https://www.cooltechcentral.com

1 Sep 2008, 3:12 AM
#16
paul3648 avatar

paul3648

Zen Follower

Join Date:
Mar 2007
Location:
Taiwan
Posts:
239
Plugin Contributions:
0

Re: Altering Search sidebox to work with EZ pages only

ctcentralinfo:

Can the size of the search box be adjusted? For some reason I am getting an overlapping effect between the header title and box. The other sideboxes on the right side, which are slightly wider then the left sideboxes, are all look normal I tried to adjust things in the tpl_search sidebox, but it didn't seem to work.

Looks OK to me, or have you already changed it. I believe the width of the input box is set in control.php line 1920 or so, or else in \includes\templates\MY_TEMPLATE\sideboxes\tpl_search.php

1 Sep 2008, 1:13 PM
#17
ctcentralinfo avatar

ctcentralinfo

Totally Zenned

Join Date:
Apr 2005
Posts:
853
Plugin Contributions:
0

Re: Altering Search sidebox to work with EZ pages only

paul3648:

Looks OK to me, or have you already changed it. I believe the width of the input box is set in control.php line 1920 or so, or else in \includes\templates\MY_TEMPLATE\sideboxes\tpl_search.php

It's the padding that is causing the problem.

Rich People scream, Wealthy people whisper

https://www.cooltechcentral.com

1 Sep 2008, 8:32 PM
#18
ctcentralinfo avatar

ctcentralinfo

Totally Zenned

Join Date:
Apr 2005
Posts:
853
Plugin Contributions:
0

Re: Altering Search sidebox to work with EZ pages only

I fixed the header, but I am wondering if it is possible to keep the search results within ez-pages instead of going to the main page?

Rich People scream, Wealthy people whisper

https://www.cooltechcentral.com

2 Sep 2008, 12:30 AM
#19
paul3648 avatar

paul3648

Zen Follower

Join Date:
Mar 2007
Location:
Taiwan
Posts:
239
Plugin Contributions:
0

Re: Altering Search sidebox to work with EZ pages only

ctcentralinfo:

I fixed the header, but I am wondering if it is possible to keep the search results within ez-pages instead of going to the main page?

The search return is specified in sideboxes/tpl_search.php

If you don't want main page, maybe you could change this bit of code:

$content .= '<form action="index.php" method="get"><input type="hidden" name="main_page" value="search_return" />

What's the difference between main page and ez-pages?

2 Sep 2008, 2:06 AM
#20
ctcentralinfo avatar

ctcentralinfo

Totally Zenned

Join Date:
Apr 2005
Posts:
853
Plugin Contributions:
0

Re: Altering Search sidebox to work with EZ pages only

The ez-pages pages are the only section of my site with the search sidebox option.

Rich People scream, Wealthy people whisper

https://www.cooltechcentral.com