Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Adding An Attribute To Search
Xarcell
✭
I'm going through the template code and cannot find HTML where I can add the "placeholder" attribute to the forum search. I want to change this:
<input type="text" id="Form_Search" name="Search" value="" class="InputBox">
to this:
<input type="text" id="Form_Search" name="Search" value="" placeholder="Search Forum!" class="InputBox">
Tagged:
0
Best Answer
-
hgtonight MVP
Replace this line
$Form->TextBox('Search'),
with$Form->TextBox('Search', array('placeholder' => 'Your new text')),
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
5
Answers
Quick tip, visit https://github.com/vanillaforums/Garden/find/master and enter the term "search". Upon finding the the correct file from views, in this caseapplications/dashboard/views/search/index.php
and `` I would copy it tomytheme/views/search
and make the changes needed.Oops applies to a different page, but looks like you can use Smarty tags.
There was an error rendering this rich post.
What version of Vanilla are you running?
Are you referring to the default theme, or something else?
Assuming you are using a theme with a default.master.tpl file that uses the smarty tag
{searchbox}
you can add$Definition['Search'] = 'My other placeholder text';
to your/conf/locale.php
file.Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
I'm using a custom theme I made, and vanilla 2.0.18.8. I see no tpl files. I see the default.master.php file though. I also see this within it:
Replace this line
$Form->TextBox('Search'),
with$Form->TextBox('Search', array('placeholder' => 'Your new text')),
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
That worked great, thanks.