Jump to content

PageField and Pedigrees...


Ralf
 Share

Recommended Posts

Awesome!

What Martijn here shares with us that's just about the limit. We/ I can learn so much from the Code inside.

I asked Martijn if he can help me with my pedigree problem to output the familytree and he gave me back a complete basic Homepage structur and THREE new modules!!!

THANK YOU

PS I hope you share this modules also in the "Modules-Section" because they are really helpful and others can be inspired for own modules - I for one am it.

  • Like 3
Link to comment
Share on other sites

Those modules are purely written for this setup. You take them out of the site then they won't function. I don't see value for those in Modules section, that list should be clean. (less is more)

- If you want to get insight of the working for the tabs (ProcessPageEdit::buildForm) go for Soma's TemplateNotes

- For the Process module, take a look at ProcessHello (ryan's great howto do process modules )

In basic, modules are not hard to do. When you know what to hook, and you know how to get the $event object and you know how to give it back, then it's not much different from working in your templates.

There are many modules around here. And in a lot of circumstances others already have done these three things for you. If you take those as starting point, you only have to write some basic PHP.

Don't let the word .module "fog" your mind :-)

  • Like 6
Link to comment
Share on other sites

  • 1 month later...
  • 1 year later...

Hello @all,

its just a few days gone since Martijn write this beautiful code and PW is now in Version 2.6.1. available.

This is the reason why i answer to this Thread, yesterday i updated my Installation with this code from Version 2.4.0 to 2.6.1 and at the first look around it seems all good. But when i open now a horse page in the backend i get the following Error:

Recoverable Fatal Error: Argument 1 passed to InputfieldWrapper::append() must be an instance of Inputfield, boolean given, called in /www/htdocs/xxxxx/site/modules/HorseFamilyEdit.module on line 151 and defined (line 192 of /www/htdocs/xxxxx/wire/core/InputfieldWrapper.php) 
This error message was shown because you are logged in as a Superuser. Error has been logged. Administrator has been notified. 

This are the lines from "HorseFamilyEdit.module"

        // Markup
        $markup = $this->modules->get('InputfieldMarkup');
        $markup->label = $this->_("Kinder");
        $markup->value = $table->render();
        $wrapper->append($markup);
        $view = $form->find("id=ProcessPageEditView")->first();
        $form->remove($view);
        $form->append($wrapper)->append($view);
    }
}

And the the InputFieldWrapper Code are the same in Version 2.4.0 and 2.6.1, the only difference are the line in the file.

My Question is now, could somebody help me?

Thanks in advance

Ralf

Link to comment
Share on other sites

Hi Ralph

// remove these lines:
$view = $form->find("id=ProcessPageEditView")->first();
$form->remove($view);
$form->append($wrapper)->append($view);

// Replace it with:
$form->prepend($wrapper);

Then the it should work again. (Note that the family Tab is now the last tab, after view, sorry about that)

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...