I have inserted the Joomla search module in an article.
Now I wish that this module would allow me to search only in the article in which it is present and not throughout the site!
Is it possible?
I have inserted the Joomla search module in an article.
Now I wish that this module would allow me to search only in the article in which it is present and not throughout the site!
Is it possible?
No, the Joomla search module will not work to search within a single article. But there are several ways you can make your FAQ more user friendly, depending on how complex it is. Here's a couple of ideas:
Implement a in-page search box using JavaScript. I found the following code that should work, although it's quite old (the site talks about Netscape, a browser from the era of the dinosaurs...):
var TRange=null;
function findString (str) {
if (parseInt(navigator.appVersion)<4) return;
var strFound;
if (window.find) {
// CODE FOR BROWSERS THAT SUPPORT window.find
strFound=self.find(str);
if (!strFound) {
strFound=self.find(str,0,1);
while (self.find(str,0,1)) continue;
}
}
else if (navigator.appName.indexOf("Microsoft")!=-1) {
// EXPLORER-SPECIFIC CODE
if (TRange!=null) {
TRange.collapse(false);
strFound=TRange.findText(str);
if (strFound) TRange.select();
}
if (TRange==null || strFound==0) {
TRange=self.document.body.createTextRange();
strFound=TRange.findText(str);
if (strFound) TRange.select();
}
}
else if (navigator.appName=="Opera") {
alert ("Opera browsers not supported, sorry...")
return;
}
if (!strFound) alert ("String '"+str+"' not found!")
return;
}
Use a knowledgebase extension that has built-in search function.
No, it is not possible. Joomla "Search module" search through content areas in CMS database. It does not search in a published article, on the browser side.
There seem to be a couple of Joomla modules which allow you to search for text within the same page using JavaScript.
Not sure if this is what you are looking for https://jdev.l-it.co.za/products/in-page-search-term-highlighter
This module basically lets you search for content within the same page you are on, similar to the CTRL+F browser search feature.