Packages
45
Downloads
23 571
Usually answers within 24 hours
Автор дополнения
Packages
45
Downloads
23 571
Usually answers within 24 hours
Version 3.0.11-beta
Release date 09.08.2024
Downloads 2 785
Views 3 528
Warning! This component requires PHP version 5.6 or higher! If your site uses PHP less than required, the installation of this package could break it.
Warning! This package requires MODX not less than 2.3 !
The component implements the following functional: a favorites list, adding / removing resources to favorites, forming a favorites list



  • work with any resources
  • work with any users

The main difference from earlier versions — the work without any snippets, you just need to initialize the script.
Interactive examples are here.


Basic


You can use msFavorites anywhere on the page. To do this, you need to connect the snippet
msFavorites.initialize, specify the required call parameters for the required elements.

data-msfavorites-mode — operation mode,
list — favorites list, this mode deletes the favorite item
data-data-list — favorites list, for example default
data-data-id — processed resource identifier


Features


The favorites list works for all users. For authorized users, the user id serves as an identifier, session id for an unauthorized. A flag temporary is assigned to selected anonymous users, the creation mark is placed, and you can also set the life interval (number of days).





msFavorites connecting


Insert a call to the snippet msFavorites.initialize in a convenient place on the site template.


[[!msFavorites.initialize]]


msFavorites settings


The main settings for msFavorites are System Settings -> msFavorites



front_css — styles of the frontend
front_js — frontend scripts
clear_temporary — clear temporary lists


FAV lists


You can use the msFavorites.ids snippet to get a list of resources in your favorites.



[[!msFavorites.ids?&list=`default`]]

list — list of favorites name

The snippet also specifies placeholders of the form
[[!+msfavorite.list.default]]
			[[!+msfavorite.total.default]]

msfavorite.list.default — list of resources in the selected default
msfavorite.total.default — total number of resources in the selected default



Examples


Example 1
Setting:
— you want to display a list of favorites
— to add a resource from the favorites list default
— to display the total number counter in favorites

Call:
<div id="pdopage">
			<div class="rows">
			[[!pdoPage?
			&parents=`0`
			&element=`msProducts`
			&tpl=`@INLINE
			<a class="msfavorites"
			data-click
			data-data-id="[[+id]]"
			data-data-list="default">
			<i class="msfavorites-icon-heart"></i>
			</a>
			<span class="msfavorites-total" data-data-list="default">0</span>
			[[+pagetitle]]
			`
			&ajaxMode=`default`
			]]
			</div>
			[[!+page.nav]]
			</div>

Result:





Example 2
Setting:
— you want to display a list of favorites
— to delete a resource from the favorites list default
— to display the total number counter in favorites

Call:
<div id="pdopage">
			<div class="rows">
			[[!pdoPage?
			&parents=`0`
			&element=`msProducts`
			&resources=`[[!msFavorites.ids]]`
			&tpl=`@INLINE
			<div class="msfavorites-parent">
			<a class="msfavorites"
			data-click
			data-data-id="[[+id]]"
			data-data-list="default"
			data-msfavorites-mode="list">
			<i class="msfavorites-icon-heart"></i>
			</a>
			<span class="msfavorites-total" data-data-list="default">0</span>
			[[+pagetitle]]
			</div>
			`
			&ajaxMode=`default`
			]]
			</div>
			[[!+page.nav]]
			</div>

Result:


3.0.11 beta (05.09.2024)

  • Change share method [msfMethodShare]
  • Change share [msFavorites.ids] snippet

3.0.10 beta (05.09.2024)

  • Fix [msFavorites.objects] snippet
  • Fix default.js [js]

3.0.9 beta (07.04.2024)

  • Fix isAjax [msFavorites]
  • Add share method [msfMethodShare]
  • Add share [msFavorites.ids] snippet

3.0.8 beta (04.04.2024)

  • Add XSS cleanup [msFavorites]

3.0.7 beta (04.04.2024)

  • Fix Reflected XSS [msFavorites]
  • Fix DOMNodeInserted [js]

3.0.6 beta (24.02.2021)

  • Change "msfEvent" [msFavorites]

3.0.4 - 3.0.5 beta (08.01.2020)

  • Change "event:CONTENT_CHANGE" [js]

3.0.3 beta (07.08.2019)

  • Fix "processMethod" [msFavorites]
  • Fix "isAjax" [msfEvent]

3.0.2 beta (17.07.2019)

  • Change "msfEventOnWebLogin" [msfEvent]
  • Change "event:CONTENT_CHANGE" [js]
  • Change "loadFavorites" [js]

3.0.1 beta (08.07.2019)

  • Add "msfEventOnWebPageInit" [msFavorites]

2.1.17 beta (26.06.2019)

  • Change "processFavorites" [msFavorites]
  • Add "processResourceFavorites" [msFavorites]

2.1.16 beta (21.06.2019)

  • Change "processResource" [msFavorites]

2.1.15 beta (17.01.2019)

  • Add "animation" to "methodActions" [js]

2.1.14 beta (18.11.2018)

  • Fix "msFavorite" index

2.1.13 beta (13.04.2018)

  • Add "visible" cls [js]

2.1.12 beta (22.03.2018)

  • Improved "updateFavorites" [js]

2.1.10 beta - 2.1.11 beta (21.03.2018)

  • Fix "updateFavorites" [js]

2.1.10 beta (21.03.2018)

  • Fix "updateFavorites" [js]

2.1.9 beta (06.03.2018)

  • Add "star" icon [css]

2.1.8 beta (19.02.2018)

  • Change "updateFavorites" [js]

2.1.7 beta (16.02.2018)

  • Add "stat" [msFavorites]

2.1.6 beta (12.02.2018)

  • Fix "updateFavorites" [js]

2.1.5 beta (27.01.2018)

  • Fixed possible E_NOTICE [msFavorites]

2.1.4 beta (18.12.2017)

  • Change "getFavoritesList" [js]
  • Change "getFavoritesOutput" [msFavorites]
  • Fix "frontCss" key

2.1.3 beta (17.11.2017)

  • Add "getFavoritesOutput" [msFavorites]
  • Add "totalUser" selector [js]

2.1.2 beta (24.10.2017)

  • Change "msFavoritesMultipleProcessor" processor

2.1.1 beta (19.10.2017)

  • Change "methodActions" [js]

2.1.0 beta (19.10.2017)

  • Add "msFavoritesOnBeforeProcessFavorites", "msFavoritesOnProcessFavorites" event

2.0.15-beta (04.10.2017)

  • Improved "methodActions" [js]

2.0.14-beta (14.09.2017)

  • Change "prepareResponse" [msFavorites]

2.0.13-beta (14.09.2017)

  • Change "initialize,runProcessor" [msFavorites]

2.0.12-beta (10.09.2017)

  • Fix "processAction" [js]

2.0.11-beta (07.09.2017)

  • Add "actionFormSubmit, actionFormChange" [js]

2.0.10-beta (07.09.2017)

  • Add "clear" [js]

2.0.9-beta (21.08.2017)

  • Add "sortby" [getFavorites]

2.0.8-beta (31.07.2017)

  • Add "totalAll" selector [js]

2.0.7-beta (17.07.2017)

  • Fix "updateFavorites" [js]
  • Add "PROCESS_ACTION" event [js]

2.0.6-beta (21.06.2017)

  • Fix "description" snippet

2.0.5-beta (21.06.2017)

  • Fix "window load" [js]

2.0.4-beta (07.06.2017)

  • Add style for "load, add, remove" [css]

2.0.3-beta (04.06.2017)

  • Remove "OnWebLogin" event

2.0.2-beta (31.05.2017)

  • Fix "getFavorites" [msFavorites]

2.0.1-beta (26.05.2017)

  • Add "reload page" to list

2.0.0-beta (23.05.2017)

  • Initial

msFavorites 1.1.10 (28.11.2016)

  • Add "msfavorites_action" trigger [js]

msFavorites 1.1.8 (25.11.2016)

  • Add "parseChunk" method

msFavorites 1.1.7 (24.11.2016)

  • Add "getChunk" method

msFavorites 1.1.6 (21.04.2016)

  • Reformate code
  • Add "ModPNotify"

msFavorites 1.1.5 (31.01.2016)

  • Fix favorites for multiple lists

msFavorites 1.1.4 (28.01.2016)

  • Fix delete and unpublish favorites

msFavorites 1.1.2 - 1.1.3

  • Fix favorites link

msFavorites 1.1.1

  • Add EN lexicon

msFavorites 1.1.0

  • Full refactoring. Only a fresh installation.

msFavorites 1.0.1 (21.09.15)

  • Improved default javascript. Now you can use html tags in add\remove links.

msFavorites 1.0.0 (18.09.15)

Improved installation script for MODX 2.4.

msFavorites 0.0.9 (17.02.15)

  • add the favorites panel (by Lev V.)

msFavorites 0.0.8 (19.01.15)

  • add snippet msfGetCount

msFavorites 0.0.7

  • add properties
  • add snippet msfProducts

0.0.6-beta (27.10.2014):

  • fix mysql.schema.xml
  • fix count in favorites list