0

Is there a way to define Relations (embed an entity) from an other type?

For example i have BlogPost and i have (already existing) other BlogPosts. I want to have a Multi-Select to define related BlogPosts.

I didn't find it in the docs.

How can i accomplish this?

Patrick
  • 1,562
  • 1
  • 16
  • 33

1 Answers1

0

i guess smartcontent should do it.

could be defined in your template like:

<property name="pages" type="smart_content">
    <meta>
        <title lang="en">Smart Content</title>
    </meta>

    <params>
        <param name="properties" type="collection">
            <param name="title" value="title"/>
            <param name="description" value="excerpt.description"/>
        </param>
        <param name="present_as" type="collection">
            <param name="one">
                <meta>
                    <title lang="en">One column</title>
                </meta>
            </param>
            <param name="two">
                <meta>
                    <title lang="en">Two column</title>
                </meta>
            </param>
        </param>
    </params>
</property>

also see the documentation: http://docs.sulu.io/en/latest/book/creating-a-basic-website/using-smart-content.html

Alexander Schranz
  • 2,154
  • 2
  • 25
  • 42
  • I saw smart-content and the corresponding documentation. I think it's exactly what i search for. But i'm not sure and didn't find in the documentation if a can limit the smart-content to a certain document type. – Patrick Sep 25 '15 at 09:41
  • Sry, that's currently not possible... Usually we build all blog posts under the same page, so you could just choose this one as parent page. If you want to select the related pages specifically, you would have to use the internal link page type. If this is what you want, I would formulate a more detailed answer. – Daniel Rotter Sep 25 '15 at 10:00
  • you could also use a smartcontent with a tag filter. tag all your blogposts with a tag 'blog' or better a specific 'blogcategory' so you can easy include related blogs. – Alexander Schranz Oct 01 '15 at 11:01