Jump to content

Show more button for fields in listing layout?


komenda-1637781702

Recommended Posts

We want to add a "show more" button in the listing layout.
So at the moment when the user opens a category he will see all fields in the listing layout, but we want that he will see just a "show more" button and when he click on the button the fields will appear. We tried it with following override in listing_card_layout.thtml 

<a class="btn btn-primary" data-bs-toggle="collapse" href="#collapseExample" role="button" aria-expanded="false" aria-controls="collapseExample">
    Show more
</a>

<div class="collapse" id="collapseExample">
<div class="card card-body">
<div class="jrCardFields fwd-mt-auto">
<?php echo $CustomFields->displayAll($listing,'list','',$customFieldOptions);?>
</div>
</div>
</div>

it is working for the moment, but now when the user click on "show more" the fields appear in every listing card on the page. Would it be possible to separate this and the "Show more" button just works for the one listing card?

Bildschirmfoto 2022-02-11 um 18.38.27 copy.png

Bildschirmfoto 2022-02-11 um 18.37.58 copy.png

Link to comment
×
×
  • Create New...