creating form on marker

  • Eddstyson
  • Eddstyson's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
10 years 9 months ago #2823 by Eddstyson
creating form on marker was created by Eddstyson
can anyone assist me on how to create a form that links to a database on a marker...firstname...lastname..activityinthisregion

Please Log in or Create an account to join the conversation.

More
10 years 9 months ago #2825 by Dima
Replied by Dima on topic creating form on marker
Hi

For what reason you need form. You can enter your placemarks in admin, and set association with contact, for example. Or enter all your information in infowin content

Don't forget support my developments: post review in JED , donate , help with translation ;)

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago #3983 by racetech
Replied by racetech on topic creating form on marker
Hi Dima,

I wanted to insert data from a table, created by me in my joomla database, in text editor for each marker, the variable to select the record from the table could be inserted in the title box of the marker.

How could I do this?

Within my text editor (JCE) I can insert PHP code, but do not know how to call the data from my table using the field "title" of the marker form as a variable.

Can you help me with that?

Thank you and best regards

Fernando

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago #3984 by Dima
Replied by Dima on topic creating form on marker
Hi

You can't change title.
You can suppress title and description (by setting infowin content placemark property), and call in Addition HTML field iframe tag. And in iframe tag you can call php file to get your database data, simple read from database table by joomla (you can find a lot of examples in internet), simple reading data from table - you can see in models folder of extension

Don't forget support my developments: post review in JED , donate , help with translation ;)

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago #3994 by racetech
Replied by racetech on topic creating form on marker
Hi Dima, thanks for the help.

I tried to do as you told me, inserting the php code with MySql query in Adition HTML Text Editor of ZhGoogleMaps of Mark, but do not working. I tried with two different plugins, DirectPHP and Sourcerer.

In the infoWin of the Mark on the map in the frontend, shows the php code, not the result of the MySql query.

Do you have any ideas to help me?

Thanks and best regards,

Fernando

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago - 10 years 5 months ago #3995 by Dima
Replied by Dima on topic creating form on marker
Hi Fernando

I didn't suggest you to insert php call into Addition HTML. It is different program languages!

I suggest you:
1 - create php file, add into it joomla's call database query and storing data into array or record (load object or load object list) like this I do for loading paths, look at function source

$id = $this->getState('map.id');

$db = JFactory::getDBO();

$query = $db->getQuery(true);

$query->select('h.*, c.title as category ')
->from('#__zhgooglemaps_paths as h')
->leftJoin('#__categories as c ON h.catid=c.id')
->where('h.published=1 and h.mapid='.(int)$id);
$db->setQuery($query);

// Paths
if (!$this->paths = $db->loadObjectList())
{
$this->setError($db->getError());
}


2 - and in your file as a result put echo with HTML resutl code
3 - call this file in iframe, in this case your code will be added into content

Don't forget support my developments: post review in JED , donate , help with translation ;)
Last edit: 10 years 5 months ago by Dima.

Please Log in or Create an account to join the conversation.

Time to create page: 0.074 seconds

Donate


Go to top