We study the smectic director structure of the rodlike liquid crystal 4-n-dodecyl-4'-cyanobiphenyl (12CB) confined in cylindrical cavities of 200 nm diameter in porous alumina templates by means of combined broadband dielectric spectroscopy, optical birefringence, and neutron scattering measurements. We show that the collective molecular orientation differs between entering the smectic A phase upon cooling from the isotropic state and entering the same phase upon heating while melting the confined crystal. We discuss this collective molecular realignment in terms of a competition between weak planar anchoring at the p-Al2O3/12CB interface and a preferred texture typical of the crystallization of rodlike molecules in nanochannels (Bridgman growth).