{"id":19614984,"url":"https://github.com/infostreams/pagelist-snippet","last_synced_at":"2025-04-28T02:31:02.187Z","repository":{"id":25702805,"uuid":"29139304","full_name":"infostreams/pagelist-snippet","owner":"infostreams","description":"A PhileCMS plugin that allows you to list or search pages on your site","archived":false,"fork":false,"pushed_at":"2017-09-05T08:32:24.000Z","size":14,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-13T05:42:00.216Z","etag":null,"topics":["filter","philecms","php","search","snippets"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/infostreams.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-12T14:30:56.000Z","updated_at":"2024-04-13T05:42:00.217Z","dependencies_parsed_at":"2022-08-21T12:20:37.779Z","dependency_job_id":null,"html_url":"https://github.com/infostreams/pagelist-snippet","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infostreams%2Fpagelist-snippet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infostreams%2Fpagelist-snippet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infostreams%2Fpagelist-snippet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/infostreams%2Fpagelist-snippet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/infostreams","download_url":"https://codeload.github.com/infostreams/pagelist-snippet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224092034,"owners_count":17254152,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["filter","philecms","php","search","snippets"],"created_at":"2024-11-11T10:54:42.111Z","updated_at":"2024-11-11T10:54:43.236Z","avatar_url":"https://github.com/infostreams.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Page list snippet\n\nA [PhileCMS](https://github.com/PhileCMS/Phile) plugin that allows you to list or search on pages\non your site. You can make a list of all pages, of pages below the current or below a certain other\npage, of pages matching a specific query (full text search!), and you can filter, sort and provide\ncustom templates for your page list.\n\nThis plugin works with the default Markdown parser, but it should also work with any of the other\nplugins that offer Markdown alternatives. It should even work if applied to regular HTML files.\n\n## Installation\n\n### With composer\n\n    php composer.phar require infostreams/pagelist-snippet\n\n### Download\n\n* Install [Phile](https://github.com/PhileCMS/Phile)\n* Clone this repo into plugins/infostreams/pagelistSnippet\n* Install the [Snippets plugin](https://github.com/infostreams/snippets) as well\n\n\n### Activation\n\nAfter you have installed the plugin and its dependencies, you need to add the following line to your config.php file:\n\n    $config['plugins']['infostreams\\\\pagelistSnippet'] = array('active' =\u003e true);\n\nYou need to have the [Snippets](https://github.com/infostreams/snippets) plugin installed and\nactivated for this to work.\n\n## How it works\nOnce you have installed this plugin, you can include a list of pages anywhere in your site by\ntyping the following code into your Markdown page:\n\n    (pagelist: all)\n\nThis would include a list of all pages on your site, using the default template.\n\n### Templates\nSince the default template is rather bare bones, you probably want to provide your own template.\n\n    (pagelist: all template:elements/pagelist)\n\nThis would style the list of pages with a custom template, provided by you. This template is much\nlike a regular (Twig) template, but it's a **partial** template, which means it will only be used\nfor a part of your page. In this template you can access the list of pages by using the `pagelist`\nvariable. For an example, have a look at the `plugins/infostreams/Templates/pagelist-default.html`\nfile.\n\nIf you want to override the default template, you can create a template called\n`pagelist-default.html` in your own theme. That will override the default template that comes with\na fresh install of the PagelistSnippet plugin, and it can be used to provide a standardized list\ntemplate for your whole site.\n\n## Available options\n\nThe first parameter can be either `all`, `below`, or `search`, or it can contain a named list of\npages.\n\n### 'all'\nList all the pages\n\n    (pagelist: all)\n\n### 'below'\nList all pages below the *current* page\n\n    (pagelist: below)\n\nList all pages below *another* page\n\n    (pagelist: below under: company/team)\n\nList all pages below another page, and include that other page itself as well:\n\n    (pagelist: below under: company/team inclusive:true)\n\n\n### 'search'\nList all pages containing the text provided in the URL (by default, in the `q` parameter):\n\n    (pagelist: search)\n\nThe search results are ordered by relevancy according to the\n[TF-IDF](https://en.wikipedia.org/wiki/Tf%E2%80%93idf) metric.\n\nYou can opt to search only a part of the site with the 'under' parameter:\n \n    (pagelist: search under: company/team)\n\nList all pages containing the text provided in the URL, but change the parameter name in which\nthis is provided to 'search'\n\n    (pagelist: search param:search)\n\nThis would make the search respond to URLs in the form `....?search=keyword` instead of the\ndefault `...?q=keyword`.\n\nPlease be aware that the mentioned TF-IDF metric is relatively simple. This is not Google.\n\n### Named pages\nYou can manually list the pages you want to include in your page list:\n\n    (pagelist: [company/team/ceo, company/team/cto])\n\n## Filtering and sorting\nYou can filter the page list based on information in the metadata. Filters are specified as an array,\ni.e. between [brackets], and support regular expressions by default.\n\nDisplay all pages below the current page that have the `project` template:\n\n    (pagelist: below filter:[template:project])\n\nDisplay all pages below the current page that have a template whose name matches the mentioned\nregular expression:\n\n    (pagelist: below filter:[template:content.*])\n\nYou can sort the resulting pages by providing an `order` parameter. The syntax for ordering\npages follows PhileCMS's syntax.\n\n    (pagelist: below\n        under: company/team\n        order: meta.surname:asc)\n\nList all team members, order them by surname, and display using a custom template:\n\n    (pagelist: below\n        under: company/team\n        order: meta.surname:asc\n        template: team-members)\n\nThis would require you to add a file named `team-members.html` to your theme.\n\nYou can hard code a full-text keyword search if you want to:\n\n    (pagelist: all\n      keyword: sales)\n\nThis would list all pages that contain the keyword 'sales'.\n\n## Combining\nYou can combine almost all the parameters listed above:\n\n    (pagelist: below\n        under: company/team\n        order: meta.surname:asc\n        template: team-members\n        filter: [tag: helpdesk]\n        keyword: europe\n    )\n\nThis would list all the pages below 'company/team' that have the 'helpdesk' tag and contain the\nkeyword 'europe', order them by surname and render them with the 'team-members.html' template.\n\n\n### Known limitations\nI **suspect** that the current implementation only works with Twig templates. I haven't tested it\nwith other templating plugins. If you managed to get it working with other plugins than Twig,\ndrop me a line or open a pull request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfostreams%2Fpagelist-snippet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finfostreams%2Fpagelist-snippet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfostreams%2Fpagelist-snippet/lists"}