MODX Community

classExtender and custom class_key with context menu

Hello,

is it possible to use classExtender to extend but use a custom class_key for use only and not for all resources?

thank you.

bye
Chris

By default, the class_key is extResource, so you could use it in a query for only those resources.

thanks Bob.

Per default all resources have the extended fields.
how could I do it, that only resources with this class_key have extended resource fields?

I think this might work:

In the ExtraResourceFields plugin, Change this:

 case 'OnDocFormRender':
        if ($data) {

to this:

 case 'OnDocFormRender':
        if ($data && ($resource->get('class_key') === 'extResource')) {

thank you very much, Bob!

Don’t thank me until it works. :wink:

Hello Bob,

may be my experience isnt enough to do the following:

I want a resource class with the following features

  • store extended data in resourcedata table
  • show extended data grouped in resource tabs (horizinal and vertical grouped)

I tried to adapt with sample packages like articles. but I dont’t understand all…

where can I get help to do this?
do you no tutorials or documentation to learn it`?

thanks
Chris

In the Manager or the front end?

In the manager.
in frontend I have some good experiences.

thank you

The ExtraResourceFields plugin will display the fields in the Manager and save the data to the database table.

For the tabbed display, it’s possible that you could do it with CSS, but you might have to write some javascript to get the display you want.