It looks like you're new here. If you want to get involved, click one of these buttons!
I'd like to add a default value and some other customisations to the search field HTML but I can only see the PHP that generates the search box the the default.master file rather than the actual code itself, where can I find this?
Answers
First of all: It's a really bad idea altering the core view files (with the exception of default.master.tpl). You shouldn't edit the markup directly if you want to add a pre-defined value to the search field. You'd be better off using jQuery and the attr() function like this:
jQuery('your-selector-here').attr('value', 'Some default value...');If I were you, I'd use the
placeholdervalue instead though:jQuery('your-selector-here').attr('placeholder', 'Your placeholder text...');A placeholder is removed automatically once the field is populated.
//Kasper
Kasper Kronborg Isager | Full-time interwebs monkey working @Vanilla | Hit me up: Google Mail or Vanilla Mail | Find me at Github
- Spam
- Abuse
- Troll
1 • Off Topic 1Insightful Awesome LOL •Hi kasperisager, I don't mind editing the markup directly, I'll keep a backup. I need to make some other changes too, where is the search core view file?
Thanks (:
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •I'm aiming to end up with something like this http://d.pr/i/13H1, so far I've been able to colour it, and remove the border. Just looking to add that text in there and setup the search button like that. Placeholder isn't a great solution as this isn't supported by Internet Explorer.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •grep -ri Search * and look at the results in the view folders.
factoid: Most questions have been previously answered, try the search box first, please provide your Vanilla version Number!
Peregrine's Addons - donations gladly accepted for "successful solutions" and addons - kind of like tipping a waiter at a restaurant
- Spam
- Abuse
- Troll
1 • Off Topic 1Insightful Awesome LOL •Hi, sorry what does grep -ri mean?
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •you can google grep - it searches for terms in your code. helps you locate what you are looking for to do what you want to do, assuming you have some basic ability to read and change code.
more info here -
http://vanillaforums.org/discussion/comment/164114/#Comment_164114
factoid: Most questions have been previously answered, try the search box first, please provide your Vanilla version Number!
Peregrine's Addons - donations gladly accepted for "successful solutions" and addons - kind of like tipping a waiter at a restaurant
- Spam
- Abuse
- Troll
1 • Off Topic 1Insightful Awesome LOL •Command-line? I think it's best that I stay away from that... haha
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •