Manipulating search box


#1

Hi,
Is there anyway to manipulate the search box content like so:

… adding a link on top of the search box.
I tried doing this:

Discourse.ApplicationRoute.on(‘activate’, function(){
$(’#search-dropdown’).prepend(“Search mainsite.com”);
});

but seems like $(’#search-dropdown’) is not loaded until the search button is clicked.

Thanks much in advance!


(Robin Ward) #2

It would not be hard to add via a plugin. I’ve created a plugin-outlet for this called search-above.

Unfortunately, I saw you’re hosting with us on the standard plan which doesn’t allow plugins. We’ve discussed having a way for non-plugins to enter data into plugin outlets via admin or something but we haven’t gotten around to it yet.


(Kane York) #3

Actually, you can. Put a handlebars template in a <script> and it’ll get picked up by the connectors. (We had to re-add the compiler to our vendor bundle for this reason when it got dropped from the default.)


(Robin Ward) #4

Yes I’m aware of that, but I worry that it’s not super future proof. I don’t want everyone doing that and preventing us from upgrading in the future.