The paper is devoted to an analysis of optimality conditions for nonsmooth multidimensional problems of the calculus of variations with various types of constraints, such as additional constraints at the boundary and isoperimetric constraints. To derive optimality conditions, we study generalised concepts of differentiability of nonsmooth functions
called codifferentiability and quasidifferentiability. Under some natural and easily verifiable assumptions we prove that a nonsmooth integral functional defined on the Sobolev space is continuously codifferentiable and compute its codifferential and quasidifferential. Then we apply general optimality conditions for nonsmooth optimisation problems in
Banach spaces to obtain optimality conditions for nonsmooth problems of the calculus of variations. Through a series of simple examples we demonstrate that our optimality conditions are sometimes better than existing ones in terms of various subdifferentials, in the sense that our optimality conditions can detect the non-optimality of a given point,
when subdifferential-based optimality conditions fail to disqualify this point as non-optimal.