Currently, the ctools wizard trail is rendered completely in advance, with no possibility to e.g. add html markup to the trail's items. There is a theme function, theme_ctools_wizard_trail(), but that merely allows to style the separator string used to concatenate the individual trail items. Especially when using the free trail option, any markup used in the trail title appears check_plain'ed in the output, since it is run through l().

Instead of hard-coding the trail title text or link, ctools should rather use render arrays to allow changing the markup during rendering stage.

Comments

smk-ka’s picture

Status: Active » Needs review
StatusFileSize
new2.15 KB

Patch using render arrays to allow processing of individual trail items on the theme layer.

smk-ka’s picture

StatusFileSize
new2.81 KB

Worked a little bit more on that one, the wrapping <span>'s have been moved to a real #theme_wrapper function and the full wizard context has been made available to the theme functions. This allows to access any additional information put into $form_info['forms'].

merlinofchaos’s picture

Okay so I think this is a very good idea.

I am worried, though; anyone in the real world who has already implemented their own theme_ctools_wizard_trail() will be broken. The thing is...I don't know if anyone in the real world has done this. People do surprising things, I find.

I think I need a version of this that will NOT break if someone has already implemented this, which means creating a backward compatible version. :(

merlinofchaos’s picture

Status: Needs review » Needs work
mrfelton’s picture

> I am worried, though; anyone in the real world who has already implemented their own theme_ctools_wizard_trail() will be broken. The thing is...I don't know if anyone in the real world has done this.

We have done this, but I would be more than happy to replace it with something more flexible. The current theming abilities of the trail are very limiting, and at the moment we can only resort to regex hacks to get the level of control that we need.

zilverdistel’s picture

Attached is a simple patch which adds a form_info variable to the theme layer. This way, you have infinite flexibility and the solution is still backwards-compatible.

It is not ideal I'm sure, but it has the advantage of being simple ...

merlinofchaos’s picture

Status: Needs work » Needs review

Moving back to needs review so this doesn't get lost.

damienmckenna’s picture

StatusFileSize
new1.42 KB

How about also passing in the item divider as a theme argument?

michelle’s picture

Issue summary: View changes

I tested #8 by using it for #1775234: Local tasks on MiniPanels edit pages are confusing and it is working for me.

damienmckenna’s picture

StatusFileSize
new1.54 KB

This tightens up the code in theme_ctools_wizard_trail().

michelle’s picture

Patch #11 also works fine, again tested with #1775234: Local tasks on MiniPanels edit pages are confusing

damienmckenna’s picture

Just to be clear, the patch does two things:

  • Adds a method of defining what the divider is on the links used in a wizard.
  • Adds the $form_info variable to the theme function which allows the theme and other modules differentiate between different wizards, thus allowing Mini Panels to be customized specially in #1775234: Local tasks on MiniPanels edit pages are confusing.

Separately they are very small changes, together they give some nice potential for customizing part of the display of CTools wizards.

michelle’s picture

Status: Needs review » Reviewed & tested by the community
japerry’s picture

Status: Reviewed & tested by the community » Fixed

Awesome, thats simple. Fixed.

  • japerry committed 6fb8944 on 7.x-1.x authored by DamienMcKenna
    Issue #1300562 by DamienMcKenna, smk-ka, zilverdistel: More control over...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.