Development environment
Jonas Fagnastøl Henriksen
New Member
Posts: 15
pred 9 rokmi 9 mesiacmi - pred 9 rokmi 8 mesiacmi #613
od Jonas Fagnastøl Henriksen
Odpoveď od Jonas Fagnastøl Henriksen na tému 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
Posledný krát upravené:pred 9 rokmi 8 mesiacmi Jonas Fagnastøl Henriksen
Nasledujúci užívateľ(ia) povedali ďakujem: Pete
Prosím Prihlásiť alebo Registrácia pre zdieľanie konverzácie.
Pete
Junior Member
Posts: 24
pred 9 rokmi 9 mesiacmi - pred 9 rokmi 9 mesiacmi #615
od Pete
Odpoveď od Pete na tému 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>
Posledný krát upravené:pred 9 rokmi 9 mesiacmi Pete
Prosím Prihlásiť alebo Registrácia pre zdieľanie konverzácie.
Pete
Junior Member
Posts: 24
pred 9 rokmi 9 mesiacmi - pred 9 rokmi 9 mesiacmi #625
od Pete
Odpoveď od Pete na tému 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..
Posledný krát upravené:pred 9 rokmi 9 mesiacmi Pete Dôvod: Add info
Prosím Prihlásiť alebo Registrácia pre zdieľanie konverzácie.
Eduardo Mena
Junior Member
Posts: 31
pred 9 rokmi 6 mesiacmi #817
od Eduardo Mena
Odpoveď od Eduardo Mena na tému 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!!!
Prosím Prihlásiť alebo Registrácia pre zdieľanie konverzácie.
Søren Beck Jensen
Administrator
Posts: 73
pred 9 rokmi 6 mesiacmi #818
od Søren Beck Jensen
Søren Beck Jensen
Founder, Component-Creator.com
Odpoveď od Søren Beck Jensen na tému 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
Prosím Prihlásiť alebo Registrácia pre zdieľanie konverzácie.
Eduardo Mena
Junior Member
Posts: 31
pred 9 rokmi 6 mesiacmi #821
od Eduardo Mena
Odpoveď od Eduardo Mena na tému Development environment
Great! I knew I couldn't be te only one! haha! Kudos to Netbeans!
Prosím Prihlásiť alebo Registrácia pre zdieľanie konverzácie.
Čas vytvorenia stránky: 0.063 sekúnd