Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible conflict with a particular config on Related Pages plugin #22

Closed
paulmassen opened this issue Jul 15, 2016 · 2 comments
Closed

Comments

@paulmassen
Copy link

Hi,
It seems like sitemap can not be generated when related pages plugin is set with @self.siblings whereas it works with @self or @taxonomy.
I got the message Call to a member function children() on null.

Here is my config:
Related pages v1.1.3
Sitemap v1.6.2
Grav v1.1.0 - Admin v1.1.1
(Had the same problem with Grav v1.0.10)

Page.php

                            break;
                        case 'all':
                            $results = $this->children();
                            break;
                        case 'parent':
                            $collection = new Collection();
                            $results = $collection->addPage($this->parent());
                            break;
                        case 'siblings':
                            $results = $this->parent()->children()->remove($this->path());
                            break;
                        case 'descendants':
                            $results = $pages->all($this)->remove($this->path())->nonModular();
                            break;
                    }
                }

                $results = $results->published();
                break;

Here is the yaml just in case:

enabled: true
limit: 3
show_score: false
score_threshold: 20
filter:
  items: '@self.siblings'
  order:
    by: date
    dir: desc
page_in_filter: false
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: true

And obviously the yaml for sitemap:

enabled: true
route: '/sitemap'
ignores:
  - /blog/blog-post-to-ignore
  - /ignore-this-route
@flaviocopes
Copy link
Contributor

Replicated the issue.

The Related Pages plugin should really have a configuration option to be enabled only on some routes (e.g. on /blog and children) and not simply run on every page.

@flaviocopes
Copy link
Contributor

Fixed by core Grav commit getgrav/grav@07beafc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants