How To | Getting a list of pages in a UCI

Learn how to quickly and easily retrieve a list of pages in a UCI.

Updated at May 2nd, 2023

Procedure


The Status/Control component for a UCI has a "current.page" control that contains a Choices list of all the pages for a given UCI. In scripting, this can be parsed and used. The following example script grabs the list of pages for the UCI, which is represented by the custom-named UCI Status/Control component, "MyPanel":

Panel = Component.New("MyPanel")

UCIPages = {}

UCIPages = Panel["current.page"].Choices
for k,v in pairs (UCIPages) do
print (k,v)
end