Component install

Discussion and education for beginner / novice programmers interested in embarking on the development process to take advantage of the extensible nature of the Joomla! CMS.
Locked
User avatar
rayge
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 177
Joined: Tue Nov 06, 2007 6:26 pm

Component install

Post by rayge » Sun Aug 17, 2008 2:43 am

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.
http://www.casualgamesource.com Over 1000 FREE pc and mac casual games!
http://www.thedecoratinglady.com Decorating articles for every room in your home!

 
SotL
Joomla! Intern
Joomla! Intern
Posts: 61
Joined: Sun Nov 25, 2007 1:57 pm

Re: Component install

Post by SotL » Thu Aug 21, 2008 3:17 am

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)

User avatar
rayge
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 177
Joined: Tue Nov 06, 2007 6:26 pm

Re: Component install

Post by rayge » Thu Aug 21, 2008 2:14 pm

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.
http://www.casualgamesource.com Over 1000 FREE pc and mac casual games!
http://www.thedecoratinglady.com Decorating articles for every room in your home!

 

Locked

Return to “Joomla! Coding 101”