Gallery search block with WPG2 only returns wordpress front page, yet using advanced search works correctly

sandy-b

Joined: 2010-05-31
Posts: 3
Posted: Sun, 2010-06-06 05:28

Hi I'm pretty new to G2, Wordpress and WPG2. I was impressed with how quick it was to get up and running but am struggling with one issue in particular. Search is a pretty key feature in my site but after doing the WPG2 integration I noticed that the G2 searchblock simply returns the index page of my wordpress site now. Curiously the advanced search option works. I have created a temporary workaround in which I point a wordpress page at the url for the advanced search option and deleted the search option from item actions. but this isn't ideal and the problem is intriguing me. It must be something to with the paths that get auto created with WPG2 that I don't understand.

Moreover what i really want to do is deploy an external searchblock in the sidebar of my wordpress page. I read in a forum that this will work if you simply copy the relevant search block html code and paste it into the sidebar. I've done this and here's what happens.
1. when i use the searchblock html from my installation without WPG2 installed and copy that into the sidebar, the searchblock works correctly - but loses all the page layout and menus of wordpress as the URLS point to: /gallery/main.php?g2_itemId=38"/ as if it was a standalone G2 implementation.

HTML copied below:

Quote:
<div class="block-search-SearchBlock">
<form id="search_SearchBlock" action="/gallery/main.php" method="get" onsubmit="return search_SearchBlock_checkForm()">
<div>
<input type="hidden" name="g2_return" value="/gallery/main.php?g2_itemId=38"/>
<input type="hidden" name="g2_formUrl" value="/gallery/main.php?g2_itemId=38"/>
<input type="hidden" name="g2_authToken" value="0f1cf19b7d10"/>
<input type="hidden" name="g2_view" value="search.SearchScan"/>
<input type="hidden" name="g2_form[formName]" value="search_SearchBlock"/>
<input type="text" id="searchCriteria" size="18"
name="g2_form[searchCriteria]"
value="Search Airshots Images"
onfocus="search_SearchBlock_focus()"
onblur="search_SearchBlock_blur()"
class="textbox"/>
<input type="hidden" name="g2_form[useDefaultSettings]" value="1" />
</div>
</form>
</div>

2. Ok so now here is the code for a searchblock after WPG2 was installed and then copied into the same sidebar.php of my wordpress page. Only the urls are different. And I have to say I don't know enough yet to really understand the WPG2 structure that has been imposed on them. This code just returns the index page as described:

Quote:
<div class="block-search-SearchBlock">
<form id="search_SearchBlock" action="/?page_id=38" method="get" onsubmit="return search_SearchBlock_checkForm()">
<div>
<input type="hidden" name="g2_return" value="/?page_id=38&amp;g2_e_id=38&amp;g2_wpg2_returnurl=http%3A%2F%2Fwww.airshots.co.nz&amp;g2_wpg2_returnname=Airshots"/>
<input type="hidden" name="g2_formUrl" value="/?page_id=38&amp;g2_e_id=38&amp;g2_wpg2_returnurl=http%3A%2F%2Fwww.airshots.co.nz&amp;g2_wpg2_returnname=Airshots"/>
<input type="hidden" name="g2_authToken" value="14faa5cd279e"/>

<input type="hidden" name="g2_view" value="search.SearchScan"/>
<input type="hidden" name="g2_form[formName]" value="search_SearchBlock"/>
<input type="text" id="searchCriteria" size="18"
name="g2_form[searchCriteria]"
value="Search the Gallery"
onfocus="search_SearchBlock_focus()"
onblur="search_SearchBlock_blur()"
class="textbox"/>
<input type="hidden" name="g2_form[useDefaultSettings]" value="1" />
</div>
</form>
</div>

I'm sure this is probably something simple to do with the paths, but I can't figure it out and would really appreciate any guidance on this. I also think it will be instructive for anyone trying to get a handle on WPG2 path related stuff. I tried searching the documentation, but what I found was very limited. It seems the pages have been deleted? If anyone can point at some basic info about the WPG2 tags, output and path options that would be awesome too.

If you want to check out the problem on my site, heres the URL: http://www.airshots.co.nz

I have set up two searchblocks in the sidebar. Try searching for the term: gisborne in each. The top one says 'search airshots images' as default text and is the first set of code i posted here. works fine but loses the wordpress CSS. The lower one represents the bottom set of code and doesn't go anywhere.

many thanks to anyone who can advise on this.

cheers sandy

PS If you do go to my site above, I have a variation of the same issue. you will notice that I have inserted code into the wordpress post loop to insert a random image from the gallery into the sticky post at the top. This works fine but if you click on it the URL path takes you to via /gallery/main.php so again loses the WPG2 integration as a result. Hmmm, all very confusing, please shed light if you can!!

PPS. this is a very recent installation so it is latest versions of everything: WPG2, G2 and Wordpress