getgrav / grav-plugin-relatedpages

Grav RelatedPages Plugin
http://getgrav.org
MIT License
17 stars 7 forks source link

Plug-in doesn't collect any data #26

Open 01Kuzma opened 4 years ago

01Kuzma commented 4 years ago

Hello! Having troubles trying to make working the Related Pages plug-in. I want to display related pages on each page, but there is no any information...

The page has been translated to Lithuania language, but this doesn't make sense. The page is running under Gantry 5 framework.

I've this page's structure:

Main services page

/paslaugos -> default

    First Service
    /paslaugos/krastovaizdzio-projektavimas -> modular

        Second service
        /paslaugos/krastovaizdzio-projektavimas/_intro -> modular/services

    ... 

    N-th Service
    /paslaugos/nth-service -> modular

        Second service
        /paslaugos/nth-service/_intro -> modular/services               

In services.html.twig template I've put this code:

{% if config.plugins.relatedpages.enabled and related_pages|length > 0 %}
    <h4>Related Posts</h4>
    {% include 'partials/relatedpages.html.twig' %}
{% endif %}

Plugin's settings:

enabled: true           
limit: 5                
show_score: true        
score_threshold: 20     
filter:                 
    items:
        @page: /paslaugos
    order:
        by: date        
        dir: desc       
page_in_filter: true    
explicit_pages:
    process: true       
    score: 100          
taxonomy_match:         
    taxonomy: tag       
    taxonomy_taxonomy:
        process: true   
        score_scale:    
            1: 50
            2: 75
            3: 100
    taxonomy_content:
        process: true   
        score_scale:    
            1: 20
            2: 30
            3: 45
            4: 60
            5: 70
            6: 80
            7: 90
            8: 100
content_match:          
    process: false      

And this is debug info:

Grav v1.6.26
infoEnvironment Name: localhost
infoConfiguration reloaded and cached.
infoGantry theme g5_helium selected
infoCache: [false] Setting: [auto] Driver: [file]
infoRelatedPages Plugin cache miss. Rebuilding...
infoSelecting outline (rules, matches, scores):
info

array:3 [
  "page" => array:1 [
    0 => array:1 [
      "paslaugos/krastovaizdzio-projektavimas" => 3
    ]
  ]
  "language" => array:1 [
    0 => array:1 [
      "lt" => 1
    ]
  ]
  "type" => array:1 [
    0 => array:1 [
      "modular" => 2
    ]
  ]
]

info[]
info[]
infoUsing Gantry outline default
infoRouted to page /services/krastovaizdzio-projektavimas (type: modular)
debugCaching particle logo-9608
debugCaching particle social-3171
debugCaching particle logo-9571
debugCaching particle copyright-1736
debugCaching particle horizontalmenu-9034
debugCaching particle totop-8670
debugCaching particle mobile-menu-5697

Plug-in doesn't collect any data...

csbrny commented 4 years ago

I'm having the same issue. I implemented this plugin when I launched my site. However, it stoped working on the recent pages. The old pages still have results. I don't know how to check why it has 0 results. The page https://www.amerikabajottunk.hu/blog/2020/jegkocka-es-legkondi collects the maximum of 4 post. The next which I posted https://www.amerikabajottunk.hu/blog/2020/tomegkozlekedes has 3, the following post https://www.amerikabajottunk.hu/blog/2020/covid has 1 (sometimes 2), and this post https://www.amerikabajottunk.hu/blog/2020/glencairn-garden has no related posts at all like the others I posted afterwards.

01Kuzma commented 4 years ago

It's pity, that some vital plug-in's doesn't get support. In such way Grav becomes a very specific CMS for a professional developers who could make their own implementations

hdwebpros commented 3 years ago

I had the same issue. Somehow, I got the plugin to save the config file in a way that didn't work. When I started to revert the config file closer to the example, it started to work.

I have a feeling it had to do with how

filter:
  items:
    @page:

Was saved. Perhaps try checking there first?

01Kuzma commented 3 years ago

hdwebpros, thank you for your answer! I've already tried numerous times different combinations, but it seems that it doesn't support modular structure or non-default structure. No one from dev's doesn't comment this...

hdwebpros commented 3 years ago

It's probably safe to assume it just supports full pages for now and not modular. I know the Grav team is busy getting version 1.7 ready for release.

One thing I noticed is that you may need to be specific in the folder. Maybe instead of trying the root folder of

/paslaugos

You could try using

/paslaugos/krastovaizdzio-projektavimas

and see if that works.

01Kuzma commented 3 years ago

Ah, /paslaugos/krastovaizdzio-projektavimas didn't helped. Its seems that you are right, it doesn't support modular pages. Will wait for possible updates...