Development environment

9 yıl 10 ay önce - 9 yıl 8 ay önce #613 Yazan: Jonas Fagnastøl Henriksen
Jonas Fagnastøl Henriksen tarafından Development environment konusunda yanıtlandı
Hi Pete, 

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;
      }
   }
}
This plugin loads the xml-file newxml.xml from the same folder the plugin file lives in. newxml.xml could be


<?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>
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
Son Düzenleme: 9 yıl 8 ay önce Düzenleyen:Jonas Fagnastøl Henriksen
Şu kullanıcı(lar) Teşekkür etti: Pete

Lütfen sohbete katılmak için Giriş ya da Hesap açın.

9 yıl 10 ay önce - 9 yıl 10 ay önce #615 Yazan: Pete
Pete tarafından Development environment konusunda yanıtlandı
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 ?
<?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>
Son Düzenleme: 9 yıl 10 ay önce Düzenleyen:Pete

Lütfen sohbete katılmak için Giriş ya da Hesap açın.

9 yıl 9 ay önce - 9 yıl 9 ay önce #625 Yazan: Pete
Pete tarafından Development environment konusunda yanıtlandı
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..
Son Düzenleme: 9 yıl 9 ay önce Düzenleyen:Pete Neden: Add info

Lütfen sohbete katılmak için Giriş ya da Hesap açın.

9 yıl 6 ay önce #817 Yazan: Eduardo Mena
Eduardo Mena tarafından Development environment konusunda yanıtlandı
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!!!

Lütfen sohbete katılmak için Giriş ya da Hesap açın.

9 yıl 6 ay önce #818 Yazan: Søren Beck Jensen
Søren Beck Jensen tarafından Development environment konusunda yanıtlandı
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 :-)

Søren Beck Jensen
Founder, Component-Creator.com

Lütfen sohbete katılmak için Giriş ya da Hesap açın.

9 yıl 6 ay önce #821 Yazan: Eduardo Mena
Eduardo Mena tarafından Development environment konusunda yanıtlandı
Great! I knew I couldn't be te only one! haha! Kudos to Netbeans!

Lütfen sohbete katılmak için Giriş ya da Hesap açın.

Sayfa oluşturma süresi: 0.068 saniye
Geliştiren: Kunena Forum