Control appearance of field in particular part

Topics: Writing modules
Jul 25, 2011 at 6:02 AM

Suppose the "Page" content type have two custom parts:    BannerPart and ThumbnailPart, where they both have one same type of Field, the image field.

Now, I want to only show the image field in thumbnail part but not in banner part when displaying the Page, how can I control this?

Coordinator
Jul 25, 2011 at 8:32 PM

With placement.info?

Jul 26, 2011 at 12:39 AM

can't be done with placement.info because the shape are the same from both BannerPart and ThumbnailPart. They are using the same type of field.

It loos like:

1|Page
2|--BannerPart
3|----ImageField (same shape)
2|--ThumbnailPart
3|----ImageField (same shape)

Coordinator
Jul 26, 2011 at 12:56 AM

MMh. Last resort, you can differentiate them in code from the template.

Jul 26, 2011 at 1:12 AM
bertrandleroy wrote:

MMh. Last resort, you can differentiate them in code from the template.

I guess you mean checking the image field belongs to which part in the template?

Coordinator
Jul 26, 2011 at 1:17 AM

Yes.