Add Gallery Search Form to External Webpage

Mr. B

Joined: 2005-10-09
Posts: 25
Posted: Mon, 2013-03-25 20:04

I would like to add the "Search the Gallery" form to my 404 error page as it's getting a lot of hits since I recently relocated my gallery folder. Outside of the <form> itself, what do I need to copy over to make it functional?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2013-03-25 20:30

Just the form should work, you will have to make the path for the action of the form correct. You should just be able to view the source of the page and find the form, copy it and paste it into the other page.
You might want to sytle it a bit as well.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Mr. B

Joined: 2005-10-09
Posts: 25
Posted: Mon, 2013-03-25 20:46

Thanks. It was so simple I didn't even entertain the possibility that would actually work.

For the benefit of anyone else who might stumble on this in the future, this is the change I made.

This:

<form action="/gallery/search" id="g-quick-search-form" class="g-short-form">

is now this:

<form action="http://yourwebsite.com/gallery/search" id="g-quick-search-form" class="g-short-form">
 
StephenW
StephenW's picture

Joined: 2005-12-23
Posts: 25
Posted: Tue, 2013-03-26 16:04

Another thing that you could have done is just go into your CPanel>Domains>Redirects and added a "redirect" from the old location of the gallery to the new location, "Redirects allow you to make a specific web page redirect to another page and display the contents of that page." I don't know if you use CPanel, but the Redirect function is located under the Domain area. Also, if you enable "Wild Card Redirect" .... " Wild card redirects (if set) will redirect all requests for any files within the redirected directory to the same filename in the directory to which they are being redirected to." You can read the info about redirects here.

Best Wishes,
Stephen

Gallery Version: 3.0.4 Ricochet
Apache version 2.2.23
PHP version 5.3.18
MySQL version 5.5.28-cll
Architecture x86_64
Operating system Linux
Kernel version 2.6.32-279.11.1.el6.x86_64
CPanel Pro: 1.0 (RC1)
cPanel Version 11.34.1 (build 7)

 
Mr. B

Joined: 2005-10-09
Posts: 25
Posted: Tue, 2013-03-26 14:56

I did make an attempt to establish an .htaccess redirect, but I was never able to get it working properly. I know I said "relocated folder," I should have said "upgraded from gallery 2." Thanks for the CPanel tip though, I had forgotten about that option.

 
StephenW
StephenW's picture

Joined: 2005-12-23
Posts: 25
Posted: Tue, 2013-03-26 16:06

Yes, I've use the CPanel>Domains>Redirects (also using the Wildcard Redirect) with good success at adding redirects.