JHTML image.site; Where to put the fail back images ?

For Joomla! 1.5 Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general
Locked
User avatar
e-motiv
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 168
Joined: Sun May 06, 2007 12:33 pm
Contact:

JHTML image.site; Where to put the fail back images ?

Post by e-motiv » Thu Feb 26, 2009 2:44 pm

Hello,

I am developing a plugin with an image inside. And I am using the following function in my php file:

Code: Select all

JHTML::_('image.site', 'icoon.png',NULL,NULL,NULL,'share','width="64" height="18" border="0"'); 
This means that IF there is a template icoon.png found back at templdir/images, use it, IF NOT use /images/M_images.
Now for my question: How do I tell my plugin's XML installation file to put the image inside /images/M_images (the fallback folder)?

I have looked for 2 hours and didn't found any answer for this.

I tried these, but that doesn't work either:
  • adding a folder named "images" (with icoon.png inside) to the zip package without specifiying it in the xml installation file
  • adding in according folder wíth the following explicit xml installation file tags:
    • Code: Select all

      <files> 
         <filename>images/icoon.png</filename> 
      </files>
    • Code: Select all

      <files> 
         <folder>images</folder> 
      </files>
    • Code: Select all

      <files> 
         <images>[images/]icoon.png</images> 
      </files>
      This one with or without the images/ folder.
Did we make a mistake? How is it supposed to be done? Plz help...
(I will make/complete a wiki doc from this thread BTW)

http://www.e-motiv.net Professional web development <== e-motiv ==> Spin off web projects http://attic.e-motiv.net

wizevinc
Joomla! Intern
Joomla! Intern
Posts: 68
Joined: Wed Jan 14, 2009 2:11 am
Location: Melbourne, Australia
Contact:

Re: JHTML image.site; Where to put the fail back images ?

Post by wizevinc » Mon Mar 02, 2009 4:34 am

have you tried using absolute path,
<files>
<filename>/images/icoon.png</filename>
</files>

User avatar
e-motiv
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 168
Joined: Sun May 06, 2007 12:33 pm
Contact:

Re: JHTML image.site; Where to put the fail back images ?

Post by e-motiv » Thu Mar 05, 2009 10:00 am

Code: Select all

<filename>/images/icoon.png</filename
<filename>/images/M_images/icoon.png</filename>
<filename>images/M_images/icoon.png</filename>
but the images is put here: htdocs/plugins/content/images/M_images/icoon.png

Even if I made the folders manually and then compressed into Zip file.
doesn't work, gives an installation error.

Folder tagged in the XML (<folder>...), gives the same error.

Isn't there really any way to put an image in higher folder than /plugins/... ?

http://www.e-motiv.net Professional web development <== e-motiv ==> Spin off web projects http://attic.e-motiv.net

User avatar
mcsmom
Joomla! Exemplar
Joomla! Exemplar
Posts: 7897
Joined: Thu Aug 18, 2005 8:43 pm
Location: New York
Contact:

Re: JHTML image.site; Where to put the fail back images ?

Post by mcsmom » Thu Mar 05, 2009 11:35 am

In 1.5 images for extensions are generally stored in the folder for that extensions. In 1.6 the plan is for them to go to the media folder.
So we must fix our vision not merely on the negative expulsion of war, but upon the positive affirmation of peace. MLK 1964.
http://officialjoomlabook.com Get it at http://www.joomla.org/joomla-press-official-books.html Buy a book, support Joomla!.

User avatar
e-motiv
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 168
Joined: Sun May 06, 2007 12:33 pm
Contact:

Re: JHTML image.site; Where to put the fail back images ?

Post by e-motiv » Thu Mar 05, 2009 1:27 pm

we solved it using:

Code: Select all

$_image   = JHTML::_('image.site', 'icoon.png',DS.'plugins'.DS.'content'.DS.'YAA'.DS,NULL,NULL,'share','width="64" height="18" border="0"');
this makes the ultimate path to our plugin folder (with the image inside of it)

http://www.e-motiv.net Professional web development <== e-motiv ==> Spin off web projects http://attic.e-motiv.net

User avatar
ianmac
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4784
Joined: Sat Sep 24, 2005 11:01 pm
Location: Toronto, Canada

Re: JHTML image.site; Where to put the fail back images ?

Post by ianmac » Fri Mar 06, 2009 2:10 pm

e-builds wrote:we solved it using:

Code: Select all

$_image   = JHTML::_('image.site', 'icoon.png',DS.'plugins'.DS.'content'.DS.'YAA'.DS,NULL,NULL,'share','width="64" height="18" border="0"');
this makes the ultimate path to our plugin folder (with the image inside of it)
You should not be using DS when calling image.site. URLs *always* use /, DS is only used when loading files in PHP on the local file system.

Ian

User avatar
e-motiv
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 168
Joined: Sun May 06, 2007 12:33 pm
Contact:

Re: JHTML image.site; Where to put the fail back images ?

Post by e-motiv » Fri Mar 13, 2009 6:10 pm

ianmac wrote:You should not be using DS when calling image.site. URLs *always* use /, DS is only used when loading files in PHP on the local file system.
I've adjusted that now. Thanks!! Seems logic now, of course, but I guess I got used to it TOO much :-)
I've been wondering about where to check/learn these kind of joomla specific know-hows, DOs and DON'Ts (without having to read all the docs on all resources at joomla.org ;) ). Any idea?

http://www.e-motiv.net Professional web development <== e-motiv ==> Spin off web projects http://attic.e-motiv.net

User avatar
e-motiv
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 168
Joined: Sun May 06, 2007 12:33 pm
Contact:

Re: JHTML image.site; Where to put the fail back images ?

Post by e-motiv » Fri Mar 13, 2009 6:14 pm

P.S. Suggestion:
Make the Image.Site function also look in the extension's (images') folder, because otherwise it's a bit contradictory when you can't install your images in the current one.

http://www.e-motiv.net Professional web development <== e-motiv ==> Spin off web projects http://attic.e-motiv.net

User avatar
ianmac
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4784
Joined: Sat Sep 24, 2005 11:01 pm
Location: Toronto, Canada

Re: JHTML image.site; Where to put the fail back images ?

Post by ianmac » Fri Mar 13, 2009 6:21 pm

e-builds wrote:
ianmac wrote:You should not be using DS when calling image.site. URLs *always* use /, DS is only used when loading files in PHP on the local file system.
I've adjusted that now. Thanks!! Seems logic now, of course, but I guess I got used to it TOO much :-)
I've been wondering about where to check/learn these kind of joomla specific know-hows, DOs and DON'Ts (without having to read all the docs on all resources at joomla.org ;) ). Any idea?
Well, that isn't really Joomla! specific... / is always in URLs, / and \ are used to access the local filesystem, and depend on what that filesystem is.

Ian

User avatar
e-motiv
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 168
Joined: Sun May 06, 2007 12:33 pm
Contact:

Re: JHTML image.site; Where to put the fail back images ?

Post by e-motiv » Mon Mar 16, 2009 12:37 pm

ianmac wrote:
e-builds wrote:
ianmac wrote:You should not be using DS when calling image.site. URLs *always* use /, DS is only used when loading files in PHP on the local file system.
I've adjusted that now. Thanks!! Seems logic now, of course, but I guess I got used to it TOO much :-)
I've been wondering about where to check/learn these kind of joomla specific know-hows, DOs and DON'Ts (without having to read all the docs on all resources at joomla.org ;) ). Any idea?
Well, that isn't really Joomla! specific... / is always in URLs, / and \ are used to access the local filesystem, and depend on what that filesystem is.

Ian
Yes, you're right, of course, once again.
It's just that I picked up this DS somewhere on the road (prob. picked it up from other extensions or joomla code) and didn't really thought about it, just using it as much as I can (I know, that's silly). So, more generally speaking, I want to get to know the Joomla DOs and DONTs without having to pick it up. I want to learn how to write Joomla style the good way, you see? Unfortunatly, being an open source developer partly and being a pro-bono IT guy in a NGO on the others side, I really would appreciate a time saver, not the time to read all the docs, at least to start..
I guess, I am looking for a kind of index page called "Top 10 Joomla-way of coding" or so.. ?

http://www.e-motiv.net Professional web development <== e-motiv ==> Spin off web projects http://attic.e-motiv.net

User avatar
e-motiv
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 168
Joined: Sun May 06, 2007 12:33 pm
Contact:

Re: JHTML image.site; Where to put the fail back images ?

Post by e-motiv » Mon Apr 27, 2009 5:44 pm


http://www.e-motiv.net Professional web development <== e-motiv ==> Spin off web projects http://attic.e-motiv.net


Locked

Return to “Joomla! 1.5 Coding”