Skip to content

Commit

Permalink
Docs: Merge changes from #640 into new structure
Browse files Browse the repository at this point in the history
  • Loading branch information
maiksprenger committed Apr 16, 2013
1 parent ecaf94f commit d9e4881
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
14 changes: 13 additions & 1 deletion docs/source/howto/how_to_customise_a_view.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,22 @@ Oscar's view if you like::
In this example, we set a new template location but it's possible to customise the view
in any imaginable way.

If you want to change the template, create the alternative template
``new-homeview.html``. This could either be
in a project-level ``templates`` folder that is added to your ``TEMPLATE_DIRS``
settings, or a app-level ``templates`` folder within your 'promotions' app. For
now, put something simple in there, such as::

<html>
<body>
<p>You have successfully overridden the homepage template.</p>
</body>
</html>

Now you can hook it up in your local ``app.py``::

# myproject/promotions/app.py
from oscar.apps.promotions import PromotionsApplication as CorePromotionsApplication
from oscar.apps.promotions.app import PromotionsApplication as CorePromotionsApplication

from myproject.promotions.views import HomeView

Expand Down
4 changes: 2 additions & 2 deletions docs/source/topics/customisation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ of the app with yours. You can do that by supplying an extra argument to
# all your non-Oscar apps
] + get_core_apps(['yourproject.order'])

``get_core_apps([])`` will return a list of Oscar core apps. If you supply
additional apps, they will be used to replace the Oscar core apps.
``get_core_apps([])`` will return a list of Oscar core apps. If you supply a
list of additional apps, they will be used to replace the Oscar core apps.
In the above example, ``yourproject.order`` will be returned instead of
``oscar.apps.order``.

Expand Down

0 comments on commit d9e4881

Please sign in to comment.