[Cartoweb-users] Address search?
wochter
wochter at seznam.cz
Wed Mar 28 04:54:58 EST 2007
now I see mistake could be in search_ulice.tpl:
<select name="search_ulica" id="search_ulica">
{foreach from=$table->rows item=row}
<option value="{$row->rowId}">
{foreach from=$row->cells item=value}
value is rowId, but it seems I need another column...
Am I wrong?
How to do it please?
wochter
wochter wrote / napísal(a):
> Hi,
> I've tested the search plugin.
>
> - I have defined search "ulica" in search.ini:
> config.ulica.provider.type = table
> config.ulica.provider.table = koz_ulice
> config.ulica.provider.id = id
> config.ulica.provider.columns = ulica
> ;config.ulica.provider.type = server
> config.ulica.formatter.type = smarty
> config.ulica.formatter.template = search_ulice
>
>
> config.zastavba.provider.type = fulltextTable
> config.zastavba.provider.table = koz_zastavba
> config.zastavba.provider.id = id
> config.zastavba.provider.columns = id, cislo_domu, ulica
> config.zastavba.provider.fulltextColumns = ulica, cislo_domu
> config.zastavba.provider.sortColumn = cislo_domu
> config.zastavba.provider.sortDirection = asc
> config.zastavba.provider.sortPriorities = cislo_domu
> config.zastavba.provider.labels = cislo_domu, ulica
> config.zastavba.formatter.type = smarty
> config.zastavba.formatter.template = search_results
>
>
>
> - in "search.tpl" I have:
> <div id="search_ulice_div"></div>
>
>
>
> - in Search.ajax.js I have:
> if (pluginOutput.htmlCode.ulica)
> $('search_ulice_div').innerHTML = pluginOutput.htmlCode.ulica;
>
> function initializeUlica() {
> search('ulica');
> }
>
> Event.observe(window, 'load', initializeUlica, true);
>
>
>
>
> - in search_ulice.tpl I have:
> <select name="search_ulica" id="search_ulica">
> {foreach from=$table->rows item=row}
> <option value="{$row->rowId}">
> {foreach from=$row->cells item=value}
> {$value}
> {/foreach}
> </option>
> {/foreach}
> </select>
>
>
>
> The combobox is displayed correctly (with data from db), but search
> doesn't work.
> It says: "No result"
>
> When I replace "<div id="search_ulice_div"></div>"
> (in search.tpl) with:
>
> <select name="search_ulica" id="search_ulica">
> <option value='prva'>prva<option>
> <option value='druha'>druha<option>
> <option value='tretia'>tretia<option>
> </select>
>
> it works fine.
> But I'd like to get select values from db :-(
>
> Any idea?
> Where I was wrong?
>
> thank you
>
> wochter
>
>
>
> Brendan Walashek wrote / napísal(a):
>> Is there any way to do an address search with Cartoweb? I have seen
>> being able to search on ID's or other attributes, but what about
>> addresses using the address ranges of a street network? Any live
>> examples anywhere? Does it involve a custom search plugin? I will be
>> using PostgreSQL as well as PostGIS (as this is required, right?). For
>> example I want to be able to search for 123 Main Street.
>> Thanks.
>>
>> --
>> Thanks,
>> Brendan Walashek
>> www.golfingvancouver.com <http://www.golfingvancouver.com>
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Cartoweb-users mailing list
>> Cartoweb-users at lists.maptools.org
>> http://lists.maptools.org/mailman/listinfo/cartoweb-users
>
>
> _______________________________________________
> Cartoweb-users mailing list
> Cartoweb-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/cartoweb-users
>
More information about the Cartoweb-users
mailing list