select element_id, pem.pretty_name as name, pem.sort_key, state
from portal_element_map pem, portal_pages pp
where
pp.portal_id = :portal_id
and pem.page_id = pp.page_id
and pp.page_id = :page_id
and region = :region
and state != 'hidden'
order by sort_key
select element_id, name
from portal_element_map pem, portal_pages pp
where
pp.portal_id = :portal_id
and pp.page_id = pem.page_id
and pem.state = 'hidden'
order by name