Interaction of droplets and foams with solid/porous substrates