Development environment
Jonas Fagnastøl Henriksen
Nouveau membre
Posts: 15
il y a 9 ans 10 mois - il y a 9 ans 8 mois #613
par Jonas Fagnastøl Henriksen
Réponse de Jonas Fagnastøl Henriksen sur le sujet Development environment
Hi Pete,
the plugin code is very simple:This plugin loads the xml-file newxml.xml from the same folder the plugin file lives in. newxml.xml could be
This would replace the field foo with your own field description, in this case a custom foreignkey-type. In this case you would also define a file myforeignkey.php in /plugins/content/modifyxml/fields with whatever code you need.
I have to say I have also started using git in a way that works nicely (like Joris Ceelen suggested) and can keep your own changes:
- Make a branch for your new component, like com_mycomponent-vanilla
- always install new versions from the component-builder in this branch
- after installation and committing the new changes to the vanilla - branch, you checkout your development-branch again, and you rebase or merge this with the vanilla-branch.
like:
git checkout com_mycomponent-vanilla
# install the component in /administrator the usual way
git commit -am "saving new changes from the componentbuilder" # you might need to add new files first
git checkout master
git merge com_mycomponent-vanilla
# alternatively use git rebase
regards Jonas
the plugin code is very simple:
class PlgContentModifyXML extends JPlugin{
function onContentPrepareForm($form, $data) {
$app = JFactory::getApplication();
$option = $app->input->get('option');
if($option=="com_yourcomponent") {
JForm::addFormPath(__DIR__);
$form->loadFile('newxml', false);
return true;
}
}
}
<?xml version="1.0" encoding="utf-8"?><form>
<fieldset addfieldpath="/plugins/content/modifyxml/fields">
<field name="foo" type="myforeignkey" class="inputbox" label="Foo field"
description="Foo field description" input_type="list" table="#__sometable"
key_field="id" value_field="name" />
</field>
</fieldset>
</form>
I have to say I have also started using git in a way that works nicely (like Joris Ceelen suggested) and can keep your own changes:
- Make a branch for your new component, like com_mycomponent-vanilla
- always install new versions from the component-builder in this branch
- after installation and committing the new changes to the vanilla - branch, you checkout your development-branch again, and you rebase or merge this with the vanilla-branch.
like:
git checkout com_mycomponent-vanilla
# install the component in /administrator the usual way
git commit -am "saving new changes from the componentbuilder" # you might need to add new files first
git checkout master
git merge com_mycomponent-vanilla
# alternatively use git rebase
regards Jonas
Dernière édition: il y a 9 ans 8 mois par Jonas Fagnastøl Henriksen.
Les utilisateur(s) suivant ont remercié: Pete
Connexion ou Créer un compte pour participer à la conversation.
Pete
Membre junior
Posts: 24
il y a 9 ans 10 mois - il y a 9 ans 10 mois #615
par Pete
Réponse de Pete sur le sujet Development environment
Thanks so much Jonas!
I'll give that all a go..
I would just like to add I found a plugin just now which is at a cursory glance, more generic (and XML file in any component) but I like yours as it limits the impact on unrelated components!
here it is anyhow..
extensions.joomla.org/profile/extension/...us/form-xml-override
Regarding the XML field replacement,
I assume that I can replace only 2 fields out of 4 in the origonal xml file using the following code? If so then I assume the field called foo overrides the origonal, and the foo2 does the same, but the other foo3 and foo4 will be left unless I add them in this override XML file ?
I'll give that all a go..
I would just like to add I found a plugin just now which is at a cursory glance, more generic (and XML file in any component) but I like yours as it limits the impact on unrelated components!
here it is anyhow..
extensions.joomla.org/profile/extension/...us/form-xml-override
Regarding the XML field replacement,
I assume that I can replace only 2 fields out of 4 in the origonal xml file using the following code? If so then I assume the field called foo overrides the origonal, and the foo2 does the same, but the other foo3 and foo4 will be left unless I add them in this override XML file ?
<?xml version="1.0" encoding="utf-8"?>
<form>
<fieldset addfieldpath="/plugins/content/modifyxml/fields">
<field name="foo" type="myforeignkey" class="inputbox" label="Foo field"
description="Foo field description" input_type="list" table="#__sometable"
key_field="id" value_field="name" />
</field>
<field name="foo2" type="myforeignkey" class="inputbox" label="Foo2 field"
description="Foo2 field description" input_type="list" table="#__sometable2"
key_field="id" value_field="surname" />
</field>
</fieldset>
</form>
Dernière édition: il y a 9 ans 10 mois par Pete.
Connexion ou Créer un compte pour participer à la conversation.
Pete
Membre junior
Posts: 24
il y a 9 ans 9 mois - il y a 9 ans 9 mois #625
par Pete
Réponse de Pete sur le sujet Development environment
By the way Jonas,
I have added a request for a CUSTOM FIELD to be added here - please up-vote if you think this will be useful..
I consider it essential, and very easy to implement, basically a custom field, with a textarea to paste pre-existing Form XML into
www.component-creator.com/en/forum/featu...m-joomla-form-fields
It will solve all those issues with having to wait for Component Creator Devs to give us the new fields more quickly..
I have added a request for a CUSTOM FIELD to be added here - please up-vote if you think this will be useful..
I consider it essential, and very easy to implement, basically a custom field, with a textarea to paste pre-existing Form XML into
www.component-creator.com/en/forum/featu...m-joomla-form-fields
It will solve all those issues with having to wait for Component Creator Devs to give us the new fields more quickly..
Dernière édition: il y a 9 ans 9 mois par Pete. Raison: Add info
Connexion ou Créer un compte pour participer à la conversation.
Eduardo Mena
Membre junior
Posts: 31
il y a 9 ans 6 mois #817
par Eduardo Mena
Réponse de Eduardo Mena sur le sujet Development environment
Custom Field sounds like a very good idea!
I've been using NetBeans. It let's me start a GIT repository right from the IDE and it is very simple to use.
I usually start by creating the component and try it out, then I go back to component creator and modify some things and reinstall it. I repeat the process several times in the beginning.
When I'm happy with my component as a good starting point, I start my GIT repository and begin modifying files.
I'm usually not shy about modifying any files in the component. There is nothing to fear since GIT is keeping backups for everything. GIT is really awesome and I consider it one of my most useful tools.
This setup has been working very good for me. I only need 1 program to work on my components. But here I haven't seen any comments on NetBeans. Is there a reason why nobody seems to be using it?
I also use this setup to learn how Joomla works and how to develop my own components. I create a component, commit to GIT, go back to CC, edit my component, reinstall and take a look at the changes. CC can be a very useful educational tool!!!
I've been using NetBeans. It let's me start a GIT repository right from the IDE and it is very simple to use.
I usually start by creating the component and try it out, then I go back to component creator and modify some things and reinstall it. I repeat the process several times in the beginning.
When I'm happy with my component as a good starting point, I start my GIT repository and begin modifying files.
I'm usually not shy about modifying any files in the component. There is nothing to fear since GIT is keeping backups for everything. GIT is really awesome and I consider it one of my most useful tools.
This setup has been working very good for me. I only need 1 program to work on my components. But here I haven't seen any comments on NetBeans. Is there a reason why nobody seems to be using it?
I also use this setup to learn how Joomla works and how to develop my own components. I create a component, commit to GIT, go back to CC, edit my component, reinstall and take a look at the changes. CC can be a very useful educational tool!!!
Connexion ou Créer un compte pour participer à la conversation.
Søren Beck Jensen
Administrateur
Posts: 73
il y a 9 ans 6 mois #818
par Søren Beck Jensen
Søren Beck Jensen
Founder, Component-Creator.com
Réponse de Søren Beck Jensen sur le sujet Development environment
Hi Eduardo,
Happy to hear that you have used Component Creator to learn Joomla development. This is one of the most undervalued uses of Component Creator in my opinion.
You will be happy to hear that Component Creator is almost 100% developed in Netbeans and we love it too. We have one stubborn developer using another IDE, but he just likes to be different. He is also the only person running Linux
Happy to hear that you have used Component Creator to learn Joomla development. This is one of the most undervalued uses of Component Creator in my opinion.
You will be happy to hear that Component Creator is almost 100% developed in Netbeans and we love it too. We have one stubborn developer using another IDE, but he just likes to be different. He is also the only person running Linux
Søren Beck Jensen
Founder, Component-Creator.com
Connexion ou Créer un compte pour participer à la conversation.
Eduardo Mena
Membre junior
Posts: 31
il y a 9 ans 6 mois #821
par Eduardo Mena
Réponse de Eduardo Mena sur le sujet Development environment
Great! I knew I couldn't be te only one! haha! Kudos to Netbeans!
Connexion ou Créer un compte pour participer à la conversation.
Temps de génération de la page : 0.059 secondes