Skip to content

Commit

Permalink
Add fluid templates for ToC plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
beatrycze-volk committed Apr 22, 2022
1 parent 0c62691 commit 2b78aa7
Show file tree
Hide file tree
Showing 8 changed files with 505 additions and 259 deletions.
36 changes: 25 additions & 11 deletions Resources/Private/Partials/ControlBar.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,32 @@ <h1><f:link.page pageUid="{rootPageId}" title="DFG-Viewer" class="dfgviewer-logo
</nav>
</div>

<div class="metadata-wrapper">
<div class="tx-dlf-metadata">
<f:cObject typoscriptObjectPath="plugin.tx_dlf_metadata" />
</div>
<div class="offcanvas-toggle" title="<f:translate key='metadata' extensionName='dfgviewer' />"></div>
</div>
<f:if condition="{isObject3D} == 'collection'">
<f:then>
<!-- it's a collection - no need for Metadata here! -->
</f:then>
<f:else>
<div class="metadata-wrapper">
<div class="tx-dlf-metadata">
<f:cObject typoscriptObjectPath="plugin.tx_dlf_metadata" />
</div>
<div class="offcanvas-toggle" title="<f:translate key='metadata' extensionName='dfgviewer' />"></div>
</div>
</f:else>
</f:if>

<div class="toc-wrapper">
<f:cObject typoscriptObjectPath="plugin.tx_dlf_tableofcontents" />
<div class="offcanvas-toggle" title="<f:translate key='toc' extensionName='dfgviewer' />"></div>
</div>
<f:if condition="{isObject3D} == 'collection' or {isObject3D} == 'object'">
<f:then>
<!-- it's a collection or 3D object - no need for ToC here! -->
</f:then>
<f:else>
<div class="toc-wrapper">
<f:cObject typoscriptObjectPath="plugin.tx_dlf_tableofcontents" />
<div class="offcanvas-toggle" title="<f:translate key='toc' extensionName='dfgviewer' />"></div>
</div>
</f:else>
</f:if>
</div>
</f:section>

</html>
</html>
528 changes: 280 additions & 248 deletions Resources/Private/Partials/PageView.html

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<f:comment>
<!--
* (c) Kitodo. Key to digital objects e.V. <contact@kitodo.org>
*
* This file is part of the Kitodo and TYPO3 projects.
*
* @license GNU General Public License version 3 or later.
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
-->
</f:comment>
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
data-namespace-typo3-fluid="true">

<f:for each="{children}" as="child">
<f:switch expression="{child.ITEM_STATE}">
<f:case value="ACT">
<li class="tx-dlf-toc-act">
</f:case>
<f:case value="CUR">
<li class="tx-dlf-toc-cur">
</f:case>
<f:case value="ACTIFSUB">
<li class="tx-dlf-toc-act tx-dlf-toc-ifsub">
</f:case>
<f:case value="CURIFSUB">
<li class="tx-dlf-toc-cur tx-dlf-toc-ifsub">
</f:case>
<f:case value="IFSUB">
<li class="tx-dlf-toc-no tx-dlf-toc-ifsub">
</f:case>
<f:defaultCase>
<li class="tx-dlf-toc-no">
</f:defaultCase>
</f:switch>

<f:if condition="{child.doNotLinkIt}">
<f:then>
<f:render partial="TableOfContents/Title" arguments="{child: child}"/>
</f:then>
<f:else>
<f:link.action
action="main"
pageUid="{settings.targetPid}"
additionalParams="{f:if(condition:'{child.id}', then:'{\'tx_dlf[id]\':child.id, \'tx_dlf[page]\':child.page}', else: '{\'tx_dlf[page]\':child.page}')}"
addQueryString="1"
title="{f:if(condition:'{child.title}', then: '{child.title}', else: '{child.type}')}">
<f:render partial="TableOfContents/Title" arguments="{child: child}"/>
</f:link.action>
</f:else>
</f:if>

<f:if condition="{settings.basketButton} && {settings.targetBasket}">
<span class="tx-dlf-basket-button">
<f:link.action
pageUid="{settings.targetBasket}"
action="main"
controller="Basket"
additionalParams="{'tx_dlf[addToBasket]':'toc', 'tx_dlf[logId]':child.basketButton.logId, 'tx_dlf[startpage]':child.basketButton.startpage, 'tx_dlf_basket[action]':'add', 'tx_dlf_basket[controller]':'Basket'}"
addQueryString="1">
<f:translate key="AddToBasket" />
</f:link.action>
</span>
</f:if>

<f:if condition="{child._SUB_MENU} && ({child.ITEM_STATE} == 'IFSUB' || {child.ITEM_STATE} == 'ACTIFSUB' || {child.ITEM_STATE} == 'CURIFSUB')">
<ul>
<f:render partial="TableOfContents/Children" arguments="{children: child._SUB_MENU}"/>
</ul>
</f:if>

</li>
</f:for>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<f:comment>
<!--
* (c) Kitodo. Key to digital objects e.V. <contact@kitodo.org>
*
* This file is part of the Kitodo and TYPO3 projects.
*
* @license GNU General Public License version 3 or later.
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
-->
</f:comment>
<f:form action="filter" controller="TableOfContents" name="filterParameter" method="get" class="tx-dlf-filter-form">
<label for="tx-dlf-filter-title">
Title
</label>
<f:form.textfield id="tx-dlf-filter-title" name="title" />
</f:form>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<f:comment>
<!--
* (c) Kitodo. Key to digital objects e.V. <contact@kitodo.org>
*
* This file is part of the Kitodo and TYPO3 projects.
*
* @license GNU General Public License version 3 or later.
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
-->
</f:comment>
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
data-namespace-typo3-fluid="true">

<div class="tx-dlf-toc-preview-item">
<f:link.page
pageUid="{settings.targetPid}"
additionalParams="{'id': model.urlId, 'tx_dlf[id]': model.urlXml}"
title="{f:if(condition:'{model.title}', then: '{model.title}', else: '{model.type}')}">
<span class="tx-dlf-toc-title">{model.title}</span>
<br>
<img class="tx-dlf-toc-preview-image" src="{model.image}" alt="{model.title}">
<span class="tx-dlf-toc-description">{model.description}</span>
</f:link.page>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<f:comment>
<!--
* (c) Kitodo. Key to digital objects e.V. <contact@kitodo.org>
*
* This file is part of the Kitodo and TYPO3 projects.
*
* @license GNU General Public License version 3 or later.
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
-->
</f:comment>
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
data-namespace-typo3-fluid="true">

<f:for each="{models}" as="model">
<f:if condition="{model._SUB_MENU} && ({model.ITEM_STATE} == 'HEADER')">
<f:then>
<h2>
<f:render partial="TableOfContents/Title" arguments="{child: model}"/>
</h2>
<f:render partial="TableOfContents/Filter"/>
<div class="tx-dlf-toc-preview-items">
<f:render partial="TableOfContents/Models" arguments="{models: model._SUB_MENU}"/>
</div>
</f:then>
<f:else>
<f:render partial="TableOfContents/Model" arguments="{model: model}"/>
</f:else>
</f:if>

</f:for>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<f:comment>
<!--
* (c) Kitodo. Key to digital objects e.V. <contact@kitodo.org>
*
* This file is part of the Kitodo and TYPO3 projects.
*
* @license GNU General Public License version 3 or later.
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
-->
</f:comment>
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
data-namespace-typo3-fluid="true">

<span class="tx-dlf-toc-title">
<f:if condition="{child.title}">
<f:then>
<f:format.crop maxCharacters="55" append="&nbsp;..."><f:format.htmlspecialchars doubleEncode="false">{child.title}</f:format.htmlspecialchars></f:format.crop>
</f:then>
<f:else>
<f:format.crop maxCharacters="55" append="&nbsp;..."><f:format.htmlspecialchars doubleEncode="false">{child.type}</f:format.htmlspecialchars><f:if condition="{entry.volume}"> &nbsp;<f:format.htmlspecialchars doubleEncode="false">{child.volume}</f:format.htmlspecialchars></f:if></f:format.crop>
</f:else>
</f:if>
</span>

<span class="tx-dlf-toc-pagination"><f:format.htmlspecialchars doubleEncode="false">{child.pagination}</f:format.htmlspecialchars></span>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<f:comment>
<!--
* (c) Kitodo. Key to digital objects e.V. <contact@kitodo.org>
*
* This file is part of the Kitodo and TYPO3 projects.
*
* @license GNU General Public License version 3 or later.
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
-->
</f:comment>
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
data-namespace-typo3-fluid="true">

<f:if condition="{type} == 'collection'">
<f:then>
<div class="tx-dlf-toc-preview">
<f:render partial="TableOfContents/Models" arguments="{models: toc}"/>
</div>
</f:then>
<f:else>
<div class="tx-dlf-tableofcontents">
<ul>
<f:render partial="TableOfContents/Children" arguments="{children: toc}"/>
</ul>
</div>
</f:else>
</f:if>

0 comments on commit 2b78aa7

Please sign in to comment.