How to access images from the adminpanel

Discuss PivotX 2.0.x extensions here, and view extensions that are available for download.

How to access images from the adminpanel

Postby Gooly » Fri Aug 26, 2011 8:46 am

I have an idea for an extension, but it requires that I can access/select images from the admin panel.
Basically it creates a menu with corresponding images for every link. So the form layout in the admin panel should be something like this:

[image] [url] [tekst]
[image] [url] [tekst]
[image] [url] [tekst]
etc.

Of course I could create a text inputfield and ask to give absolute paths to the images. But it would look more sophisticated when there was a button, or a select field where you could choose images from the /pivotx/themes/mytheme/images/ directory (preferably) or from the /images/ directory.

Another question: Can I just use jQuery in the adminpanel to create a button to add or remove fields to/from the form?
That's the trouble with reality,
it's taken far too seriously
User avatar
Gooly
 
Posts: 77
Joined: Thu Nov 19, 2009 5:52 pm
Location: Lat 52° 4' 11.4874" Lon 4° 17' 28.001"

Re: How to access images from the adminpanel

Postby hansfn » Mon Aug 29, 2011 12:57 pm

You can do stuff like that - use the Javascript function openImageWindow. The MarkItUp editor (which you get if you select 'None (plain XHTML)' as editor) does that - see includes/markitup/set.js Haven't used it outside the body/intro fields so I don't know for sure if it works.

Yes, you can use JQuery in forms - see for example the function/form getLoginForm in the file forms.php.

Sorry about the late reply - very busy right now.
hansfn
Developer
 
Posts: 3280
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: How to access images from the adminpanel

Postby Gooly » Tue Aug 30, 2011 8:25 am

That's OK, I appreciate your help (Sometimes it looks like questions are only anwered by three people here :) )
Thanks!
That's the trouble with reality,
it's taken far too seriously
User avatar
Gooly
 
Posts: 77
Joined: Thu Nov 19, 2009 5:52 pm
Location: Lat 52° 4' 11.4874" Lon 4° 17' 28.001"


Return to 2.x Extensions

Who is online

Users browsing this forum: No registered users and 5 guests