FORUMS CLOSED DUE TO SPAM. YOU STILL CAN ADD POST!

Asset manager plugin

Feed 276 posts, 32 voices

Avatar
291 posts

I needed simpler way to upload and embed images into article. Thanks to plugin API it could be easily done. Video tells more than 1000 words so screencapture as mp4 and swf formats. First one is better quality.

Assets plugin depends on Peter Gassners excellent Image Resize plugin. Since it uses jQuery you also need include it on backend template. Currently there is no realiable way for plugin to include external JavaScript libraries. Check the installation instructions for needed steps. You will also need the jQuery plugin. Check plugin homepage for all installation steps.

Please bear in mind that code was written this afternoon. It works for me now, but I will make it more configurable soon. Thats a promise :)

 
Avatar
1493 posts

How cool is that? OK. I will tell you. Very cool.

Not the funkiest soundtrack I ever heard, but hey, the video was nice. :)

 
Avatar
291 posts

Uh did I accidentally record what was playing in iTunes too? :D

 
Avatar
1493 posts

Uh did I accidentally record what was playing in iTunes too? :D

Unfortunately, no!

I just gave it a shot on TestFrog. Ooh boy, that was exciting! Somehow (?) ALL my plugins managed to get un-plugged, and there was a serious shortage of tabs in the admin. O_o

It was probably something I did, or maybe it just didn’t like my admin theme. Will try again (somewhere else).

 
Avatar
291 posts

It does override some CSS stuff to make room for assets on right side. So it is possible layout breaks with custom admin themes. However there is nothing special done when enabling the plugin.

 
Avatar
486 posts

Very nice, tuupola. Did you already change your admin javascript framework to jquery or are you using both in this case?

I would have thought there would be conflicts with the prototype…

 
Avatar
291 posts

Using both. I am using “noconflict” mode which enable jQuery to be run together with other JavaScript libraries.

 
Avatar
1493 posts

Have this running nicely on an 0.9.4 install now. Very slick! :) Do you have some dev plans for it, tuupola?

 
Avatar
291 posts

At least paging for the page under Assets tab (if you have hundreds of images). Support to other assets than images. Configurable folders. Maybe one click upload etc. Anyway I personally like to keep things simple.

 
Avatar
316 posts

I just gave it a shot on TestFrog. Ooh boy, that was exciting! Somehow (?) ALL my plugins managed to get un-plugged, and there was a serious shortage of tabs in the admin. O_o

This might actually have something to do with the plugin itself. I was playing with a 301 plugin idea, before I figured out how to properly configure my .htaccess file. After putting the plugin in place and enabling it, all the other plugins were disabled.

I really have no idea what went wrong. I stopped playing with the code at that point and went back to learning mod_rewrite rules, which was much simpler in the end.

 
Avatar
486 posts

Support to other assets than images. Configurable folders. Maybe one click upload etc.

This is a very good idea for a plugin. What I’d like to see is a master assets plugin that will allow other plugins to register with it, then whatever data is gathered by those other plugins can show up in this master assets sidebar. Perhaps each registering plugin can then be allocated a section, like an accordion fold.

The registering plugin would determine which data would show up.

For example, if we had a Calendar plugin, all the event infromation can be added via the tab and forms generated by the Calendar plugin. Because, this Calendar plugin registers with the master assets sidebar plugin, Calendar events will be available from this sidebar that can then be dragged into a page.

Basically all I’m looking to do drag is the id of the event into the page (a page Part). Then the layout takes care of the rest.

Events that have already been assigned to a page wouldn’t show up in the sidebar. The specific rules for what shows up can be determined by the Calendar plugin.

This would work for all kinds of data and can be a good way to have the flexibility of unique forms or custom content types (via plugins), while also keeping the power and order of the Page system.

What do you think?

 
Avatar
486 posts

Perhaps even give the registering plugins the ability to say when its data will show up. So for example to reduce clutter, Calendar plugin might say to the master assets plugin, only pull up calendar data if the page is a child of calendar slug, in other words the parent’s slug is “calendar”

 
Avatar
486 posts

Also it would be nice if the sidebar widget thing did not have to be stuffed into that tiny body tab…

 
Avatar
486 posts

Hmm…I’m wondering how you guys got this plugin to work. For me it doesn’t work. It expects images at htdocs/assets whereas the image_resize plugin (a dependency), puts images at mysite/public/images

In other words, one uses DOCUMENT_ROOT and the other uses FROG_ROOT. I tried making some changes to get it working, but still not successful. Something else may be going on…

Any advice?

 
Avatar
291 posts

You have old version of image_resize plugin.

 
Avatar
291 posts

BTW I noticed there are some layout problems when you add new pageparts and resize the screen and Asset manager is enabled. This is due my lack of understanding of CSS. If somebody finds a fix let me know :)

 
Avatar
486 posts

You have old version of image_resize plugin.

Thanks, tuupola. I’ll try it again. Just wondering, is there an advantage to using DOCUMENT_ROOT over FROG_ROOT?

 
Avatar
291 posts

DOCUMENT_ROOT is always DOCUMENT_ROOT. FROG_ROOT can be something else. Meaning if you have installed Frog into subfolder FROG_ROOT would point to that subfolder.

 
Avatar
23 posts

Just thought you should know, theres a small bug in frog/plugins/assets/views/index.php

<a href="<?php print $image?>"<img src="<?php print $thumbnail ?>" /></a>

Should be

<a href="<?php print $image?>"><img src="<?php print $thumbnail ?>" /></a>

Great work tuupola, I think this can be improved a lot though, I know its a very early beta but I’d like to see:

  • a settings page to allow for any folder on the site to be chosen as the assets folder
  • support for .doc, .pdf, .xls etc files would be a great
  • a way to delete files
  • multiiple file uploads
  • categorization of files
  • pagination of the images in the pages UI

Just a few ideas.

 
Avatar
486 posts

BTW I noticed there are some layout problems when you add new pageparts and resize the screen and Asset manager is enabled. This is due my lack of understanding of CSS. If somebody finds a fix let me know :)

Maybe you can avoid the problem by putting the assets in the actual sidebar. To get the sidebar to show up on the page editing pages, you just need to comment out a few lines in admin.css

 
Avatar
486 posts

in case anybody wants to put it in the sidebar. this is the change in admin.css:

#installation #content-wrapper,
#body_setting_index #content-wrapper,
#body_page_index #content-wrapper,/*
#body_page_add #content-wrapper,
#body_page_edit #content-wrapper,*/
#body_snippet_add #content-wrapper,
#body_snippet_edit #content-wrapper,
#body_layout_add #content-wrapper,
#body_layout_edit #content-wrapper,
#body_user_add #content-wrapper,
#body_user_edit #content-wrapper,
#body_comment_edit #content-wrapper,
#body_plugin_index #content-wrapper {
  margin-right: 0;
  width: 98%;
}
#body_setting_index #sidebar-wrapper,
#body_page_index #sidebar-wrapper,/*
#body_page_add #sidebar-wrapper,
#body_page_edit #sidebar-wrapper,*/
#body_snippet_add #sidebar-wrapper,
#body_snippet_edit #sidebar-wrapper,
#body_layout_add #sidebar-wrapper,
#body_layout_edit #sidebar-wrapper,
#body_user_add #sidebar-wrapper,
#body_user_edit #sidebar-wrapper,
#body_comment_edit #sidebar-wrapper,
#body_plugin_index #sidebar-wrapper {
  display: none;
}

And in the Javascript file something like:

    /* Run only when editing a page. */
    if (jQuery('#page-1 textarea').size()) {
        jQuery('#sidebar')
 
Avatar
291 posts

@rick: Cool thanks. That seems to work pretty well. Although I feel that when assets are thrown into sidebar it feels they are separated from the content area. I will play around with the UI a bit.

@eoghanobrien: Thanks for the heads up. Bug is now fixes. Also some of the features you mentioned are already done on my development version. Stay tuned :)

 
Avatar
291 posts

Here are quick screenshots of new features. You can configure multiple different upload directories. You can use this for categorizing assets. Note that you still have to create the directories manually. This is in my TODO list.

Adventurous people can install latest from GitHub. Same warning as before. Works for me, but is beta quality code.

NOTE! If you are using with current svn make sure FROG_VERSION is 0.9.5.

 
Avatar
1493 posts

@tuupola: I just tried upgrading this plugin to v. 0.3.0, but I’m getting a funny result. (I have installed your jQuery plugin, too!) The older version was working well, and this still shows me my “assets” and handles the upload fine.

But! In the sidebar of the Pages for editing, I’m getting a string of little boxes about 6px wide and 22px high corresponding to the files in my Frog’s root dir, rather than the nice little thumbnails of my “assets”.

Any thoughts?

UPDATE — ignore me! O_o I don’t quite know what happened, but it’s all good now.

 
Avatar
291 posts

@david: Try first disabling the plugin and then enable it again. New version writes some default settings to Frog’s settings table. I guess you just overwrote the old plugin without disabling it first?

I’m running SVN and 0.9.4 myself.

BTW. I did some changes to code today. So if you want the latest features you might want to download again.