A toilet rim block is a block-shaped substance used in flush toilets which slowly dissolves in water. They often come in a small holder that is attached over the rim of a toilet and hangs down into the bowl, so as the toilet gets flushed, the water passes through the holder coming into contact with the block.
However, they also come loose for placement directly in-cistern (so are also usable with squat toilets), although these tend to be slightly different in composition, so as to dissolve slower, due to the constant contact with water. These may also contain a colorant, which shows up in the water (typically blue or green).
In 'liquid rims' the liquid is held in a small bottle above and connected to the holder slowly releasing the liquid into the bottom of the holder which is beneath the toilet rim, so coming into contact with the water when the toilet is flushed.