1

I am using Context with Delta and Omega3. I am trying to make the Drupal Commerce Checkout, Review and Complete pages each appear differently. These are their default paths:

checkout/*
checkout/*/review
checkout/*/complete

The problem is that if you set a condition path to 'checkout/*' in one context then the 'review' and 'complete' condition paths will both be overridden by it.

Is there a way to get separate contexts for each of the 3 pages?

  • Drupal's recognition is greedy. Sometimes it's good to define shortest path last. I don't know enough about stuff you are using, not enough to post full answer, but hope that'll help. – Mołot May 22 '13 at 15:06
  • I need to define 3 different contexts for each of the different paths. Since each condition path is in a different context and there is no way of weighting contexts, I don't think the order of path definition would make any difference. – user320691 May 22 '13 at 15:21
4

Create 3 different contexts, in each context add path condition and set the paths as follow:

First Context:

checkout/*
~checkout/*/review
~checkout/*/complete

Second Context:

~checkout/*
checkout/*/review
~checkout/*/complete

Third Context:

~checkout/*
~checkout/*/review
checkout/*/complete

According to Context documentation ~ character (tilde) can be used to exclude one or more paths.

  • 1
    That worked. Despite the module's popularity, I was not able to find much in the way of documentation for Context. The drupal.org page points to README.txt. Anyway, I was getting ready to write a plugin so thank you! – user320691 May 22 '13 at 16:59
  • 1
    @kalidasan glad my answer helped you :) – Aboodred1 May 19 '16 at 2:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.