Hello,
I'm currently building my custome front page: http://alphaflight.net/showwiki/
I would like to add in a search box, like is seen on the default front page. What code do I need to add a search field to a page?
Hello,
I'm currently building my custome front page: http://alphaflight.net/showwiki/
I would like to add in a search box, like is seen on the default front page. What code do I need to add a search field to a page?
You'll need to use HTML on the page, so HTML needs to be allowed for the forum the page is saved in. If you do that, you definitely want to use forum permissions to lock down who's allowed to edit the page.
- lead developer for VaultWiki
Gotcha. since this page is in my content namespace, I'd have to make all my wiki allow HTML, which I'm not fond of the idea of; even though only site members can post/edit...How does the "special" page allow a search field? If it's outside the namespace, how can I make my custom front page so?
If I were to allow HTML, what is the code that the default page uses to put in the search field?
you can also enable and add the Vbulletin sidebar, and put a wiki only search bar in it, like i did on http://www.birthright.net/forums/showwiki.php
you will need a mod from vbulletin.org (sidebar everywhere)
http://www.vbulletin.org/forum/showthread.php?t=233871
then add a custom block through your vbulletin control panel (forums & mods -> forum block manager)
create a new block with
then go to your styles and add a new template called: block_wikisearchCode:$templater = vB_Template::create('block_wikisearch'); $content = $templater->render(); return $content;
put the folowing code in it:
if you want to let it show on wiki pages only, check the sidebar everywhere settingsCode:<!-- Search Box --> <form action="search.php?do=process" method="post" id="searchform"> <input type="hidden" name="s" value="" /> <input type="hidden" name="do" value="process" /> <input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" /> <input name="contenttype" value="VaultWiki_VaultArticle" type="hidden"> <input id="keyword" class="textbox" name="query" tabindex="1" value="" type="text"> <input class="button" value="Go" type="submit"> <br /> <label><input type="checkbox" name="titleonly" value="1" class="searchtype" style="margin: 5px 0 0 5px;" /> Search Titles Only</label> </form> </form> <!-- /Search Box -->
Thanks Lord Doys,
I had no issues with installing the product and creating the block, but I'll be darned if I can figgure out how to get the sidebar to appear at all on the wiki...I tried hunting through the wiki templates to add the strings listed in the install instructions for "Instructions for custom pages" but I can't find the strings they want found...
How did you get it to show on your wiki?
hmm i cant remember doing something special about it.. its been a while
the custom pages is only for php/hml files that dont belong to the vbulletin framework. i only use that on my interactive map but not for the wiki.
nor can i see any wiki templates changed..
i will have to look into it further
ah i found it
i created a plugin under (admincp -> plugins & prods -> add new plugin)
by the looks of it, i "linked" it to the member sidebar, so you can use the member show/hide option in the ESB options to turn it of and on
product: Everywhere Sidebar
Hook location: vault_article_complete (VaultWiki)
title: wiki_sidebar
execution order: 5
plugin php code:
Code:if ($bbandSBactive and $vbulletin->options['esidebar_memberlist']){ require_once(DIR . '/includes/class_block.php'); $show_sidebar = false; $blockmanager = vB_BlockManager::create($vbulletin); $sidebar = $blockmanager->getSidebarHTML(); if ($sidebar) { $show_sidebar = true; if (function_exists(rebuild_sidebar))$sidebar=rebuild_sidebar($blockmanager,$sidebar); $templater = vB_Template::create('sidebarext_temp'); $templater->register('sidebar', $sidebar);$templater->register('show_sidebar', $show_sidebar);$templater->register('button_top_sidebar', intval($vbulletin->options['esidebar_button_top']));$templater->register('width_sidebar', intval($vbulletin->options['esidebar_width']));$templater->register('margin_sidebar', intval($vbulletin->options['esidebar_width'])+20); $template_hook['sidebarext_temp']=$templater->render(); $sidebarext_add = "' . \$template_hook['sidebarext_temp'] . '"; $sidebarext_search = '/\' \. \$footer \. \'/'; $sidebarext_replace = $sidebarext_add . "' . \$footer . '"; $memberlistSIDEBAR = preg_replace($sidebarext_search, $sidebarext_replace, $vbulletin->templatecache['vault_article_main']); $sidebarext_search = '/\' \. \$navbar \. \'/'; $sidebarext_add ='<div id="content_container"><div id="content">'; if($vbulletin->options['sidebarposition']==0)$sidebarext_add ='<div id="content_container" class="contentright"><div id="content">'; $sidebarext_replace = "' . \$navbar . '" . $sidebarext_add; $memberlistSIDEBAR = preg_replace($sidebarext_search, $sidebarext_replace, $memberlistSIDEBAR); $vbulletin->templatecache['vault_article_main'] = $memberlistSIDEBAR; } }
i now remember why i did it this way. I didnt want to hack 2 different products in case they are updated and things will be overwritten
Thanks again for helping me out with this LD, I tried made the plugin as you directed, it didn't go over too well. I got this when loading the wiki:
Code:Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /hermes/waloraweb011/b1777/moo.benjaminlwells/vault/tab/article.php(712) : eval()'d code on line 15 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /hermes/waloraweb011/b1777/moo.benjaminlwells/vault/tab/article.php(712) : eval()'d code on line 15 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /hermes/waloraweb011/b1777/moo.benjaminlwells/vault/tab/article.php(712) : eval()'d code on line 15 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /hermes/waloraweb011/b1777/moo.benjaminlwells/vault/tab/article.php(712) : eval()'d code on line 18 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /hermes/waloraweb011/b1777/moo.benjaminlwells/vault/tab/article.php(712) : eval()'d code on line 18 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /hermes/waloraweb011/b1777/moo.benjaminlwells/vault/tab/article.php(712) : eval()'d code on line 18 Warning: preg_replace() [function.preg-replace]: Unknown modifier 'd' in [path]/vault/tab/article.php(712) : eval()'d code on line 17 Parse error: syntax error, unexpected T_STRING in /hermes/waloraweb011/b1777/moo.benjaminlwells/includes/class_core.php(4627) : eval()'d code on line 1
I have had some issues copying code blocks from this site as wel.
I found out if quote the msg with the code, and select the code from the quoted msg.
If that dont work, pm your email and ill send a txt file
ah, perfect that did it! Now you've got me wondering how you made the block for recent wiki changes? Is it custom code, or did you use the preset to look at the namespace forum?
Fixed the bug with the backslashes inside the code block. It was a bug in VaultWiki, so your sites will have it too: https://www.vaultwiki.org/issues/2639/
- lead developer for VaultWiki
Bookmarks