Skip to main content

Configuration

Note

A root page should already exist.


1 / Create pages

First create one page each for the list view and the detail view.

2 / Create modules

In the left navigation, select Themes under Layout and click the gear icon Edit the front end modules of theme ID … for the theme of your website.

Create a module for the list view

Select New module and create a module for the list view:

  • Enter a title for your property list.
  • Under Module type, select Immobilienliste (property list) under pdirMaklermodul.
  • Under Detail view, select the corresponding page.
  • If no template is selected, the template makler_list is used by default.

The page Displayed fields and filters shows how to display fields and filters in the list view. You find further settings on the page List view configuration.

Create a module for the detail view (exposé)

Select New module and create a module for the detail view:

  • Enter a title for the exposé.
  • Under Module type, select Expose under pdirMaklermodul.
  • Under Immobilienliste (property list), select the page that shows the property list.
  • Under property templates, select either the template makler_details_simple or makler_details_extended.

Optional:

  • You can show a Google Maps map. Learn more on the page Integrating Google Maps.
  • You can set your own placeholder image in case a property has no image. If no placeholder image is selected and the property has no image, a placeholder image provided by the module is shown.

3 / Include the modules

Once you have created the modules, include them in the articles of the list and detail view.

  • Select the corresponding article of the list or detail view.
  • Choose New element and place it anywhere.
  • Select the element type Module and choose the module you created.

4 / Adjust the settings

Note

No longer necessary since Contao 4.9. Otherwise, enable auto_item in the settings under front end settings.

For the link to the detail page to work, auto_item must be enabled. Since Contao 4.9 it is enabled by default and has to be disabled explicitly in config.yml if you don’t want it:

# config/config.yml
contao:
    localconfig:
        useAutoItem: false

5 / Adjusting the property URL in parameters.yml

Note

Required since version 2.5.0. Here you can adjust how the alias for the property URL is generated.

Add the following lines to parameters.yml in app/config/ or, since Contao 4.9, in config/ (“parameters:” may already exist):

parameters:
    pdir_maklermodul.aliasPrefix: null
    pdir_maklermodul.alias: 'freitexte/objekttitel'
    pdir_maklermodul.aliasSuffix: 'verwaltung_techn/objektnr_extern'
    pdir_maklermodul.validAliasCharacters: '0-9a-z'
    pdir_maklermodul.aliasDelimiter: '-'
    pdir_maklermodul.aliasLocale: 'de'

This generates the alias from the property title and the external property number and only allows ASCII digits and lowercase letters.

The URL could then look like this:

example.org/details/expose/traumhafte-grosszugig-und-hochwertig-sanierte-wohnung-mit-erholungswert-14246.html

Example with the property title only:

parameters:
    pdir_maklermodul.aliasPrefix: null
    pdir_maklermodul.alias: 'freitexte/objekttitel'
    pdir_maklermodul.aliasSuffix: null
    pdir_maklermodul.validAliasCharacters: '0-9a-z'
    pdir_maklermodul.aliasDelimiter: '-'
    pdir_maklermodul.aliasLocale: 'de'

The URL could then look like this:

example.org/details/expose/traumhafte-grosszugig-und-hochwertig-sanierte-wohnung-mit-erholungswert.html

Allowed characters for the alias

- Unicode digits and lowercase letters -> '\pN\p{Ll}'
- Unicode digits and letters -> '\pN\pL'
- ASCII digits and lowercase letters -> '0-9a-z'
- ASCII digits and letters -> '0-9a-zA-Z'

For technical reasons, the import currently cannot use the settings of the root page.

Alias delimiter (aliasDelimiter)

pdir_maklermodul.aliasDelimiter: '-'
Result: example.org/details/expose/traumhafte-grosszugig-und-hochwertig-sanierte-wohnung-mit-erholungswert.html

pdir_maklermodul.aliasDelimiter: '_'
Result: example.org/details/expose/traumhafte_grosszugig_und_hochwertig_sanierte_wohnung_mit_erholungswert.html

Locale-specific alias (aliasLocale)

pdir_maklermodul.aliasLocale: 'en'
Result: example.org/details/expose/traumhafte-grosszugig-und-hochwertig-sanierte-wohnung-mit-erholungswert.html

pdir_maklermodul.aliasLocale: 'de'
Result: example.org/details/expose/traumhafte-großzügig-und-hochwertig-sanierte-wohnung-mit-erholungswert.html