Get all attribute options

To get all attribute options from a Magento dropdown attribute (select field) you can use the following snippet:

That gives you an array like that:

This can be used as source for a system config field for example. See my blogpost about Category dropdown element. To get a specific value by given label, you can […]

Category dropdown element

To get an treelike drop-down option field for all existing categories in the system you have yo add an own source model:

Now you can just use this source model in your modules system configuration file to generate a category selection:

For more information about system.xml field definitions have a look at the blogpost System configuration […]

Image system configuration field

To add an image selector field to your system configuration:

System configuration fields

There are different field types for Magento’s system configuration. These are for example: Button Checkboxes Checkbox Date File Hidden Imagefile Image Label Link Multiline Multiselect Note Obscure Password Radio Radios Reset Select Submit Textarea Text Time The following snippets show you how to add them to your system.xml: Enable selection (yes/no):

Multiselect (customer groups): […]