<p>I think the short answer is yes, you do need a plugin to listen for events or tie into Craft's hooks.</p>

<p>Luckily if that is all you need to do you can probably get away with writing a plugin that is only the singular plugin class file, you may not need any other plugin classes (models/records/etc).</p>

<p>It seems as if you want to listen for <a href="http://buildwithcraft.com/docs/plugins/hooks-and-events#listening-for-events" rel="nofollow">onSaveEntry</a>.</p>

CC BY-SA 3.0
2015-04-15T15:34:45.307Z
That's what I thought, and I was reading exactly where your link sent me a few minutes ago.  I'll try my hand at creating a simple plugin then.
Eric Chantigny
CC BY-SA 3.0
2015-04-15T15:36:20.880Z
In making my own I found reading the source for existing plugins really helpful. Pixel and Tonic's github profile has some, and looking through the community plugins some (not many) of them are open-source. Good luck!
Brett Bender
CC BY-SA 3.0
2015-04-15T16:25:56.670Z
Have a look at the [BusinessLogic plugin](https://github.com/lindseydiloreto/craft-businesslogic), which provides a really basic plugin template complete with service, controller, and variables file and inline documentation.
Douglas McDonald
CC BY-SA 3.0
2015-04-15T15:31:08.337Z
2015-04-15T15:31:08.337Z
Brett Bender
<p>I am trying to understand if it is possible to do a hook on an entry save without creating a plugin.</p>

<p>This is what I would like to happen:
- In my entry, I have some address fields (street, city, province...).
- I would like to take those info and go grab a lat and long from Google maps and save it with the entry.  The lat and long fields are also available in the entry if people want to fill them or modify them.</p>

<p>I was doing all this in Wordpress with custom post types, but I'm trying to convert it to Craft.</p>

<p>Is it possible or do I have to create a plugin to do it?</p>

<plugin-development><custom>
How to save extra data when I save an entry
# How to save extra data when I save an entry

(Asked by: username_0 on 2015-04-15)

I am trying to understand if it is possible to do a hook on an entry save without creating a plugin.

This is what I would like to happen:
- In my entry, I have some address fields (street, city, province...).
- I would like to take those info and go grab a lat and long from Google maps and save it with the entry. The lat and long fields are also available in the entry if people want to fill them or modify them.

I was doing all this in Wordpress with custom post types, but I'm trying to convert it to Craft.

Is it possible or do I have to create a plugin to do it?

**Tags:** plugin-development, custom


---

## 1 answers

### Answer by username_1 on 2015-04-15. Score: 1 | Accepted answer

I think the short answer is yes, you do need a plugin to listen for events or tie into Craft's hooks.

Luckily if that is all you need to do you can probably get away with writing a plugin that is only the singular plugin class file, you may not need any other plugin classes (models/records/etc).

It seems as if you want to listen for [onSaveEntry](http://buildwithcraft.com/docs/plugins/hooks-and-events#listening-for-events).

> **Comments:**
> **username_0**: That's what I thought, and I was reading exactly where your link sent me a few minutes ago.  I'll try my hand at creating a simple plugin then.  
> **username_1**: In making my own I found reading the source for existing plugins really helpful. Pixel and Tonic's github profile has some, and looking through the community plugins some (not many) of them are open-source. Good luck!  
> **username_2**: Have a look at the [BusinessLogic plugin](https://github.com/lindseydiloreto/craft-businesslogic), which provides a really basic plugin template complete with service, controller, and variables file and inline documentation.  

---

