Jump to content

Recommended Posts

Posted

Hi all...

I would like to add some special javascripts files to a Inputfield if certain conditions are fullfilled.
Thats working good with hook Inputfield::___render when the field is directly loaded on ProcessPageEdit.

However I have problems adding these scripts when the Inputfield is not loaded directly on pageLoad. In my case a dynamically loaded repeaterItem.
I found the Inputfield::renderReady method wich seems to be the best place, but it´s not hookable?
https://github.com/processwire/processwire/blob/master/wire/core/Inputfield.php#L1030 )
( the call in Repeater: https://github.com/processwire/processwire/blob/master/wire/modules/Fieldtype/FieldtypeRepeater/InputfieldRepeater.module#L204 )

Is there an "official" way of doing that? Of course I could hook in somewhere else, but that renderReady would be the place to go or am i wrong?

 

Thanks for any information...
Tom

  • Like 1
Posted

As soon as I make the Inputfield::renderReady function hookable in core, I can add the scripts and styles for my rendering there and it also works in ajax loaded fields or repeaters.

@ryan: Is there a change to make this renderReady hookable in core?

thx for any information...
Tom

  • 3 weeks later...
Posted

I am also interested in an answer to this for the AdminPageFieldEditLinks module. It looks like I would need to be able to hook renderReady() in order to load the necessary assets in repeater fields. Unless there is some other way that I haven't thought of to do this.

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
  • Recently Browsing   0 members

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