Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update content type controllers to page and component controllers #7164 #1865

Merged
Merged
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
:is-up-to-date: True
:last-updated: 4.1.0
:last-updated: 4.1.6

.. index:: Content Modeling, Modeling, Content Model, Page Content Type, Component Content Type

Expand Down Expand Up @@ -1065,11 +1065,11 @@ The `FreeMarker <http://freemarker.org>`_ language is supported. For detailed Fr

|hr|

---------------------------------------------------------------
Content Type Controller (Page and Component Scripts) Definition
---------------------------------------------------------------
---------------------------------------------------------------------
Page and Component Controller (Page and Component Scripts) Definition
---------------------------------------------------------------------
Crafter page and components can have their own controller scripts too, that are executed before the page or component
is rendered, and that can contribute to the model of the template. Learn more about page and script controllers in :ref:`content-type-controllers`.
is rendered, and that can contribute to the model of the template. Learn more about page and script controllers in :ref:`page-and-component-controllers`.

|hr|

Expand Down Expand Up @@ -1357,7 +1357,7 @@ We can now start adding the script to get a list of articles depending on the ac

There are two ways to bind a script/controller to a page/component. The first way, as we have seen is to put the script under Scripts->Pages or Scripts->Components, and name the script after the page or component type. We'll show the other way how to bind a script to a page/component in the next section :ref:`content-type-component`

To find out more about page and component scripts, please see :ref:`content-type-controllers`.
To find out more about page and component scripts, please see :ref:`page-and-component-controllers`.

Now that we have our controller, we just need to add code to the freemarker template (view) to display the list of articles returned by the script.

Expand Down Expand Up @@ -1399,7 +1399,7 @@ Now that we have our controller, we just need to add code to the freemarker temp

|

As you can see from the controller we just added, the controller is used to customize your page by enabling you to run a script before the page is rendered. To find out more about groovy APIs in CrafterCMS, please see the section :ref:`content-type-controllers`.
As you can see from the controller we just added, the controller is used to customize your page by enabling you to run a script before the page is rendered. To find out more about groovy APIs in CrafterCMS, please see the section :ref:`page-and-component-controllers`.

.. _content-type-component:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
:is-up-to-date: True
:last-update: 4.1.2
:last-updated: 4.1.8

.. index:: Content Controllers, Content Type Controllers, Page Interceptors
.. index:: Page Controllers, Component Controllers

.. _content-type-controllers:
.. _page-and-component-controllers:

---------------------------------------------------------
Content Type Controller (Page and Component Interceptors)
---------------------------------------------------------
------------------------------
Page and Component Controllers
------------------------------
.. |SiteItem| replace:: :javadoc_base_url:`SiteItem <engine/org/craftercms/engine/model/SiteItem.html>`
.. |AllHttpScopesAndAppContextHashModel| replace:: :javadoc_base_url:`AllHttpScopesAndAppContextHashModel <engine/org/craftercms/engine/view/freemarker/AllHttpScopesAndAppContextHashModel.html>`

Crafter content types (page, components) can have their own controller scripts too, that are executed before the page or component
Crafter pages and components can have their own controller scripts too, that are executed before the page or component
is rendered, and that can contribute to the model of the template. These scripts, besides the common variables, have
the ``templateModel`` and the ``contentModel`` available.

Expand Down
2 changes: 1 addition & 1 deletion source/by-role/developer/common/targeting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ the page renders. To do this, we need to create a script named after the page we
to run before rendering, under *scripts -> pages* In the groovy script below, a query is sent to
ask for all articles targeted for the requested category. (To see the script in Studio, from the
Sidebar, navigate to scripts -> pages -> category-landing.groovy) Please see
:ref:`content-type-controllers` for more details on binding a script to a page or component.
:ref:`page-and-component-controllers` for more details on binding a script to a page or component.

.. code-block:: groovy
:caption: Category Landing Page Script
Expand Down
6 changes: 3 additions & 3 deletions source/by-role/developer/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ Aside from the core concepts listed above, a developer needs to be familiar with
- Description
* - :ref:`scheduled-jobs`
- Provides you information on scheduling jobs
* - :ref:`content-type-controllers`
- Provides you information on content type controllers
* - :ref:`page-and-component-controllers`
- Provides you information on page and component controllers
* - :ref:`targeting`
- Provides you information on rendering content adapted to different things
* - :ref:`servlet-filters`
Expand Down Expand Up @@ -105,7 +105,7 @@ Aside from the core concepts listed above, a developer needs to be familiar with
:hidden:

common/scheduled-jobs
common/content-type-controllers
common/page-and-component-controllers
common/targeting
common/servlet-filters
common/working-with-dates-groovy
Expand Down