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

nambit
nambit

I'm trying to extend the StaticPages Component with custom properties. In the boot function of my plugin I have the following code:

    StaticPage::extend(function($component) {
        $prop = [
            'my_slug' => [
                'title'       => 'Special Slug',
                'description' => 'The slug for the thing.',
                'type'        => 'string',
                'default'     => 'demo',
            ]
        ];
        $component->setProperties($prop);

        //dd($component->getProperties());
    });

Unfortunately the property is not showing in the component in the backend. Is it possible to add additional properties in an existing component.

I am aware that I could create a own component and simply extend the component. I would prefer having it in the existing component though.

1-1 of 1

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