Make Custom Module Pages Searchable
Jamroom Developers
Yes,
@michael I completely agree. I am just unsure of the best way to enter the over 5000 entries. If I could "harvest" the page urls from the sitemap and add them to the datastore using a simple search query that would be great.
Another thought I had was connected to the fact that I am already adding the pages to the site map via a function in my module.
Is there a similar statement that I can code to add these same urls directly into the datastore?
Can I add something like this to my module's include.php?
function myCustomModule_addURLToDataStore_save($_post, &$_user, &$_conf)
{
$url = jrCore_get_module_url('myCustomModule');
$_data[] = "{$_conf['jrCore_base_url']}/{$url}/birmingham-alabama-electricians";
$_data[] = "{$_conf['jrCore_base_url']}/{$url}/montgomery-alabama-electricians";
$_data[] = "{$_conf['jrCore_base_url']}/{$url}/huntsville-alabama-electricians";
$_data = jrCore_form_get_save_data('myCustomModule', 'create', $_post);
}
I can see from other modules that a view function is used in the index.php file of the module, as the data is being saved from a form, but I do not need a form as I would like to hard code the URLs that I want to be added to the datastore. Similar to the way that I added the list of URLs to the Sitemap. I know that my code is not correct, but I hope that I am getting close. I would also like to make sure that this way of adding data into the datastore does not produce duplicates.
Any assistance would be greatly appreciated. THANKS!!