Comments (4)
Here is a way that you can do it just with twig:
{% for page in pages %}
{# if the myfolder string is in the url then its in content/myfolder #}
{% if "myfolder" in page.url %}
<a href="{{ page.url }}">{{ page.title }}</a>
{% endif %}
{% endfor %}
If that isnt quite what you are looking for, you can write a small PHP script to read all the .md
files in the directory. Then use the phileTwigFilters plugin to add that array of files into a twig variable.
You can also use a custom meta, since Phile supports custom meta without any plugins.
{% for page in pages %}
{# if the myfolder string is in the url then its in content/myfolder #}
{% if page.meta.folder == "myfolder" %}
<a href="{{ page.url }}">{{ page.title }}</a>
{% endif %}
{% endfor %}
Keep in mind that http://mysite.com/myfolder
url in Phile actually points to mysite/content/myfolder/index.md
. So it shouldn't be a huge hassle to come with with a solution for your problem. The first option I gave is the one that I have used before.
from phile.
Thank you very much for this precise answer, I'm gonna try this, I'm pretty sure it does the trick. Thanks 👍
from phile.
Thanks. The first solution will actually work on Pico as well. Its just some basic Twig code. But I encourage you to give Phile a try. We built it because we were upset at the lack of maintenance and support in Pico.
from phile.
Yep I did, I've switched to Phile for my current project. Custom meta out of the box are awesome ! I did a quick benchmark and indeed Phile is faster. Good to see someone is taking care of the great idea Pico came up with.
And thanks for the nice support !
from phile.
Related Issues (20)
- Internal Server Error [SOLVED] HOT 1
- Removing subfolders from links with htaccess HOT 3
- Phile plugins don't install properly using composer HOT 2
- Error when symlinking content directory HOT 2
- [TASK] Release 1.8
- [TASK] Put up phile homepage again HOT 1
- Proposal for further core refactoring HOT 1
- [FEATURE] Set error page as config setting
- [BUG] "composer create-project --no-dev phile-cms/phile" doesn't allow further composer usage
- [FEATURE] Update minimum PHP requirement to version 7.1.0
- [FEATURE] Don't use file cache out of the box HOT 3
- Missing some documentation and project status? HOT 1
- PHP 7.4+ deprecates array_key_exists() on objects HOT 1
- Twig variables HOT 1
- help on contact form plugin HOT 1
- Overriding vendor michelf/php-markdown
- PHP 8 HOT 15
- PHP 8/Phile 2 - Plugin Updates Status & Requests
- Pages without meta block are rendered empty
- PHP 8.2 dynamic properties ErrorException
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phile.