Skip to content

NEOS CMS package for showing OpenImmo based data on a NEOS based website

License

Notifications You must be signed in to change notification settings

ujamii/openimmo-neos

Repository files navigation

OpenImmo extension for NEOS CMS

Packagist

OpenImmo and the OpenImmo logo are registered trademarks of the OpenImmo e.V. Neither is this package an official distribution nor am I associated with this organisation!

This NEOS package uses the openImmo API to generate everything NEOS needs to work with this data. All the code is generated:

  • all yaml config files (NodeTypes)
  • fusion files for accesssing the properties and childnodes
  • fusion files in Atomic Design style. Mainly to be overwritten by your own styles

As a result, you will have a load of special new content elements to be used inside the new document type. You can use NEOS to create/edit the data or import it from a OpenImmo export archive.

The content tree might look like this:

An example content tree An example content tree

TODOs / contributions

If you like the features listed below, or maybe some your own additions, feel free to fork and open a pull request.

  • the UPDATE xml action does not delete things at the moment
  • currently, the package uses the German OpenImmo labels for everything, so make use of default NEOS translation features
  • export data into xml/zip format
  • do all changes in a separate workspace and publish the changes to its base workspace instead of doing things live

Installation

composer req ujamii/openimmo-neos

Usage

  1. Install composer package.
  2. (optional) Create root node for import (see below)
  3. Done :-)

Importing OpenImmo XML into the NEOS Content Repository

Importing new data assumes you have zip file(s) located on your server filesystem. The import command will extract the zip file(s) into a new folder, parse the xml and update the content repository.

In your document tree, you have to create an import root document node. This node will be the root object for all the imported data.

./flow openimmo:import

The sourceFolder is import/ by default. The command expects *.zip file(s) in that directoy. The content will be extracted into a new directory with the same name as the zip file and the archive will be deleted after the import is done (also the deflated directory).

The command does not check the content in any way. Every zip file is expected to contain exactly one xml file.

Possible customizations

Icons and labels

Please have a look at ./Configuration/Settings.yaml. You can see how icons and labels for the different content node types may be adjusted. You have to re-generate the package files with the command below.

Templates

The fusion view for the root element is pretty basic, so will probably want to overwrite it:

prototype(Ujamii.OpenImmo:Document.OpenImmoRoot) < prototype(Neos.Fusion:Component) {
    renderer = 'Bitte eine Immobilie im Baum auswählen!'
}

If you want to adjust the renderen of the single content elements, just overwrite them as you like. All the rendering is done with the files located in Resources/Private/Fusion/Component/Molecule.

Import settings

You can customize the source directory for the import (where the zip files are located) and the default root node (by node type) to which the data will be imported.

Housekeeping

With the ./flow openimmo:clear command, all nodes of type Ujamii.OpenImmo:Document.Immobilie are removed from the content repository, which might be handy if you want to clean up.

If you like to clean up all the assets as well, you can use the builtin command ./flow media:removeunused --assume-yes --only-tags=openimmo because all the assets created during an import will have the tag openimmo.

Update code based on newer API classes

  1. Update the composer package, including dev packages AND --optimize-autoloader, otherwise the class loading will fail!
  2. ./flow openimmo:generate will fill the Configuration/ and Resources/Private/Fusion directories with new files.

License and Contribution

GPLv3

As this is OpenSource, you are very welcome to contribute by reporting bugs, improve the code, write tests or whatever you are able to do to improve the project.

If you want to do me a favour, buy me something from my Amazon wishlist.

About

NEOS CMS package for showing OpenImmo based data on a NEOS based website

Topics

Resources

License

Stars

Watchers

Forks

Languages