Skip to content

Commit 59b94d4

Browse files
authored
Merge pull request #1211 from TOMToolkit/1048-add-documentation-and-clarity-about-how-to-add-templatetags-with-a-custom_app
add customization clarification and links to tom_demoapp
2 parents 6007801 + de28a44 commit 59b94d4

3 files changed

Lines changed: 30 additions & 2 deletions

File tree

221 KB
Loading

docs/customization/customize_template_tags.rst

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ Customizing Template Tags
44
The TOM Toolkit is designed to be as customizable as possible. A number
55
of UI objects are rendered as Django templatetags. Django has quite a
66
few `built-in template
7-
tags <https://docs.djangoproject.com/en/3.0/ref/templates/builtins/>`__,
7+
tags <https://docs.djangoproject.com/en/stable/ref/templates/builtins/>`__,
88
but also allows the creation of `custom template
9-
tags <https://docs.djangoproject.com/en/3.0/howto/custom-template-tags/>`__,
9+
tags <https://docs.djangoproject.com/en/stable/howto/custom-template-tags/>`__,
1010
which the TOM Toolkit leverages heavily.
1111

1212
However, it’s possible that a TOM Toolkit template tag doesn’t quite
@@ -15,6 +15,15 @@ quite what you’re looking for, or the target data isn’t formatted the
1515
way you’d like. This tutorial will show you how to write your own
1616
template tag to suit your own program better.
1717

18+
Basics of Django Templating Vocabulary
19+
--------------------------------------
20+
Sometimes the different terms involved in Django Templating that we use here can be confusing.
21+
If you find yourself needing a reminder of what the different terms mean, we've included this graphic, for a more
22+
detailed description please see the
23+
`Django Template Documentation <https://docs.djangoproject.com/en/stable/topics/templates/>`__.
24+
25+
|image0|
26+
1827
Preparing your project for custom template tags
1928
-----------------------------------------------
2029

@@ -320,3 +329,5 @@ easily modified.
320329
As far as this template tag goes, as of this tutorial, it’s now a part
321330
of the base TOM Toolkit, but all of the information here should provide
322331
you with the ability to write your own.
332+
333+
.. |image0| image:: /_static/customize_template_tags_doc/Templatetags.png

docs/customization/customize_templates.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,23 @@ display the image:
228228
After reloading the page, you should now see ``mytom.jpg`` displayed
229229
instead of the remote cat image.
230230

231+
Using Integration Points:
232+
=========================
233+
234+
The TOM toolkit provides a number of "integration points" that allow you to integrate your code with the base TOM
235+
Toolkit code so you don't have to overwrite templates. This has several benefits, including flexibility what apps you
236+
include, automatic app compatibility, simpler app installation, and the ability to gain new TOM Base improvements
237+
without updating your existing code.
238+
239+
The key to accessing these integration points is adding the integration methods to your AppConfig in your
240+
`custom_code.apps.py`file.
241+
242+
Current integration points include adding items to the navigation bar, adding tom_specific profile information to the
243+
user profile page, and more. A complete `list of integrations <https://github.com/TOMToolkit/tom_demoapp/wiki>`__,
244+
`example code <https://github.com/TOMToolkit/tom_demoapp/blob/dev/tom_demoapp/apps.py>`__, and
245+
`descriptions <https://github.com/TOMToolkit/tom_demoapp/wiki/Integration-Points#example-integration-points>`__ are
246+
available in the `tom_demoapp <https://github.com/TOMToolkit/tom_demoapp>`__ repository.
247+
231248
Further Reading
232249
~~~~~~~~~~~~~~~
233250

0 commit comments

Comments
 (0)