Skip to content

Commit

Permalink
WIP: table of contents working
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Bigga committed Mar 21, 2022
1 parent 40e5e81 commit df56127
Show file tree
Hide file tree
Showing 8 changed files with 119 additions and 48 deletions.
142 changes: 105 additions & 37 deletions Configuration/TypoScript/Plugins/kitodo.typoscript
Original file line number Diff line number Diff line change
@@ -1,46 +1,71 @@
# don't use wrapInBaseClass as it breaks the layout of new DFG-Viewer >4.0
config.disableWrapInBaseClass=1
# -----------------------------------
# Map GET paramter set[] --> tx_dlf[]
# -----------------------------------

plugin.tx_dlf.useragent = {$config.useragent}

# map GET parameter set[mets] --> tx_dlf[id]
# map set[mets] --> tx_dlf[id]
[like(traverse(request.getQueryParams(), 'set/mets'), 'http*')]
plugin.tx_dlf._DEFAULT_PI_VARS.id.stdWrap.data = GP:set|mets
[END]

# map GET parameter set[image] --> tx_dlf[page]
# map set[image] --> tx_dlf[page]
[traverse(request.getQueryParams(), 'set/image')]
plugin.tx_dlf._DEFAULT_PI_VARS.page.stdWrap.data = GP:set|image
[END]

# map GET parameter set[double] --> tx_dlf[double]
# map set[double] --> tx_dlf[double]
[traverse(request.getQueryParams(), 'set/double') > 0]
plugin.tx_dlf._DEFAULT_PI_VARS.double.stdWrap.data = GP:set|double
[END]

lib.metadata = USER
lib.metadata {
userFunc = Kitodo\Dlf\Plugin\Metadata->main
excludeOther = 0
linkTitle = 1
getTitle = 1
showFull = 0
rootline = 1
separator = #
templateFile = EXT:dfgviewer/Resources/Private/Plugins/Kitodo/MobileMetadata.tmpl
}

# --------------------------------------------------------------------------------------------------------------------
# plugin configuration
# --------------------------------------------------------------------------------------------------------------------

plugin.tx_dlf {
persistence {
storagePid = {$config.storagePid}
}
view {
partialRootPaths {
10 = EXT:slub_digitalcollections/Resources/Private/Plugins/Kitodo/Partials
20 = EXT:dfgviewer/Resources/Private/Plugins/Kitodo/Partials
}
templateRootPaths {
10 = EXT:slub_digitalcollections/Resources/Private/Plugins/Kitodo/Templates
20 = EXT:dfgviewer/Resources/Private/Plugins/Kitodo/Templates
}
}
}

# --------------------------------------------------------------------------------------------------------------------
# metadata
# --------------------------------------------------------------------------------------------------------------------
plugin.tx_dlf_metadata < tt_content.list.20.dlf_metadata
plugin.tx_dlf_metadata {
pages = {$config.storagePid}
excludeOther = 0
linkTitle = 0
getTitle = 0
showFull = 1
rootline = 1
separator = #
templateFile = {$config.templateFileMeta}
settings {
excludeOther = 0
linkTitle = 0
getTitle = 0
showFull = 1
rootline = 1
separator = #
}
}

# --------------------------------------------------------------------------------------------------------------------
# pageview / workview
# --------------------------------------------------------------------------------------------------------------------
plugin.tx_dlf_pageview < tt_content.list.20.dlf_pageview
plugin.tx_dlf_pageview {
settings {
excludeOther = {$config.kitodo.excludeOther}
features =
elementId = tx-dlf-map
}
}


lib.navigation_pagecontrol = USER
lib.navigation_pagecontrol {
userFunc = Kitodo\Dlf\Plugin\Navigation->main
Expand Down Expand Up @@ -91,7 +116,20 @@ plugin.tx_dlf_pagegrid {
templateFile = {$config.templateFileGrid}
}

# --------------------------------------------------------------------------------------------------------------------
# table of contents
# --------------------------------------------------------------------------------------------------------------------
plugin.tx_dlf_tableofcontents < tt_content.list.20.dlf_tableofcontents
plugin.tx_dlf_tableofcontents {
settings {
excludeOther = 0
targetPid = {$config.kitodoPageView}
menuConf {
expAll = 1
}
}
}
plugin.tx_dlf_tableofcontentss {
pages = {$config.storagePid}
excludeOther = 0
targetPid.data = TSFE:page|uid
Expand Down Expand Up @@ -137,28 +175,58 @@ plugin.tx_dlf_tableofcontents {
}
}

plugin.tx_dlf_pdfdownloadtool {
# this file does not exist
toolTemplateFile = EXT:dfgviewer/Resources/Private/Plugins/Kitodo/toolboxPdf.tmpl
# --------------------------------------------------------------------------------------------------------------------
# Tools like imagemanipulation, fulltext and downloads eg.
# --------------------------------------------------------------------------------------------------------------------

# available tools:

# fulltexttool
# annotationtool
# fulltextdownloadtool
# imagedownloadtool
# imagemanipulationtool
# pdfdownloadtool
# searchindocumenttool

plugin.tx_dlf_toolbox < tt_content.list.20.dlf_toolbox
plugin.tx_dlf_toolbox {
settings {
# fileGrpsImageDownload = MIN,DEFAULT,MAX
}
}

plugin.tx_dlf_fulltexttool < plugin.tx_dlf_toolbox
plugin.tx_dlf_fulltexttool {
pages = {$config.storagePid}
templateFile = {$config.templateFileToolFulltext}
settings {
tools = fulltexttool
activateFullTextInitially = 0
fullTextScrollElement = html, body
}
}

plugin.tx_dlf_imagemanipulationtool < plugin.tx_dlf_toolbox
plugin.tx_dlf_imagemanipulationtool {
pages = {$config.storagePid}
templateFile = {$config.templateFileToolImageManipulation}
settings {
tools = imagemanipulationtool
}
}

# --------------------------------------------------------------------------------------------------------------------
# Audio player
# --------------------------------------------------------------------------------------------------------------------
plugin.tx_dlf_audioplayer < tt_content.list.20.dlf_tableofcontents
plugin.tx_dlf_audioplayer {
pages = {$config.storagePid}
excludeOther = 0
elementId = tx-dlf-audio
# templateFile = {$config.templateFilePage}
settings {
excludeOther = 0
elementId = tx-dlf-audio
}
}

# --------------------------------------------------------------------------------------------------------------------
# newspaper navigation
# --------------------------------------------------------------------------------------------------------------------

[getDocumentType("{$config.storagePid}") == "ephemera" or getDocumentType("{$config.storagePid}") == "newspaper"]
page.10.variables {
isNewspaper = TEXT
Expand Down
3 changes: 0 additions & 3 deletions Configuration/TypoScript/constants.typoscript
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ config {
# cat=plugin.tx_dfgviewer/links/050; type=int+; label=Kitodo Page View
kitodoPageView =

# cat=plugin.tx_dfgviewer/string/051; type=string; label=User-Agent string for HTTP requests
useragent = DFG-Viewer, https://dfg-viewer.de

# cat=plugin.tx_dfgviewer/piwik/010; type=string; label=Piwik Hostname
piwik_hostname =

Expand Down
4 changes: 2 additions & 2 deletions Documentation/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ This will install the DFG-Viewer 5.2 extension and Kitodo.Presentation 3.2 from

Install the Extension via extension manager or CLI::

www-data@localhost:/var/www/dfgviewer> ./vendor/bin/typo3 extension:activate dlf
www-data@localhost:/var/www/dfgviewer> ./vendor/bin/typo3 extension:activate dfgviewer
./vendor/bin/typo3 extension:activate dlf
./vendor/bin/typo3 extension:activate dfgviewer

During the installation, three pages will be created: a root page, the "Kitodo
Configuration" folder and the viewer itself.
Expand Down
6 changes: 5 additions & 1 deletion Resources/Private/Less/modules/sidebar.less
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,10 @@ ul.toc {
}
li {
position: relative;
.meta-type-icon {
// We have no type icons in DFG-Viewer, yet.
display: none;
}
&.submenu {
&:before {
position: absolute;
Expand Down Expand Up @@ -517,4 +521,4 @@ ul.toc {
}
}

// EOF
// EOF
2 changes: 2 additions & 0 deletions Resources/Private/Partials/PageView.html
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ <h2><f:translate key='browser-hint.outdated_browser' extensionName='dfgviewer' /
</li>
</f:else>
</f:if>
<f:comment>
<f:cObject typoscriptObjectPath="plugin.tx_dfgviewer_uri" />
</f:comment>
</ul>
</li>
<li class="submenu downloads">
Expand Down
2 changes: 1 addition & 1 deletion Resources/Public/Css/allStyles.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Resources/Public/Css/allStyles.css.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
],
"license": "GPL-3.0-or-later",
"require": {
"typo3/cms-core": "~9.5.31",
"kitodo/presentation": "~3.3.4|dev-master",
"slub/slub-digitalcollections": "^2.1"
"typo3/cms-core": "~9.5.31|^10.4",
"kitodo/presentation": "^4.0|dev-master",
"slub/slub-digitalcollections": "^2.1|dev-master"
},
"autoload": {
"psr-4": {
Expand Down

0 comments on commit df56127

Please sign in to comment.