Я использую Sulu + Sulu / Статьи. Просто добавили свойство images в шаблон статей по умолчанию:
<?xml version="1.0" ?>
<template xmlns="http://schemas.sulu.io/template/template"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:xi="http://www.w3.org/2001/XInclude"xsi:schemaLocation="http://schemas.sulu.io/template/template http://schemas.sulu.io/template/template-1.0.xsd">
<key>article_default</key>
<view>articles/article_default</view>
<controller>SuluArticleBundle:WebsiteArticle:index</controller>
<cacheLifetime>144000</cacheLifetime>
<meta>
<title lang="en">Default</title>
<title lang="de">Standard</title>
</meta>
<tag name="sulu_article.type" type="article"/>
<properties>
<section name="highlight">
<properties>
<property name="title" type="text_line" mandatory="true">
<meta>
<title lang="en">Title</title>
<title lang="de">Titel</title>
</meta>
<params>
<param name="headline" value="true"/>
</params>
<tag name="sulu_article.article_title"/>
</property>
<property name="pageTitle" type="text_line" mandatory="true">
<tag name="sulu_article.page_title"/>
</property>
<property name="routePath" type="route">
<meta>
<title lang="en">Resourcelocator</title>
<title lang="de">Adresse</title>
</meta>
</property>
</properties>
</section>
<property name="article" type="text_editor">
<meta>
<title lang="en">Article</title>
<title lang="de">Artikel</title>
</meta>
</property>
<property name="images" type="media_selection">
<meta>
<title lang="en">Images</title>
</meta>
<params>
<param name="types" value="image,video"/>
<param name="displayOptions" type="collection">
<param name="leftTop" value="true"/>
<param name="top" value="true"/>
<param name="rightTop" value="true"/>
<param name="left" value="true"/>
<param name="middle" value="false"/>
<param name="right" value="true"/>
<param name="leftBottom" value="true"/>
<param name="bottom" value="true"/>
<param name="rightBottom" value="true"/>
</param>
<param name="defaultDisplayOption" value="left"/>
<param name="formats" type="collection">
<param name="640x960" />
</param>
</params>
</property>
</properties>
</template>
Но по моим запросам в API я не могу получить его в списке:
Я добавил поле «изображения», но оно не указано в ответе Api:
{
"articles": [
{
"id": "2dc65e7f-aa2a-4872-90c2-1d3a6efb4dbc",
"title": "Hello World",
"typeTranslation": "Article",
"changerFullName": "Adam Ministrator",
"creatorFullName": "Adam Ministrator",
"changed": "2018-01-28T04:08:57+0000",
"created": "2018-01-28T04:08:57+0000",
"authored": "2018-01-28T04:08:57+0000",
"authorFullName": "Adam Ministrator",
"published": "2018-01-28T04:08:57+0000",
"publishedState": true,
"localizationState": {
"state": "localized"},
"authorId": "1",
"creatorContactId": "1",
"changerContactId": "1"},
]
}
Спасибо за вашу помощь!
Задача ещё не решена.
Других решений пока нет …