- Posts: 26
- Thank you received: 0
creating form on marker
- Eddstyson
- Topic Author
- Offline
- Junior Member
Please Log in or Create an account to join the conversation.
- Dima
- Offline
- Platinum Member
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.
- racetech
- Offline
- New Member
- Posts: 9
- Thank you received: 0
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.
- Dima
- Offline
- Platinum Member
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.
- racetech
- Offline
- New Member
- Posts: 9
- Thank you received: 0
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.
- Dima
- Offline
- Platinum Member
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
Please Log in or Create an account to join the conversation.