hi there!
I am wondering what is the best way to render a finder-form in the page template. It could use a block - but as the Finder-Form should work like a Search Field, i would prefer putting it in the page.tpl file.
Thanks!
Walter
hi there!
I am wondering what is the best way to render a finder-form in the page template. It could use a block - but as the Finder-Form should work like a Search Field, i would prefer putting it in the page.tpl file.
Thanks!
Walter
Comments
Comment #1
danielb commentedprobably as a block
<?php print finder_view(finder_load(3), 'block'); ?>or
<?php print theme('finder_block', finder_load(3)); ?>where 3 is the finder ID.
let me know if there's a problem
Comment #2
danielb commentedComment #4
valderama commentedfinally i found time to try this. i works kind of... the finder is printed as wanted, but not working, i guess because the javascript is just included on those pages where the block is actually shown (as configured under admin/build/block)
--- UPDATE: Seems like the only problem is, that the JS and some extras needed for the autocomplete textfield are not loaded on pages, where the "normal" finder-block is not displayed.
is it this check in finder_autocomplete.module ??
line301:
if (menu_valid_path(array('link_path' => $element['#autocomplete_path']))) {---UPDATE2: i can get it work by manually adding the finder_autocomplete.js in template.php -- as the finder should be visible on all pages this seems to be ok. lets see if i forgot something...
in template.php
drupal_add_js(drupal_get_path('module', finder_autocomplete) .'/finder_autocomplete.js');so i am trying to solve, if you have hints they are greatly appreciated :)
thx!
walter
Comment #5
undersound3 commentedI am printing out a finder instance with autocomplete element in page.tpl.php like so:
<?php print finder_view(finder_load(3), 'block'); ?>For the autocomplete suggestions box to show up I needed to either:
add the block created by the "Provide block" option
or
add
drupal_add_js('misc/autocomplete.js');to template.phpWhy do I need to manualy add this automplete.js file to template.php when I am manualy printing out the finder instance through finder_view?
Thanks in advance for any feedback on this
Comment #6
danielb commentedcontinued in #1086360: Autocomplete suggestions not showing up when manually printing with finder_view