Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Extending tl_module to include a new selector field makes the field visible for all module types #429

Closed
ghost opened this issue Nov 29, 2011 · 2 comments
Assignees
Labels

Comments

@ghost
Copy link

ghost commented Nov 29, 2011

Hi Leo,

I tried to create a new selector that was a radio group just like the "source" field, but is called "category_source" with our own set of five options. It works the same as the source field in that it is used as a selector field, and you get an additional field for certain options (a page tree). However, it only applies to a specific module and of course the options that it uses are palettes just like the values "default" "internal" and "external". Our values are different but you get the idea. The problem I have is it seems that because it is designated as a selector, it comes up for all modules (such as Navigation), etc. I tried to work around it by checking the POST on the type field, but then I lose the page tree associated with certain options (the page tree won't load on submitOnChange) - in the radio group when it looks only at that specific module type.

I'm not sure if this is a bug or not, please advise. I always thought that a selector would only appear if it was listed as a field in the main palette and in selector as well. Perhaps I am doing something wrong.

here is an example of what I'm doing. Please note I am treating "radio_option_palette_1" as the example which represents the module's type key. There is no "default" of course since tl_module is already using that for another purpose. I have omitted the proper syntax to avoid the wiki auto-link functionality from breaking the general form of it...

$GLOBALS[TL_DCA][tl_module][palettes][+selector+][] = 'category_source';
$GLOBALS[TL_DCA][tl_module][palettes][radio_option_palette_1] = 'name;type;headline;category_source'; (etc. etc.)
$GLOBALS[TL_DCA][tl_module][palettes][radio_option_palette_2] = 'name;type;headline.... etc.

Thanks!

--- Originally created by fbliss on January 20th, 2009, at 09:16am (ID 429)

@ghost ghost assigned leofeyer Nov 29, 2011
@leofeyer
Copy link
Member

I cannot reproduce this issue. If I add a selector field that is only included in a particular palette, the field is not shown if another palette is loaded.

--- Originally created on February 5th, 2009, at 06:12pm

@leofeyer
Copy link
Member

--- Originally closed on February 5th, 2009, at 06:12pm

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant