1
votes

I wanted to know if this is possible and has an easy way of implementing. The scenario:

We are updating our website to use Joomla CMS. The old website has a huge table in the database with information on hundreds of stores (hours, location, staff, etc). We can transfer this table to the new Joomla MySQL database. We also have a Google Map with about a thousand pins (each pin corresponds to the location of each store). We want to add a link in the description of each pin that will take you to a page displaying the store information from the database.

I found a Joomla extension that can take a spreadsheet and create a new article for each row, so all I would have to do is export the table as a spreadsheet and upload it into Joomla. Then each store would have its own webpage. The problem with this is that the Google Map pin guy has to search the Joomla site for each store page and copy paste the link onto the pins (there are hundreds, so not only would it take days but we would also be creating hundreds of posts).

I was thinking one possibility would be if the Google Map pin guy creates a URL for each store pin. This URL will query the database and display the information. For example: http://mysite.com/stores?name=mcdonalds&state=california&country=usa. This would find the specific row in the database and create a page displaying this rows information (store name, hours, location, manager name, etc). How would we do this?

Is there any easier way to make this happen that you guys can think of? No matter what, it seems to me like the Google Map guy is going to be spending hours copying links or creating links. Maybe there is some way of importing data from the database into the Google Map pins, thereby eliminating the need to create new store webpages?

1

1 Answers

0
votes

You should look at building your own component. In essence all you need is a php file in its own folder under /components/com_yourcomponent/yourcomponent.php

The code within that file will be called as long as you pass option=com_yourcomponent in your url along with the other parameters your provided in your example.

You, or your programmer, then just needs to query your db table, retrieve the result that matches the parameters passed in, format the output and echo it out into the page.

Joomla pretty much takes care of the rest.

Of course you can get much more complex and follow MVC patterns and add all sorts of extra complexity - but you certainly don't have to.

I'd recommend reading the Joomla documentation appropriate to your specific version of Joomla with reference to building a simple component.