This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

Terry Harvey
Terry Harvey

Hi there,

I'm Terry, full-stack developer, primarily using Laravel. I work in a commercial web agency in England and have been on the hunt for a decent CMS for a long time. Found October, and gotta say: I'm loving it! Just one quick question.

I've cloned the demo CRM plugin (https://github.com/daftspunk/oc-crm-plugin) and can see that the relationship manager on the notes section is working flawlessly. What I would like to do however, is disable the user from updating records. So instead of opening an update form when the row in the table is clicked, it will display a simple information partial.

Is this possible? I read something about context in the documentation, but there aren't any examples.

Basically what I'm asking is how to specify different form definitions for the create and update contexts of a relation manager.

If this can be done, I've found my new CMS!

Last updated

Terry Harvey
Terry Harvey

Update:

Managed to get it working without the use of the contexts (although I'm guessing that would be a better solution). After further inspection of the base RelationController class, I learned that all I had to do was override one of the functions in the plugin's controller:

public function onRelationClickViewList()
{
    if (post('_relation_field') != 'notes') {
        return parent::onRelationClickViewList();
    }

    $this->pageAction();

    return $this->makePartial('view_note');
}

Hope that's useful to somebody!

Last updated

1-2 of 2

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.