October: OctoberCMS Get plugin's Dropdown values at frontend

Created on 16 Dec 2016  路  3Comments  路  Source: octobercms/october

I have created one plugin (call it Product) using Builder Plugin and inside it, i have a dropdown (call it product_category (Product Category))

Using Builder Plugin, i have added few Key => Value (Dropdown Category options) like below.

Added Dropdown Options:

enter image description here

Showing Dropdown Options:

enter image description here

Now i have one CMS page (call it products) which i am showing in front end, and in which i am showing the list of the products, which works fine using the code like below.

enter image description here

Now here comes my question/query, i have a Product Category Dropdown in front end as well in a same page and i want to get all the Product Categories which i have added using my Builder Plugin.

How can i get those ?

Question

Most helpful comment

Ok guys, eventually i have found out a solution thanks to alxy's help though and here what i have come up with.

$parser = new October\Rain\Parse\Yaml;
$fields = $parser->ParseFile('/path/to/fields.yaml');

var_dump($fields);

Go here for more.

Thank you

All 3 comments

is it not possible ?

Ok guys, eventually i have found out a solution thanks to alxy's help though and here what i have come up with.

$parser = new October\Rain\Parse\Yaml;
$fields = $parser->ParseFile('/path/to/fields.yaml');

var_dump($fields);

Go here for more.

Thank you

Thanks for the follow up

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ChVuagniaux picture ChVuagniaux  路  3Comments

axomat picture axomat  路  3Comments

sozonovalexey picture sozonovalexey  路  3Comments

oppin picture oppin  路  3Comments

m49n picture m49n  路  3Comments