0

I added a new .xml file to my Resources/pages folder. Filename is called publication.xml

I added my properties and the unique key. But I can't see the name in the dropdown where i can choose the type of a new entry.

I tried to clear the cache already. What am I doing wrong?

Here is the content of my publication.xml (closing template-Tag stripped by the editor here on stackoverflow?! It's there in my code)

<?xml version="1.0" ?>
<template xmlns="http://schemas.sulu.io/template/template"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://schemas.sulu.io/template/template http://schemas.sulu.io/template/template-1.0.xsd">

<key>publication</key>

<view>ClientWebsiteBundle:templates:default</view>
<controller>SuluWebsiteBundle:Default:index</controller>
<cacheLifetime>2400</cacheLifetime>

<meta>
    <title lang="de">Publikation</title>
    <title lang="en">Publication</title>
</meta>

<properties>
    <property name="title" type="text_line" mandatory="true">
        <meta>
            <title lang="de">Titel</title>
            <title lang="en">Title</title>
        </meta>

        <tag name="sulu.rlp.part"/>
    </property>

    <property name="url" type="resource_locator" mandatory="true">
        <meta>
            <title lang="de">Adresse</title>
            <title lang="en">Resourcelocator</title>
        </meta>

        <tag name="sulu.rlp"/>
        <tag name="sulu.search.field" role="description"/>
    </property>

    <property name="tags" type="tag_list">
        <meta>
            <title lang="de">Tags</title>
        </meta>
    </property>

    <property name="images" type="media_selection">
        <tag name="sulu.search.field" role="image" index="false"/>
        <meta>
            <title lang="de">Vorschaubild</title>
            <title lang="en">Preview Image</title>
        </meta>
    </property>

    <property name="article" type="text_editor">
        <meta>
            <title lang="de">Teaser</title>
            <title lang="en">Teaser</title>
        </meta>

        <params>
            <param name="height" value="100"/>
            <param name="max_height" value="500" />
            <param name="paste_from_word" value="true"/>
        </params>
    </property>

    <section name="content">
        <meta>
            <title lang="de">Inhalt</title>
            <title lang="en">Content</title>

            <info_text lang="de">Bereich für den Inhalt</info_text>
            <info_text lang="en">Content Section</info_text>
        </meta>
        <properties>
            <block name="block"
                   default-type="editor"
                   minOccurs="0"
                   maxOccurs="125">
                <meta>
                    <title lang="de">Inhalt</title>
                    <title lang="en">Contant</title>
                </meta>
                <types>
                    <type name="headline_1">
                        <meta>
                            <title lang="de">Überschrift 1</title>
                            <title lang="en">Headline 1</title>
                        </meta>
                        <properties>
                            <property name="title" type="text_line" mandatory="true">
                                <meta>
                                    <title lang="de">Überschrift 1</title>
                                    <title lang="en">Headline 1</title>
                                </meta>

                                <tag name="sulu.content.sortmode.show"/>
                            </property>
                        </properties>
                    </type>
                    <type name="headline_2">
                        <meta>
                            <title lang="de">Überschrift 2</title>
                            <title lang="en">Headline 2</title>
                        </meta>
                        <properties>
                            <property name="title" type="text_line" mandatory="true">
                                <meta>
                                    <title lang="de">Überschrift 2</title>
                                    <title lang="en">Headline 2</title>
                                </meta>

                                <tag name="sulu.content.sortmode.show"/>
                            </property>
                        </properties>
                    </type>
                    <type name="headline_3">
                        <meta>
                            <title lang="de">Überschrift 3</title>
                            <title lang="en">Headline 3</title>
                        </meta>
                        <properties>
                            <property name="title" type="text_line" mandatory="true">
                                <meta>
                                    <title lang="de">Überschrift 3</title>
                                    <title lang="en">Headline 3</title>
                                </meta>

                                <tag name="sulu.content.sortmode.show"/>
                            </property>
                        </properties>
                    </type>
                    <type name="editor">
                        <meta>
                            <title lang="de">Texteditor</title>
                            <title lang="en">Text editor</title>
                        </meta>
                        <properties>
                            <property name="article" type="text_editor">
                                <meta>
                                    <title lang="de">Artikel</title>
                                    <title lang="en">Article</title>
                                </meta>
                            </property>
                        </properties>
                    </type>
                    <type name="image">
                        <meta>
                            <title lang="de">Bild</title>
                            <title lang="en">Image</title>
                        </meta>
                        <properties>
                            <property name="images" type="media_selection">
                                <meta>
                                    <title lang="de">Bild</title>
                                    <title lang="en">Image</title>
                                </meta>

                                <params>
                                    <param name="types" value="image,video"/>
                                    <param name="displayOptions" type="collection">
                                        <param name="leftTop" value="false"/>
                                        <param name="top" value="true"/>
                                        <param name="rightTop" value="false"/>
                                        <param name="left" value="true"/>
                                        <param name="middle" value="false"/>
                                        <param name="right" value="true"/>
                                        <param name="leftBottom" value="false"/>
                                        <param name="bottom" value="true"/>
                                        <param name="rightBottom" value="false"/>
                                    </param>
                                    <param name="defaultDisplayOption" value="top"/>
                                </params>

                                <tag name="sulu.content.sortmode.show"/>
                            </property>
                        </properties>
                    </type>
                    <type name="gallery">
                        <meta>
                            <title lang="de">Galerie</title>
                            <title lang="en">Gallery</title>
                        </meta>
                        <properties>
                            <property name="images" type="media_selection">
                                <meta>
                                    <title lang="de">Coverbilder</title>
                                    <title lang="en">images</title>
                                </meta>

                                <tag name="sulu.content.sortmode.show"/>
                            </property>
                        </properties>
                    </type>
                    <type name="video">
                        <meta>
                            <title lang="de">Video</title>
                            <title lang="en">Video</title>
                        </meta>
                        <properties>
                            <property name="video_id" type="text_line" mandatory="true">
                                <meta>
                                    <title lang="de">Youtube VideoID</title>
                                    <title lang="en">Youtube VideoID</title>
                                </meta>

                                <tag name="sulu.content.sortmode.show"/>
                            </property>
                        </properties>
                    </type>
                </types>
            </block>
        </properties>
    </section>
</properties>

Patrick
  • 1,562
  • 1
  • 16
  • 33
  • I just copied your file (with the `` at the very end), and it works for me. Which cache folder did you clear? Is there any ERROR or WARNING in the logs directory? (`/app/logs/admin//.log`) – Daniel Rotter Oct 08 '15 at 17:44
  • My /app/logs/admin//.log doesn't show any errors for the environment. (neighter for others). I cleared app/cache/admin and in my despiration the complete app/cache folder. – Patrick Dec 30 '15 at 09:09
  • 1
    Have you already implemented a html twig template ending with `.html.twig`? Only templates with an existing html template are shown in the dropdown. – Daniel Rotter Dec 31 '15 at 10:30
  • No, i did not :-) That was the missing piece for me. Thanks a lot!! – Patrick Dec 31 '15 at 11:05

2 Answers2

2

We have decided to only show the template in the dropdown if there is also a corresponding twig template in the html format. We did so, because otherwise it would be impossible to correctly show something in the live preview.

Since this seems to be a common caveat I already created a PR for the documentation

Daniel Rotter
  • 1,998
  • 2
  • 16
  • 33
0

Daniel posted the answer to my question in the comments.

Have you already implemented a html twig template ending with .html.twig? Only templates with an existing html template are shown in the dropdown.

Thanks a lot!

Patrick
  • 1,562
  • 1
  • 16
  • 33