| | 106 | |
| | 107 | |
| | 108 | def replace_add_data(context, content): |
| | 109 | """ |
| | 110 | Replace the temporary inserted "add data" tag, with all collected CSS/JS |
| | 111 | contents, e.g. from the internal pages. |
| | 112 | Note: The tag added in PyLucid.plugins_internal.page_style |
| | 113 | """ |
| | 114 | try: |
| | 115 | internal_page = get_internal_page("page_style", "add_data") |
| | 116 | internal_page_content = internal_page.content_html |
| | 117 | |
| | 118 | context = { |
| | 119 | "js_data": context["js_data"], |
| | 120 | "css_data": context["css_data"], |
| | 121 | } |
| | 122 | html = render_string_template(internal_page_content, context) |
| | 123 | except Exception, msg: |
| | 124 | html = "<!-- Replace the ADD_DATA_TAG error: %s -->" % msg |
| | 125 | |
| | 126 | content = content.replace(settings.ADD_DATA_TAG, html) |
| | 127 | return content |