You can do the following in the custom component/page partial class:
in the example I've posted in your other thread: