documentcloud / wordpress-documentcloud

Embed DocumentCloud documents that won't be eaten by the visual editor
https://wordpress.org/plugins/documentcloud/
GNU General Public License v2.0
9 stars 14 forks source link

Sidebar widget for Document List embed #13

Open eyeseast opened 10 years ago

eyeseast commented 10 years ago

I did the first version of the sidebar widget on Homicide Watch just using a regular text widget. Is it worth trying to make this easier without duplicating a lot of documentcloud.org functionality?

reefdog commented 9 years ago

@eyeseast Hmm, maybe so. Do you want to flesh out the use case, perhaps share how you did yours?

eyeseast commented 9 years ago

Sure @reefdog. All I did was use the standard DocumentCloud document list widget in a text widget:

<div id="DC-search-group-homicide-watch" class="DC-search-container"></div>
<script src="http://s3.documentcloud.org/embed/loader.js"></script>
<script>
  dc.embed.load('http://www.documentcloud.org/search/embed/', {
    q: "group: homicide-watch",
    container: "#DC-search-group-homicide-watch",
    order: "created_at",
    per_page: 5,
    search_bar: false,
    organization: 170
  });
</script>

It's a perfectly serviceable way to get a sidebar widget with my recent documents in it. You might have a more WordPress-y widget that let you choose those options from within the WP admin, but like I said above, you might end up just duplicating a bunch of functionality that's already in the DocCloud admin (and easy enough to use there).