Posts: 166
Threads: 24
Joined: Jul 2012
2013-10-05, 06:36:30
(This post was last modified: 2013-10-05, 06:44:08 by lnickel.)
Hi all!
I'm developing a theme and I would like to add maybe 1 or 2 more components then the one's supplied(initially when you install gs). So someone would have some things in place when they activate the theme.
Is this possible? If so can I?
a. add it within my functions.php
b. Can I hook into a component function - if so how?
I've scoured the admin folder looking for where the components are created but I couldn't find them. Most obvious is the component.php.
I kind of get whats going on there but I dont see where it actually outputs the html.
Just thinking out loud here...another option would be to just code it in the the functions.php and pull it in the template
Thanks!!!
Lance
Posts: 6,266
Threads: 181
Joined: Sep 2011
Components are stored in component.xml there is no native way to add components at this time other than doing it manually with your own code or using some core functions.
Posts: 1,247
Threads: 82
Joined: Feb 2011
(2013-10-05, 06:36:30)lnickel Wrote: Hi all!
I'm developing a theme and I would like to add maybe 1 or 2 more components then the one's supplied(initially when you install gs). So someone would have some things in place when they activate the theme.
Is this possible? If so can I?
a. add it within my functions.php
b. Can I hook into a component function - if so how?
I've scoured the admin folder looking for where the components are created but I couldn't find them. Most obvious is the component.php.
I kind of get whats going on there but I dont see where it actually outputs the html.
Just thinking out loud here...another option would be to just code it in the the functions.php and pull it in the template
Thanks!!!
Lance
I don't think that exist. There are plans for it to support this function in future releases.
You can just ad the component code in the theme and then make a description where you refer to the component names used. People only have to make those components with the name, which is very easy. See my added
Startling theme where I did that.
Posts: 166
Threads: 24
Joined: Jul 2012
alrighty! Thanks for the input Shawn and datiswous! Nicely done Datiswous! Thanks for the advice
Posts: 6,266
Threads: 181
Joined: Sep 2011
Yeah i would just call the component, it wont error out or anything if it does not exist.
use a prefix tho like themename_sidebar or something.
And advise user to create it.
Posts: 166
Threads: 24
Joined: Jul 2012
Posts: 41
Threads: 9
Joined: Sep 2013
(2013-10-05, 07:02:40)shawn_a Wrote: Yeah i would just call the component, it wont error out or anything if it does not exist.
Thanks shawn, I was using an IF function to validate whether the component exists or not.
English isn't my native language. Sorry for any mistakes you may find.