Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Plugins

Related Pages for Site with Multiple Blogs

first-time

Solved by PJ Moriarty View solution

Started by PJ Moriarty 8 years ago · 1 replies · 1131 views
8 years ago

New to grav, and building a site with multiple blog collection pages. I have successfully installed/configured the related pages plugin however the filter specification restricts the returned page values to other child pages of the same parent directory. This does not precisely match my functional requirement (Cross-collection page linking). The explicit_pages: setting is a nice feature that allows me to link to posts in other collections, but it is a one-way street (meaning while I can link A-> B, I cannot link B back to A.

I my case I have news, projects, and team member collections. I'd like to link across all collections, but you can see how I might want to link projects to team member profiles and vice versa

I am wondering if anyone has any specific strategies/methods for linking related pages across collections.

  1. Is there a wild card option of the filter: @page: [target_dir] setting, one that effectively indicates inclusion of any page anywhere on the site.

  2. Has anyone tried renaming and installing the relatedpages plugin multiple times, with each configured for a separate page collection (and using the explicit page feature for cross-collection page linking).

  3. Has anyone tried to fork the master branch and custom configure for cross-collection linking?

  4. One possible option I have considered is merging all items into a single collection and leveraging the taxonomy and manual site configuration to create the appearance of separate collections, however this method introduces some other usability and navigation/UI issues I would rather avoid.

I am inclined to think that 1. is simply not a current feature, and 2. is a lighter lift than 3. Has anyone else tried any of these? Others? What is your recommended approach?

8 years ago Solution

So, I am answering my own question here, but identified a simple, sufficient solution already accounted for in the plugin.

  1. Modify that relatedpages.yaml file (line 11)
    `

page_in_filter: false

`
While the plugin will only dynamically rate page suitability and link items from a single collection, items from external collections can be manually linked. Further the disabling of the page_in_filter restriction allowed for the widget to display and function on item pages in external collections (linking back to the primary collection via page scoring, and elsewhere via manual entry of the explicit_page specification in the front matter).

This is was a critical feature I had not fully leverage in my initial go 'round.

Suggested topics

Topic Participants Replies Views Activity
Plugins · by Rene, 1 week ago
2 42 1 week ago
Plugins · by Xavier, 4 weeks ago
2 53 4 weeks ago
Plugins · by Luka Prinčič, 7 years ago
3 1179 1 month ago
Plugins · by Sebastian van de Meer, 1 month ago
1 47 1 month ago
Plugins · by PIERROT Alain, 2 months ago
3 71 2 months ago