Skip to content

Commit

Permalink
Load example data from site_package_data
Browse files Browse the repository at this point in the history
Releases: main
  • Loading branch information
linawolf committed Oct 6, 2024
1 parent 13bb901 commit 7c2cdba
Show file tree
Hide file tree
Showing 16 changed files with 32 additions and 118 deletions.
112 changes: 31 additions & 81 deletions Documentation/CreatePages/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,101 +6,51 @@
Create initial pages
====================

In the next step, we create some initial pages. You and your editors will be
able to create further pages, remove pages, enable and disable pages and
shuffle pages around in the future. The following page tree is just an example
as a starting point.
To follow this tutorial you need to have a few pages in your page tree and some
example content elements on these pages. You also need a basic site configuration.

Go to module :guilabel:`Web > Page`. Assuming, we are using a
fresh installation of TYPO3 as
outlined in section :ref:`prerequisites`, an almost empty area is shown in the
page tree area. The only entry is the name of the website as defined during the
installation process (e.g. "New TYPO3 site") with a grey TYPO3 logo.
.. _load-example-data:

By clicking the page icon with the "plus" at the top, and then dragging the
"standard page" icon to its appropriate position in the page tree, you can
build the following page tree. Enter the page names as shown (a double-click on
the page name allows you to rename it).
Load the example data automatically
===================================

.. include:: /Images/AutomaticScreenshots/CreateInitialPages.rst.txt
We have a created a small extension that loads the example data into your
installation. We suggest you work with this data while following this tutorial.

By default, all new pages are disabled (marked as a red icon at the bottom
right). Enable all pages by clicking the "Enable" link in the context menu.
Install extension :composer:`t3docs/site-package-data` to load the example
data needed in this tutorial. It works similar to the Introduction package,
:composer:`typo3/cms-introduction` if you have used it before.

.. include:: /Images/AutomaticScreenshots/EnablePagesInContextMenu.rst.txt
.. code-block:: bash
Once all pages have been created, you should end up with the following page
tree.
ddev composer req t3docs/site-package-data
ddev typo3 extension:setup
.. include:: /Images/AutomaticScreenshots/FinalPageTree.rst.txt
Loading the data might take a few seconds. If you do not see the new pages try
reloading the backend.

.. figure:: PageModule.png
:alt: Screenshot of the backend module "Page" with the loaded example data

The page tree in the module :guilabel:`Web > Page` contains a few example pages now.

.. _typo3-backend-site:

Site configuration
==================

The site configuration is stored in a file called
:file:`config/sites/[site_identifier]/config.yaml`. For your convenience you
can create and edit this file with the backend module
:guilabel:`Site Management > Sites`.

The root page you just created should be listed in this module. Click on the
button :guilabel:`Add new site configuration` beside that page to create a
site configuration for it.

.. figure:: NewSite.png

Create a new site configuration

In the next step you can enter some basic information about the site.

The site identifier will can be arbitrary so we use "example_site" here.
The entry point should be an URL pointing to the web root. In our example this
is a URL generated by ddev.

From the list of available sets choose the set that we created in
:ref:`site_set`. We called in "Example site package set" in this example.

.. figure:: NewSitePage1.png

Enter the basic data and choose the site set
If you followed :ref:`load-example-data` a basic configuration has already
been created for you.

As our set already depends on the set of fluid_styled_content it is not
necessary to chose that set here.

.. figure:: NewSitePageLanguage.png

Create a language for your site by choosing it from the list of presets

In the next two tabs you can define error handling like a custom 404 and static
routes, for example to a :file:`robots.txt`. We do not cover these topics here.

Here you can read about :ref:`Site handling <t3coreapi:sitehandling>` in general.

After saving a new file should have been created in your project:

.. literalinclude:: _config.yaml
:language: yaml
:caption: config/sites/example_site/config.yaml


Preview the page
================

At this point, it is a good time to preview what we have achieved so far. Go to
:guilabel:`Web > View` and try a few different screen widths. The two buttons at the
top left of the screen (marker 1) allow you to show/hide the page tree and to
minimize the function menu at the left.
The site configuration is stored in a file called
:file:`config/sites/main/config.yaml`. You can edit this file with the
backend module :guilabel:`Site Management > Sites`.

.. include:: /Images/AutomaticScreenshots/ExtensionInstallationPreviewPage.rst.txt
.. figure:: SiteConfiguration.png
:alt: Screenshot of the backend module "Site Management"

The preview shows the frontend with a menu (*NavBar*) at the top. In a mobile
view (narrow screen width), a button provides access to a toggle menu. However,
only one link is shown in the menu: "Home". The other pages we have created in
the backend are still missing. Besides the menu, a large "Hello, world!" greets
the visitors of the website. This is the "Jumbotron"-partial. Below that, three
columns are shown, each of them with a "Heading". In a mobile view, these
columns stack on top of each other nicely.
Edit the site configuration in :guilabel:`Site Management > Sites`

Let's update the Fluid template files and implement a simple menu and enable
dynamic content that can be edited in the TYPO3 backend in the next steps.
If you want to create a site configuration manually see
:ref:`Create a new site configuration <t3start:site-configuration>` in the
"Getting Started Tutorial".
Binary file removed Documentation/CreatePages/NewSite.png
Binary file not shown.
Binary file removed Documentation/CreatePages/NewSitePage1.png
Binary file not shown.
Binary file removed Documentation/CreatePages/NewSitePageLanguage.png
Binary file not shown.
Binary file added Documentation/CreatePages/PageModule.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Documentation/CreatePages/SiteConfiguration.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 0 additions & 16 deletions Documentation/CreatePages/_config.yaml

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

2 changes: 1 addition & 1 deletion Documentation/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ A working copy of the sitepackage extension can be retrieved from the

Preface/Index
Introduction/Index
CreatePages/Index
MinimalExample/Index
DesignTemplate/Index
FluidTemplates/Index
TypoScriptConfiguration/Index
ExtensionConfiguration/Index
ExtensionInstallation/Index
CreatePages/Index
MainMenuCreation/Index
ContentMapping/Index
Summary/Index
Expand Down

0 comments on commit 7c2cdba

Please sign in to comment.