External link content type component for bulbs projects.
Using this project requires setup and implementation of provided Django apps. The site refers to the site that this component is being installed in.
From the site using this component:
- Add a dependency for this project in
requirements.txt
, where<version>
is the version to install:
git+https://github.com/theonion/bulbs-component-external-link.git@<version>#egg=bulbs-component-external-link
-
Run
pip install -r requirements.txt
on requirements file in the correct context to install this project's Django apps. -
Install bower dependencies, where
<version>
is the version to install which should match the<version>
used inrequirements.txt
:
$ bower install --save https://github.com/theonion/bulbs-component-external-link.git\#\<version>
- Create a external-link package in the site's app directory.
- Add
"bulbs_component_external_link"
toINSTALLED_APPS
in Django's settings file. - Add a
models.py
that implementsbulbs_component_external_link.models.ExternalLinkMixin
. - Create a migration for your app with Django migrations as you would any other app.
- Run migrations.
To use the CMS templates, scripts, and styles:
-
Include
"bulbs_component_external_link_cms"
inINSTALLED_APPS
in Django's settings file. -
If using django-pipeline add the following to the Django settings file:
from bulbs_component_external_link import pipeline as external_link_pipeline
...
external_link_pipeline.cms_js.update_pipeline(PIPELINE_JS)
Where PIPELINE_JS
is the current javascript pipeline dictionary. Access the js from the pipeline by adding the following to the base html for the cms:
{% compressed_css "external_link_cms" %}
- Create a CMS page with the following html:
<external-link-edit article="content"></external-link-edit>
Where content
is an angular scope variable containing the content's data.
- Add
bulbs.externalLink
as a dependency for your CMS's Angular app.
compat-builds/django-bulbs-cms
should not be edited directly. This app exists only until
CMS files are completely migrated out of django. To make changes to this package,
edit files located in src/bulbs-cms
then run grunt build_bulbs_cms_for_django
to rebuild compat-builds/django-bulbs-cms
with your changes.
Commit your changes and the rebuilt package, then reinstall the app on whatever project(s) require the changes.