Skip to content

Commit

Permalink
Add article test template setup
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-schranz committed Aug 8, 2024
1 parent aa02c49 commit b3b161e
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 7 deletions.
55 changes: 48 additions & 7 deletions Tests/Application/config/templates/articles/article.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,56 @@

<key>article</key>

<view>::article</view>
<controller>SuluWebsiteBundle:Default:index</controller>
<cacheLifetime>2400</cacheLifetime>
<view>templates/articles/article</view>
<controller>Sulu\Bundle\ContentBundle\Content\UserInterface\Controller\Website\ContentController::indexAction</controller>
<cacheLifetime>604800</cacheLifetime>

<tag name="sulu_article.type" type="blog"/>
<meta>
<title lang="en">Article</title>
<title lang="de">Artikel</title>
</meta>

<properties>
<property name="title" type="text_line"/>
<property name="routePath" type="route"/>
<property name="article" type="text_area"/>
<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.rlp.part"/>
<tag name="sulu.search.field" role="title"/>
</property>

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

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

<property name="description" type="text_area">
<meta>
<title lang="en">Description</title>
<title lang="de">Beschreibung</title>
</meta>

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

<property name="image" type="single_media_selection">
<meta>
<title lang="en">Image</title>
<title lang="de">Bild</title>
</meta>

<tag name="sulu.search.field" role="image"/>
</property>
</properties>
</template>
7 changes: 7 additions & 0 deletions Tests/Application/templates/views/articles/article.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{% extends 'views/base.html.twig' %}

{% block content %}
<h1>{{ content.title }}</h1>

{{ content.article|raw }}
{% endblock %}
11 changes: 11 additions & 0 deletions Tests/Application/templates/views/base.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!doctype html>
<html lang="{{ app.request.locale|replace({'_': '-'}) }}">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<title>{{ content.title }}</title>
</head>
<body>
{% block content %}{% endblock %}
</body>
</html>

0 comments on commit b3b161e

Please sign in to comment.