The Joomla! Forum ™



Forum rules


Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 11 posts ] 
Author Message
PostPosted: Thu Feb 26, 2009 2:44 pm 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Sun May 06, 2007 12:33 pm
Posts: 164
Hello,

I am developing a plugin with an image inside. And I am using the following function in my php file:
Code:
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:
      <files>
         <filename>images/icoon.png</filename>
      </files>
    • Code:
      <files>
         <folder>images</folder>
      </files>
    • Code:
      <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


Top
 Profile  
 
PostPosted: Mon Mar 02, 2009 4:34 am 
Joomla! Intern
Joomla! Intern

Joined: Wed Jan 14, 2009 2:11 am
Posts: 68
Location: Melbourne, Australia
have you tried using absolute path,
<files>
<filename>/images/icoon.png</filename>
</files>


Top
 Profile  
 
PostPosted: Thu Mar 05, 2009 10:00 am 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Sun May 06, 2007 12:33 pm
Posts: 164
Code:
<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


Top
 Profile  
 
PostPosted: Thu Mar 05, 2009 11:35 am 
User avatar
Joomla! Exemplar
Joomla! Exemplar

Joined: Thu Aug 18, 2005 8:43 pm
Posts: 7986
Location: New York
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!.


Top
 Profile  
 
PostPosted: Thu Mar 05, 2009 1:27 pm 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Sun May 06, 2007 12:33 pm
Posts: 164
we solved it using:

Code:
$_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


Top
 Profile  
 
PostPosted: Fri Mar 06, 2009 2:10 pm 
User avatar
Joomla! Virtuoso
Joomla! Virtuoso

Joined: Sat Sep 24, 2005 11:01 pm
Posts: 4785
Location: Toronto, Canada
e-builds wrote:
we solved it using:

Code:
$_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


Top
 Profile  
 
PostPosted: Fri Mar 13, 2009 6:10 pm 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Sun May 06, 2007 12:33 pm
Posts: 164
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


Top
 Profile  
 
PostPosted: Fri Mar 13, 2009 6:14 pm 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Sun May 06, 2007 12:33 pm
Posts: 164
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


Top
 Profile  
 
PostPosted: Fri Mar 13, 2009 6:21 pm 
User avatar
Joomla! Virtuoso
Joomla! Virtuoso

Joined: Sat Sep 24, 2005 11:01 pm
Posts: 4785
Location: Toronto, Canada
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


Top
 Profile  
 
PostPosted: Mon Mar 16, 2009 12:37 pm 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Sun May 06, 2007 12:33 pm
Posts: 164
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


Top
 Profile  
 
PostPosted: Mon Apr 27, 2009 5:44 pm 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Sun May 06, 2007 12:33 pm
Posts: 164
As promised (doc):
Adding template overridable images in your extension

_________________

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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 11 posts ] 



Who is online

Users browsing this forum: No registered users and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group