Page 1 of 1

Component install

Posted: Sun Aug 17, 2008 2:43 am
by rayge
Im wondering how im might add a folder to the images / stories fodler during an install of a component i am making.

Thanks for any help.

Re: Component install

Posted: Thu Aug 21, 2008 3:17 am
by SotL
Why would you want to do this? Why mess with the core setup when you can simply add an "images" folder to your component and tell your component where to look for the image.

You can add a image directly to the stories folder using your XML file by adding something simiar to:

Code: Select all

<media destination="stories" folder="assets">
<filename>pic.png</filename>
<filename>anotherPic.jpg</filename>
</media>
( in the "assets" folder of your install package, take pic.png and anotherpic.png and place them in the "stories" folder )

But really, it would be better to simply create an "assets" folder and an images folder in there and then use something like:

Code: Select all

<img src="<?php echo JPATH_COMPONENT.DS.'assets'.'images'.'pic.png' ?>" alt="pic.png" />
(if the pic is located in {Joomla root}/components/com_yourComponent/assets/images/pic.png)

Re: Component install

Posted: Thu Aug 21, 2008 2:14 pm
by rayge
The images im talking about arent related to setup. They are user added images.

Problem with that would be, in the component, i need another way to allow the user to upload images to that folder.

Right now i only know how to code for the simple image select box drop down. so its kind of limiting.