Closed mmmykhailo closed 6 years ago
Unfortunately you're providing basically zero information about what you're trying to do.
I have page base_url/pages. I have many other pages base_url/page/page.title. I need to load every page title to make a list. They should be loaded piece by piece because there are too many pages. What more information do you need?
You can use arbitrary conditions when iterating through your pages list to filter pages in Twig templates (see https://twig.symfony.com/doc/1.x/), e.g. use something like the following in your themes/my_theme/index.twig
:
{% for page in pages %}
{% if page.author == "John Doe" %}
<h2>{{ page.title }}</h2>
{% endif %}
{% endfor %}
I'm still not sure what you're trying to do, you'll have to ask way more specific questions. Please refer to Pico's docs (http://picocms.org/docs/) for basic details about how Pico works and how to customize Pico to fit your needs. Especially take a look at the Customization section. You can find 3rd-party themes (http://picocms.org/themes/) and plugins (http://picocms.org/plugins/) on our website, and even more themes (https://github.com/picocms/Pico/wiki/Pico-Themes) and plugins (https://github.com/picocms/Pico/wiki/Pico-Plugins) in our wiki.
I did it
{% for page in pages %}
{% if page.author == "John Doe" %}
<h2>{{ page.title }}</h2>
{% endif %}
{% endfor %}
But when there are too many pages the page with the list of pages loads too long, so I want to load the list item by item after load of the page with this list...
In other words I need "SHOW MORE POSTS" button
Try the 3rd-party Pagination plugin.
Is there possible to make "show more" istead of "next"?
Please take a look at the plugin's README.md
.
I read it. I understand that it possible to make "Show more" link to next page, but I need to insert new links in the same page without reload
Then you'll have to create the appropriate JavaScript code to load a pages list using AJAX. You can create a page returning JSON by creating e.g. a themes/my_theme/pages_ajax.twig
and a small plugin to set the HTTP response's Content-Type
of this page to application/json
. Take a look at Pico's plugins/DummyPlugin.php
, http://picocms.org/development/ and the code of existing Pico plugins out there. AFAIK there's no plugin or theme using something like this yet, so you'll have to develop it on your own. If you have any concrete question while developing this please don't hesitate to ask. However, I unfortunately can't provide you with the final solution, this is up to you (or some other developer).
Thank you for try to help..
Hi, how to make page with pages that will be complementing after page load?