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

james19029
james19029

Hi

I'm having a little problem trying to pull out the values of the properties set within function defineProperties() in my component.

I have added some property values when including two instances of the plugin on a page. This is a short list of the properties to provide some context to my issue.

defineProperties() { return [ 'title' => [ 'title' => 'Title' ], 'type' => [ 'title' => 'Type', 'type' => 'dropdown', 'default' => 'standalone', 'placeholder' => 'Select type', 'options' => ['standalone'=>'Standalone', 'networked'=>'Networked'] ], 'unitCost' => [ 'title' => 'Unit Cost', 'default' => '130.00', ] ...

The properties are set as:

Instance 1: form Component Alias: standalone Title: Type: Standalone Unit Cost: 5.00

Instance 2: form Component Alias: standalone Title: Type: Standalone Unit Cost: 5.00

The above have been appended to the /plans page

The plugins components/form/default.html contains the following (both instances use this directly i.e. not forked)

`

<input id="licenseQty" name="licenseQty" type="text" placeholder="1">

<label>Support Plans</label>
<select id="supportPlan" name="supportPlan">
    <option value="1">1 Year (included)</option>
    <option value="2">3 Years</option>
</select>
<label>Total:</label>
<p>&pound;{{ __SELF__ }}</p>
<button type="submit">Add to Basket</button>

`

The above statement {{ SELF }} produces the reference for both user entered Alias values. When I try to access other properties on SELF such as {{ SELF.alias }} and {{ SELF.id }} these hold the relevant details. It is only when I try to access the custom properties below I get nothing but blanks:

{{ SELF.type }} - blank

{{ SELF.unitCost }} - blank

Can anyone help?

Last updated

fu.wire28077
fu.wire28077

Hi @james19029 did u solve this?

1-2 of 2

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