Development environment

9 anos 9 meses atrás - 9 anos 8 meses atrás #613 por Jonas Fagnastøl Henriksen
Respondido por Jonas Fagnastøl Henriksen no tópico Development environment
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
Ultima edição: 9 anos 8 meses atrás por Jonas Fagnastøl Henriksen.
Os seguintes usuário(s) disseram Obrigado: Pete

Por favor Acessar ou Registrar para participar da conversa.

9 anos 9 meses atrás - 9 anos 9 meses atrás #615 por Pete
Respondido por Pete no tópico 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 ?
<?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>
Ultima edição: 9 anos 9 meses atrás por Pete.

Por favor Acessar ou Registrar para participar da conversa.

9 anos 9 meses atrás - 9 anos 9 meses atrás #625 por Pete
Respondido por Pete no tópico 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..
Ultima edição: 9 anos 9 meses atrás por Pete. Razão: Add info

Por favor Acessar ou Registrar para participar da conversa.

9 anos 6 meses atrás #817 por Eduardo Mena
Respondido por Eduardo Mena no tópico 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!!!

Por favor Acessar ou Registrar para participar da conversa.

9 anos 6 meses atrás #818 por Søren Beck Jensen
Respondido por Søren Beck Jensen no tópico 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 :-)

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

Por favor Acessar ou Registrar para participar da conversa.

9 anos 6 meses atrás #821 por Eduardo Mena
Respondido por Eduardo Mena no tópico Development environment
Great! I knew I couldn't be te only one! haha! Kudos to Netbeans!

Por favor Acessar ou Registrar para participar da conversa.

Tempo para a criação da página:0.059 segundos
Powered by Fórum Kunena

We use cookies so that you can place orders and we can provide a better service. You can control the use of cookies at the individual browser level. If you reject cookies, you may still use our website, but your ability to use some features or areas of our website may be limited.