Progress (Sort of)

My site is coming together. Well, sort of. I have a lot of pieces floating around in cyberspace. The biggest piece, however, is my first customization: the interactive map. I downloaded the Leaflet map plugin, which uses an open-source JavaScript library for creating interactive maps. The API is pretty well documented, but there are some things I couldn’t figure out.

Once I input the shortcode to create my map at the location I wanted it and then created the marker for one of my sites, I was able to figure out how to program it to include photos on the markers. But I quickly realized that I did not understand the interface. Before I installed the plugin, I was convinced that I had missed the mark and that none of my customizations would be code customizations because they could all be done with plugins. When I started the work, I figured out that you can type code into plugins (duh). Then, I realized I don’t understand the relationship between plugins and APIs.

Troubleshooting my map plugin helped to give me a basic understanding. I know that a plugin contains groups of functions and is written in PHP. I know that the Leaflet map plugin uses a JavaScript library. This part confused me. When I was writing code for my map, I was confused about which type of file to create in Sublime Text. I settled on JavaScript but as I was typing my code, my mind wandered to if I should create HTML and CSS files to accompany it. At that point, I knew I was overthinking.

Though the map plugin boasts about its well-documented API, it’s still a little hard to understand for me as a beginner. It has lists defining elements, events, methods, and options, (?)  but I get confused about what exactly to type since programming is very specific.

I also had problems with issues with FileZilla. When I tried to connect, I kept getting an error message.

I have one lingering question. What is the relationship between an API and a plugin?

1 thought on “Progress (Sort of)

  1. Greg Linch

    Good question about plugins and APIs! You are correct that a plugin is one or more functions that add functionality to the WordPress site. Plugin code always includes some PHP, but can also include — or even primarily be written in — JavaScript or jQuery depending on what you’re trying to do. An API is just a way for servers to talk to each other and exchange data. A plugin could use a third-party API to pull data into your site, push your data to an external API or have no connection to an outside API at all. There’s no inherent relationship between the two things. Does that help? We can certain discuss this more in class.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.