We define when a ternary term m of an algebraic language L is called a distributive nearlattice term (DN-term) of a sentential logic S. Distributive nearlattices are ternary algebras generalising Tarski algebras and distributive lattices. We characterise the selfextensional logics with a DN-term through the interpretation of the DN-term in the algebras of the algebraic counterpart of the logics. We prove that the canonical class of algebras (under the point of view of Abstract Algebraic Logic) associated with a selfextensional logic with a DN-term is a variety, and we obtain that the logic is in fact fully selfextensional.Mathematics Subject Classification. 03G27, 03B22, 03G25, 06A12.Keywords. Selfextensional logics, distributive nearlattices, logics based on partial orders, abstract algebraic logic.