Git Product home page Git Product logo

Comments (6)

alexander-schranz avatar alexander-schranz commented on July 26, 2024 1

Example implementation can be found here: sulu/ExampleNewsBundle#14

from sulu-docs.

SalvatorePollaci avatar SalvatorePollaci commented on July 26, 2024

Any updates on this?
Thank you

from sulu-docs.

danrot avatar danrot commented on July 26, 2024

No, there are no updates until now...

from sulu-docs.

cioddi avatar cioddi commented on July 26, 2024

Can you hint us on a sample implementation of a simple custom content type.
Or which classes, template and config files are required to get it done and how to correctly register it to the sulu cms system.

If I look at SingleInternalLink (choose it to avoid naming collisions when searching through the whole project). I can find the following files:

  • vendor/sulu/sulu/src/Sulu/Bundle/ContentBundle/Content/Types/SingleInternalLink.php // Content type class that extens Sulu\Component\Content\SimpleContentType
  • vendor/sulu/sulu/src/Sulu/Bundle/ContentBundle/Resources/public/js/components/single-internal-link/main.js // A class that handles some sulu admin form field behaviours, in this case the link selection. This is (seems to be) not necessarily required for any fieldtype, but probably useful in many "custom content type" use cases.
  • vendor/sulu/sulu/src/Sulu/Bundle/ContentBundle/Resources/config/content_types.xml // This seems to be needed to register the content types

from sulu-docs.

wachterjohannes avatar wachterjohannes commented on July 26, 2024

There are 4 points you have to do.

  1. Create a tagged service (sulu.content.type) which implements the ContentTypeInterface or extend SimpleContentType.
  2. Create an aura-component which implements the UI for the ContentType (see vendor/sulu/sulu/src/Sulu/Bundle/ContentBundle/Resources/public/js/components/single-internal-link/main.js)
  3. Create a data-type (see vendor/sulu/sulu/src/Sulu/Bundle/ContentBundle/Resources/public/js/validation/types/singleInternalLink.js)
  4. Create a template (see vendor/sulu/sulu/src/Sulu/Bundle/ContentBundle/Resources/views/Template/content-types/single_internal_link.html.twig) which starts the component.

from sulu-docs.

niklasnatter avatar niklasnatter commented on July 26, 2024

An example implementation for Sulu 2.0 is available in the sulu-demo repository: sulu/sulu-demo#66

from sulu-docs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.