# Custom Content Display ## Example Overview - **Objective**: This example showcases how to customize the display of content in the page based on selected items using `django_tomselect`. - **Features Highlighted**: - Custom rendering of page content based on selected dropdown items. **Visual Examples**  ## Key Code Segments ### Forms The form for selecting embargo regions and timeframes uses `TomSelectModelChoiceField` and `TomSelectChoiceField` to render the dropdowns. :::{admonition} Form Definition :class: dropdown ```python class EmbargoForm(forms.Form): """Form for selecting embargo regions and timeframes.""" region = TomSelectModelChoiceField( config=TomSelectConfig( url="autocomplete-embargo-region", value_field="id", label_field="name", placeholder="Select region...", highlight=True, preload="focus", plugin_dropdown_header=PluginDropdownHeader( title="Publishing Regions", extra_columns={ "market_tier": "Market Tier", "typical_embargo_days": "Typical Days", }, ), ) ) timeframe = TomSelectChoiceField( config=TomSelectConfig( url="autocomplete-embargo-timeframe", value_field="value", label_field="label", placeholder="Select timeframe...", highlight=True, ) ) ``` ::: ### Templates The template for the content embargo management page uses custom CSS classes to style additional information based on the selected region. :::{admonition} Template Code :class: dropdown ```html {% extends 'example/base_with_bootstrap5.html' %} {% block extra_header %} {{ form.media }} {% endblock %} {% block content %}
This example demonstrates implement cascading selects with rich metadata, displaying custom information via JavaScript based on selected options, and the use of both model- and iterator-based form fields in a single form.
Configure content embargo periods for different publishing regions. Each region has specific market requirements and typical embargo periods based on their tier and local regulations.