{% extends "base.html" %} {% set page_title = widget_name + " - Integration Code" %} {% block content %}

{{ widget_name }} - Integration Code

Back to Widgets
Widget Preview
Embed Code
Basic Iframe Embed:
<iframe 
    src="{{ request.url_root }}widgets/embed/{{ widget_type }}"
    width="100%" 
    height="400"
    frameborder="0"
    scrolling="auto"
    style="border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1);">
</iframe>
With Customization Options:
<iframe 
    src="{{ request.url_root }}widgets/embed/{{ widget_type }}?limit=8&genus=Cattleya"
    width="100%" 
    height="500"
    frameborder="0"
    scrolling="auto"
    style="border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1);">
</iframe>
Customization Options
URL Parameters:
{% if widget_type == 'gallery' %} {% elif widget_type == 'search' %} {% elif widget_type == 'featured' %} {% endif %}
Parameter Description Example
limitNumber of orchids to display?limit=8
genusFilter by specific genus?genus=Cattleya
queryDefault search term?query=purple
rotationAuto-rotate featured orchid?rotation=daily
Styling Options:
  • Width: Use 100% for responsive, or fixed pixel values
  • Height: Recommended: 300-500px depending on content
  • Border: Add border: 1px solid #ccc if needed
  • Margin: Add spacing around the widget as needed
Neon One Integration:
  1. Log into your Neon One admin panel
  2. Navigate to the page where you want to add the widget
  3. Look for an "HTML" or "Custom Code" block option
  4. Paste the iframe code into the HTML block
  5. Save and publish your page
Advanced: JSON API Integration

For custom JavaScript integration, use the JSON API:

API Endpoint:
{{ request.url_root }}widgets/api/{{ widget_type }}
JavaScript Example:
fetch('{{ request.url_root }}widgets/api/{{ widget_type }}')
    .then(response => response.json())
    .then(data => {
        console.log('Widget data:', data);
        // Use data.data to access widget content
        // Render your custom widget here
    })
    .catch(error => {
        console.error('Error loading widget data:', error);
    });
{% endblock %}