Skip to content

Commit 710b5d8

Browse files
committed
Standardised on "apphook" throughout docs
Existing examples included: AppHook, App-Hook, Apphook, apphook, app-hook "Apphook" has been chosen for pragmatic reasons (for example, it reflects naming in the code itself), and we must simply live with the stain of its ugliness on our consciences until we have expunged it through penance and good deeds. Also added a note on the future use of spaces rather than tabs in frontend ccode.
1 parent 4fc1125 commit 710b5d8

File tree

8 files changed

+32
-29
lines changed

8 files changed

+32
-29
lines changed

docs/contributing/contributing.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ We try to conform to `PEP8`_ as much as possible. A few highlights:
9595
HTML, CSS and JavaScript
9696
------------------------
9797

98-
As of django CMS 3.0.7, we use spaces within frontend code, not tabs as previously.
98+
As of django CMS 3.1, we will use spaces within frontend code, not tabs as previously. In the
99+
meantime, please continue using tabs - all tabs will be converted to spaces in a single commit
100+
for 3.1.
99101

100102
Frontend code should be formatted for readability. If in doubt, follow existing examples, or ask.
101103

docs/how_to/apphooks.rst

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
#########
2-
App-Hooks
2+
Apphooks
33
#########
44

5-
With App-Hooks you can attach whole Django applications to pages. For example
6-
you have a news app and you want it attached to your news page.
5+
An **Apphook** allows you to attach a Django application to a page. For example, you might have
6+
a news application that you'd like integrated with django CMS. In this case, you can create a
7+
normal django CMS page without any content of its own, and attach the news application to the page;
8+
the news application's content will be delivered at the page's URL.
79

8-
To create an apphook create a ``cms_app.py`` in your application. And in it
9-
write the following::
10+
To create an apphook place a ``cms_app.py`` in your application. And in it write the following::
1011

1112
from cms.app_base import CMSApp
1213
from cms.apphook_pool import apphook_pool
@@ -19,7 +20,6 @@ write the following::
1920
apphook_pool.register(MyApphook)
2021

2122
Replace ``myapp.urls`` with the path to your applications ``urls.py``.
22-
2323
Now edit a page and open the advanced settings tab. Select your new apphook
2424
under "Application". Save the page.
2525

@@ -66,9 +66,9 @@ The ``main_view`` should now be available at ``/hello/world/`` and the
6666
default :class:`~django.template.Context` instance.
6767

6868

69-
*************
70-
Apphook Menus
71-
*************
69+
**************
70+
Apphook menus
71+
**************
7272

7373
If you want to add a menu to that page as well that may represent some views
7474
in your app add it to your apphook like this::
@@ -132,7 +132,7 @@ We would now create a menu out of these categories::
132132

133133
menu_pool.register_menu(CategoryMenu)
134134

135-
If you add this menu now to your app-hook::
135+
If you add this menu now to your apphook::
136136

137137
from myapp.menus import CategoryMenu
138138

@@ -147,7 +147,7 @@ You get the static entries of :class:`MyAppMenu` and the dynamic entries of
147147
.. _multi_apphook:
148148

149149
***************************************
150-
Attaching an Application multiple times
150+
Attaching an application multiple times
151151
***************************************
152152

153153
If you want to attach an application multiple times to different pages you have 2 possibilities.
@@ -246,7 +246,7 @@ Or, if you are rendering a plugin, of the context instance::
246246
.. _apphook_permissions:
247247

248248
*******************
249-
Apphook Permissions
249+
Apphook permissions
250250
*******************
251251

252252
By default all apphooks have the same permissions set as the page they are assigned to.
@@ -285,8 +285,9 @@ with CMS permission decorator, then use ``exclude_permissions`` property of apph
285285
exclude_permissions = ["some_nested_app"]
286286

287287

288-
For example, django-oscar_ apphook integration needs to be used with exclude permissions of dashboard app,
289-
because it use `customizable access function`__. So, your apphook in this case will looks like this::
288+
For example, django-oscar_ apphook integration needs to be used with exclude permissions of
289+
dashboard app, because it use `customizable access function`__. So, your apphook in this case will
290+
looks like this::
290291

291292
class OscarApp(CMSApp):
292293
name = _("Oscar")
@@ -298,9 +299,9 @@ because it use `customizable access function`__. So, your apphook in this case w
298299
.. _django-oscar: https://github.com/tangentlabs/django-oscar
299300
.. __: https://github.com/tangentlabs/django-oscar/blob/0.7.2/oscar/apps/dashboard/nav.py#L57
300301

301-
***********************************************
302+
************************************************
302303
Automatically restart server on apphook changes
303-
***********************************************
304+
************************************************
304305

305306
As mentioned above, whenever you add or remove an apphook, change the slug of a
306307
page containing an apphook or the slug if a page which has a descendant with an

docs/introduction/apphooks.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
########
2-
AppHooks
3-
########
1+
#########
2+
Apphooks
3+
#########
44

55
Right now, our django Polls app is statically hooked into the project's
66
``urls.py``. This is allright, but we can do more, by attaching applications to
77
django CMS pages.
88

9-
We do this with an **AppHook**, created using a :class:`CMSApp
9+
We do this with an **Apphook**, created using a :class:`CMSApp
1010
<cms.app_base.CMSApp>` subclass, which tells the CMS how to include that app.
1111

12-
AppHooks live in a file called ``cms_app.py``, so create one in your Poll
12+
Apphooks live in a file called ``cms_app.py``, so create one in your Poll
1313
application.
1414

1515
This is the most basic example for a django CMS app::
@@ -25,7 +25,7 @@ This is the most basic example for a django CMS app::
2525

2626
apphook_pool.register(PollsApp) # register your app
2727

28-
You'll need to restart the runserver to allow the new AppHook to become
28+
You'll need to restart the runserver to allow the new apphook to become
2929
available.
3030

3131
In the admin, create a new child page of the Home page. In its *Advanced
@@ -36,7 +36,7 @@ settings*, choose "Polls App" from the *Application* menu, and Save.
3636
.. |apphooks| image:: ../images/cmsapphook.png
3737

3838
Refresh the page, and you'll find that the Polls application is now available
39-
directly from the new django CMS page. (AppHooks won't take effect until the
39+
directly from the new django CMS page. (Apphooks won't take effect until the
4040
server has restarted, though this is not generally an issue on the runserver,
4141
which can handle this automatically.)
4242

docs/introduction/menu.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ What's happening here:
5252
* ... and then create a ``NavigationNode`` object from each one
5353
* ... and return a list of these ``NavigationNodes``
5454

55-
This menu class is not active until attached to the AppHook we created earlier.
55+
This menu class is not active until attached to the apphook we created earlier.
5656
So open your ``cms_app.py`` and add::
5757

5858
menus = [PollsMenu]

docs/introduction/third_party.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Since we added a new app, we need to update our database::
4848

4949
Start the server again.
5050

51-
The weblog application comes with a django CMS AppHook, so add a new django CMS
51+
The weblog application comes with a django CMS apphook, so add a new django CMS
5252
page, and add the weblog application to it as you did for Polls in the previous
5353
tutorial. *You may need to restart your server at this point.*
5454

docs/upgrade/2.4.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Removed the MultilingualMiddleware
128128

129129
We removed the MultilingualMiddleware. This removed rather some unattractive
130130
monkey-patching of the ``reverse()`` function as well. As a benefit we now
131-
support localisation of urls and Apphook urls with standard Django helpers.
131+
support localisation of URLs and apphook URLs with standard Django helpers.
132132

133133

134134
For django 1.4 more infos can be found here:

docs/upgrade/3.0.3.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ For more details have a look at the docs:
2626

2727

2828
Apphook Permissions
29-
===================
29+
====================
3030

3131
Apphooks have now by default the same permissions as the page they are attached to.
3232
This means if a page has for example a login required enabled all views in the apphook

docs/upgrade/3.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ processors you will need to change their function signature to add the extra
240240
argument.
241241

242242
Apphooks
243-
========
243+
=========
244244

245245
Apphooks have moved from the title to the page model. This means you can no
246246
longer have separate apphooks for each language. A new ``application instance name``

0 commit comments

Comments
 (0)