heimrichhannot / contao-watchlist-bundle
This utility bundle offers a flexible watchlist for the Contao CMS.
Installs: 1 038
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 4
Forks: 0
Open Issues: 2
Type:contao-bundle
Requires
- php: ^7.4 || ^8.0
- ext-json: *
- ext-zip: *
- contao/core-bundle: ^4.9
- doctrine/dbal: ^2.10 || ^3.0
- heimrichhannot/contao-encore-contracts: ^1.0
- heimrichhannot/contao-inserttagcollection-bundle: ^1.1
- heimrichhannot/contao-twig-support-bundle: ^1.6
- heimrichhannot/contao-utils-bundle: ^2.199
- symfony/config: ^4.4 || ^5.4
- symfony/dependency-injection: ^4.4 || ^5.4
- symfony/event-dispatcher-contracts: ^1.0 || ^2.0 || ^3.0
- symfony/http-foundation: ^4.4 || ^5.4
- symfony/http-kernel: ^4.4 || ^5.4
- symfony/routing: ^4.4 || ^5.4
- symfony/translation-contracts: ^1.0 || ^2.0 || ^3.0
- dev-master
- v3.x-dev
- 3.9.2
- 3.9.1
- 3.9.0
- 3.8.6
- 3.8.5
- 3.8.4
- 3.8.3
- 3.8.2
- 3.8.1
- 3.8.0
- 3.7.1
- 3.7.0
- 3.6.0
- 3.5.0
- 3.4.0
- 3.3.1
- 3.3.0
- 3.2.0
- 3.1.5
- 3.1.4
- 3.1.3
- 3.1.2
- 3.1.1
- 3.1.0
- 3.0.2
- 3.0.1
- 3.0.0
- 2.0.0-alpha.0.6.1
- 2.0.0-alpha.0.6.0
- 2.0.0-alpha.0.5.0
- 2.0.0-alpha.0.4.1
- 2.0.0-alpha.0.4.0
- 2.0.0-alpha.0.3.0
- 2.0.0-alpha.0.2.2
- 2.0.0-alpha.0.2.1
- 2.0.0-alpha.0.2.0
- 2.0.0-alpha.0.1.0
- v1.x-dev
- 1.0.9
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- 0.1.7
- 0.1.6
- 0.1.5
- 0.1.4
- 0.1.3
- 0.1.2
- 0.1.1
- 0.1.0
- dev-feature/remove_request_bundle
- dev-feature/contao44
- dev-zip
- dev-dev
This package is auto-updated.
Last update: 2024-10-05 10:04:26 UTC
README
This utility bundle offers a flexible watch list for the Contao CMS.
Features
- add files or arbitrary contao database entities like
tl_news
ortl_member
to a watch list - watch lists can be viewed in the contao backend, as well
- ajax handling for a fluent usage (data is always kept up-to-date)
- integrating the watch list is as easy as assigning a frontend module to a layout section and adding links by using insert tags
- download the files added to a watch list as a ZIP archive
- contains clean templates without css styling and templates prepared with bootstrap 5 css classes
- share watch lists via link (also to public) and copy to clipboard
Impressions
Watch list in frontend (here: bootstrap 5 template with modal integration)
Installation & configuration
- Run
composer require heimrichhannot/contao-watchlist-bundle
and update your database. - Create a watch list config (select bootstrap 5 templates if applicable).
- Important: Assign the watch list config to your root page.
- Create a frontend module of type
watchlist
and add it to a layout area of your website so that it comes with each and every sub page. Select bootstrap 5 custom template if needed. - Identify the template you'd like to integrate a link for adding this item to the watch list. Common situations are:
ce_download.html5
ce_downloads.html5
news_full.html5
- ...
- Integrate the link for adding an item to the current watch list to any template by using inserttag or WatchlistLinkGenerator service.
Item types
A watch list in the context of this bundle can have multiple types of items:
File
: Any file in the contao file managerEntity
: Any database record (aka "entity"), e.g.tl_news
,tl_member
-> downloads aren't possible at the moment
Sharing watch lists
- Do the steps mentioned in "Installation & configuration"
- Create a target page for shared watch lists.
- In your watch list config activate the sharing feature.
- Create the list module for the share page. You have 2 options:
- For simpler needs and file-only watch lists: Create a frontend module of the type "watchlist_share_list". This module fulfills simple needs. Image watch list items are downloadable, entity items are reachable by link.
- For more complex needs (like internal areas, filtering, ...): Create a list
using heimrichhannot/contao-list-bundle and a reader
using heimrichhannot/contao-reader-bundle.
-
Activate the option
actAsWatchlistShareTarget
in the list and reader configs. -
Make sure, the
detailsUrl
in the list item template contains thewatchlist
GET parameter. For example, you could create a block for thedetailsUrl
, extend your default template and override thedetailsUrl
:{% block detailsUrl %} {{ detailsUrl }}?watchlist={{ app.request.get('watchlist') }} {% endblock %}
-
- Place the module created in the previous step on the page created in the second page.
Permission handling
A watch list is private to its owner. Who is the owner depends on the context, the watch list is used in:
Hint: As watch lists are currently not transferable from session to member, consider showing the watch list only after login. If you have no frontend login situation, you can ignore that, of course.
Insert tags
The following new insert tags are available. These take into account the translated jumpTo url and alias.
Developers
WatchlistLinkGenerator
Add the "Add to watchlist" button from your code:
use Contao\Template; use HeimrichHannot\WatchlistBundle\Generator\WatchlistLinkGenerator; function templateListener(Template $template, WatchlistLinkGenerator $linkGenerator) { $template->addButton = $linkGenerator->generateAddFileLink($template->singleSrc, $template->fileTitle); }