reference name="right", how many types, how to add custom
Reference is a tag which will refer the block which is already defined in layout files and you want to use that block in page or you want to add more blocks in it.
In page.xml file you will find the xml like:-
<block type="core/text_list" name="right" as="right" translate="label"> <label>Right Column</label> </block>
if you are using
<reference name=right> means you are using or accessing the right block which is already defined in page.xml file and you can update it.
If you want to see the example then you can check catalog.xml files in layout folder
<reference name="right"> <block type="catalog/product_compare_sidebar" before="cart_sidebar" name="catalog.compare.sidebar" template="catalog/product/compare/sidebar.phtml"/> <block type="core/template" name="right.permanent.callout" template="callouts/right_col.phtml"> <action method="setImgSrc"><src>images/media/col_right_callout.jpg</src></action> <action method="setImgAlt" translate="alt" module="catalog"><alt>Keep your eyes open for our special Back to School items and save A LOT!</alt></action> </block> </reference>
so in the right block its adding sidebar.phtml and right_col.phtml files in a right block.
Hope its helpful for you.