Hello,

Is there a way to specify a CCK formatter on a node-by-node basis?

That is, I can specify how to display a field for an entire content type, but I want to be able to let a content creator decide which formatter to use for a field when they create a node. My use case is for ImageField/ImageCache, in that I want to allow the content creator to choose the small, medium, or large preset of an image, but I can foresee use cases outside of that for other CCK field types.

If CCK proper can't do this, is there a module that hooks into CCK that can?

Thanks,

Mark Trapp

Comments

markus_petrux’s picture

Status: Active » Fixed

You need to do this using code. One possible approach is that you could create a custom formatter that uses other formatters depeding on the conditions that you may need. See CCK Formatters module to see an example to create a formatter for any field, then in the code of that formatter you need to code.

magnestyuk’s picture

@amorfati, have you found a way to do what you describe?

mark trapp’s picture

I found a solution for my specific use case using ImageCache Actions, which uses a similar solution to what markus_petrux described:

Besides trying to allow the user to get the right size image in a node, I was trying to allow a user to specify one ImageCache preset for a horizontal aspect ratio image upload, and a different ImageCache preset for a vertical aspect ratio image upload. ImageCache Actions has a preset that determines which aspect ratio an image has and executes a preset based on that determination, as well as a custom ImageCache preset that lets me add my own custom logic. Setting the formatter to the ImageCache action allowed the user to get the result they needed without code.

Status: Fixed » Closed (fixed)

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

dman’s picture

Old post, but if you find this by searching (like I did)
D6 Renderer per node
D7 Formatter field