SeeToo

Dynamic formation of the "See also" block.
Packages
2
Downloads
380
Usually answers within a few days
Автор дополнения
Packages
2
Downloads
380
Usually answers within a few days
Version 1.1.1-pl
Release date 01.05.2018
Downloads 86
Views 2 766
Warning! This component requires PHP version 5.3 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 works using the pdoTools. The basis is the snippet SeeTooResources, which is a wrapper for pdoResources,so it takes all the basic parameters of this snippet.
For example. Imagine that there is a blog, with articles. At the end of each article, we need to display the «See also» block with 4 articles, which must be sorted by the number of transitions. This is the purpose of this component.
Consider the procedure for this example.

We set parameters for the articles output, as we would ask for pdoResources snippets. For example:
[[!SeeTooResources?
        &parents = `7` // Section ID with articles
        &limit = `4`
        &tpl = `article.item`
    ]]

At this stage, at each download of the article, 4 random descendants of the c section with id=7 will be displayed. By default, the parents field is 0.
Since this can cause a heavy load on the database, we can turn on the cache for 10 minutes, or for 1 hour, or for any other value:

[[!SeeTooResources?
        &cache = `1`
        &cacheTime = `3600`
        
        &parents = `7`
        &limit = `4`
        &tpl = `article.item`
    ]]

Now all articles that have the transitions number more than a certain limit, which is specified by the parameter minCount, will be displayed first, all the rest that did not reach this limit will continue to be output randomly. By default, minCount is 10. Change this value.

[[!SeeTooResources?
        &cache = `1`
        &cacheTime = `3600`
        &minCount = `20`

        &parents = `7`
        &limit = `4`
        &tpl = `article.item`
    ]]


Now, the articles where the transitions number is equal or more than 20, will be displayed first, with sorting by this number; the remaining articles, if they have not reached the output limit yet, will be output accidentally.

The transitions number is counted by the SeeToo plugin, which receives HTTP_REFERER to determine the resource from which the transition was made. You can turn it off and implement your logic.

For the convenience of this component operation managing, a SeeToo tab is added to each resource, in which a table of related resources is displayed. In this table, you can edit the transitions number, change the associated resource, delete, disable records. A convenient select from minishop2 is used to select resources.




Thread in MODX.PRO community.

1.1.1-pl (05.01.2018)

Fixed

  • Fix plugin SeeToo for nested links
  • Lexicon keys for russian language

1.1.0-pl (24.01.2017)

Added

  • Turn on/off option "useRandom" for print random resources.
  • "seetoo_exclude_where" system setting for base excluder.
  • Class "SeeTooExcluder" that use "seetoo_exclude_where" system setting for exclude resources.
  • logic for exclude resource that use in "error_page", "site_unavailable_page", "unauthorized_page" system settings.
  • logic for customize excluder class, like miniShop2 or mSearch2.

1.0.4-pl (18.09.2016)

  • Fix error finding table.

1.0.3-pl (18.09.2016)

  • Fix printing debug information into error.log
  • Added system setting for filtering resources by MIME type

1.0.2-beta (02.07.2016)

  • Fixed check remote referrer
  • Added unsigned attribute to "view" field on table "see_too_resources"

1.0.1-beta (02.07.2016)

  • Fixed error on table "see_too_resources"