Coder Social home page Coder Social logo

Comments (6)

michaelkubina avatar michaelkubina commented on June 23, 2024 1

You are right, i am sorry! I have mistaken a local adjustment as part of the actual branch. You are right, there is no currentCollection in any branch. If you want to output the collection information, then you need to pass the already resolved collection(s) to your view in the ListViewController.php

$this->view->assign('currentCollection', $collection);

Then call it in the template as i stated above...

If you consider it an expected feature, it would be worth discussing if it should be an option in the listview-plugin.

from kitodo-presentation.

BFallert avatar BFallert commented on June 23, 2024 1

Thanks a lot! That helped me!

For me, it would be an expected feature of the ListView plugin.

It would be a simple straightforward way to display the data entered to a collection. I can put together a PR, then feel free to discuss it there.

from kitodo-presentation.

michaelkubina avatar michaelkubina commented on June 23, 2024

The Listview-Controller provides such information via the currentCollection object. In the code it is even assigned to the view, but from what i see it does not get applied anywhere in the template (\Resources\Private\Templates\ListView\Main.html) by default.

It would be required add something like the snippet shown below to the template - but with a lot collections this information block might grow huge. And of course it needs to be styled in your CSS somehow.

I can only speak for certain that it works for the current master branch (not the last release). The current master has already the changes to the collection-plugin that i wrote. This being said i am not sure if the last release already returned a list of collections or just a single item. There were several severe bugs, that made collections not reliable or functional back then.

\Resources\Private\Templates\ListView\Main.html

...
            <f:for each="{currentCollection}" as="currentCollectionItem">
                <div class="collection">
                    <div class="collection-label">
                        <f:if condition="{currentCollectionItem.thumbnail}">
                            <f:image image="{currentCollectionItem.thumbnail}" />
                        </f:if>
                    <div>
                    <div class="collection-thumbnail">
                        <f:if condition="{currentCollectionItem.label}">
                            {currentCollectionItem.label}
                        </f:if>
                    </div>
                    <div class="collection-description">
                        <f:if condition="{currentCollectionItem.description}">
                            {currentCollectionItem.description}
                        </f:if>
                    </div>
                </div>
            </f:for>
...

from kitodo-presentation.

BFallert avatar BFallert commented on June 23, 2024

I am working with the 4.x branch, but currentCollection does not exist.
currentCollection is not found anywhere in the source code?
Main-Branch and 4.x do not differ significantly.
Have your changes been incorporated elsewhere?
Am I looking in the wrong place?

from kitodo-presentation.

BFallert avatar BFallert commented on June 23, 2024

Just a few small corrections in case someone wants to use this as example

...
            <f:for each="{currentCollection}" as="currentCollectionItem">
                <div class="collection">
                    <div class="collection-thumbnail">
                        <f:if condition="{currentCollectionItem.thumbnail}">
                            <f:image image="{currentCollectionItem.thumbnail}" />
                        </f:if>
                    </div>
                    <div class="collection-label">
                        <f:if condition="{currentCollectionItem.label}">
                            {currentCollectionItem.label}
                        </f:if>
                    </div>
                    <div class="collection-description">
                        <f:if condition="{currentCollectionItem.description}">
                            <f:format.html>{currentCollectionItem.description}</f:format.html>
                        </f:if>
                    </div>
                </div>
            </f:for>
...

from kitodo-presentation.

sebastian-meyer avatar sebastian-meyer commented on June 23, 2024

There are two different templates for the ListView in Kitodo.Presentation:

  • Resources/Private/Templates/ListView/Main.html
  • Resources/Private/Templates/Collection/List.html

The former is used as a default for any kind of list, that does not have its own template assigned. This template does not contain any information about collections.
The latter is used when ListView is called from within the Collection controller. This template handles collection information assigned by the Collection controller and displays those above the result list.

(At least this is how it should be working. If it's not, that's a bug...)

from kitodo-presentation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.