-
-
Notifications
You must be signed in to change notification settings - Fork 616
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
Show (grand)parent-page title #627
Comments
Hi there. 👋🏻 There's no The simplest way would probably be to use the
We also need the I'm not 100% solid on the usage of My first solution was a lot more hacky. I'm more confident in saying "this will definitely do what you asked" about this one... but I'm also confident that it's a lot more hacky, lol. 😂
Here we're taking the (Obviously, if you knew where you were keeping your page, either Anyway, try the Let me know if this helps and don't be afraid to ask any other questions you might have. 😁 |
@mayamcdougall , I'm the owner of dogvalley.be, build on top of another flatfile cms (automad), but i will rebuild dogvalley, and will test if picocms is a good 'candidate' for my requirements. I love the pico-simplicity, the extenable-possibilities (plugins), and the easy way integrate my own theme. Okay, but i asking some 'technical-things' in another issue soon. PS: sorry for my poor english. Christophe |
UPDATE: adding also the url, so now i have a link to the grandparent-page :)
|
Glad it's working for you. 😁 Just let me know if you have any other questions. 😉 Btw, if you're using that in multiple places, you can save it as a variable to make things either too.
@PhrozenByte, even though this issue is "solved", could you still let me know about that |
Thanks for the extra tip! :-) |
@mayamcdougall, the By the way: The "actual" description of what the parameters mean can be found in the class docs. It's a rather technical description. I very much like the In the future (whenever...) we might make tree traversal way easier by introducing page object keys to specifically access the respective parent or child pages. |
I think the most confusing thing about I think the class docs make my point well right here:
I wonder if it would be better to actually mention this math somewhere in the in-depth doc, because actually knowing what each number means (instead of explaining with only words and examples), could make it more predictable to use (for some people anyway... numbers make my head spin. 😂 ) But anyway, it sounds like my intuition was right with this, and I just wanted a little more confidence that my suggestion above was going to continue to behave as expected no matter the environment. I didn't have a lot of pages in my test (using the sample-docs, plus an added depth level), and I didn't want to set @ctuxboy up for failure if this wasn't the correct usage of I was going to write out a list of definitions here for each parameter, as I understood them, to make sure I had it down... Then I realized you already have the perfect definition underneath the over-explained paragraphs!
👆🏻 THIS should be on the in-depth page. This is what we should lead with! 😂 The paragraphs can come afterward (not in the PHPDocs, I get why it comes first there, just on the in-depth page). I know you probably think this is the more technical explanation, but these simple one-line parameter descriptions are actually perfect. 😍 The Do I need It's one of those things that I've meant to figure out how it works... when I have time... which never happens... etc. But those couple lines of parameter definitions? They are WAY more understandable than the thick metaphors you wrote for the in-depth page! I really mean no offense there... (😅) your metaphors on that page are good metaphors, but I think they drag out the definition a bit much. The comparisons themselves are good, but they might actually be overcomplicating things. It's asking the reader to juggle both the metaphor and what it means for the underlying function in their head. As I've learned with the bits of the docs I've rewritten, simpler is always better. And that means fewer words too, not just simpler language. Too much padding can be just as much of a problem as too much information! Alright, enough of this rant. Thanks for unintentionally pointing me where I needed to go with the class docs. 😂 If I think about this anymore right now, I'm going to end up rewriting the existing in-depth page today, lol. And while that'd be a good thing, I've really got other priorities to address (plus, it would be better served for the proper rewrite). 😅 Thanks again. ❤️ |
That's more due to the fact that
It will 👍
None taken. I already said that I don't think that it ended up well 😝
Looking forward to it! 👍 ❤️
😆 😉 👍 |
I know that much, lol. I said as so when I suggested it. 👆🏻😉 I just didn't know if I ever had to worry about I wrote that part of my comment earlier though, and looking at the descriptions again, it sounds like "offset" really will only ever return one page unless a
I said I wasn't going to do that right now. 😂 Though I still have to emphasize how much those short descriptions help with understanding |
Another explanation just came to my mind I wanna share. You might wanna use it for your rewrite - or not, no hard feelings if you don't, I leave this totally up to you 😉 The following pages are given:
Think about pages in generations. Let's represent every generation by a single character: A is for Now think about the The Let's talk about However, Let's get back to our original example: The main menu. How do we create the main menu? We use |
I think that's a much better example than what's on in-depth right now. I'd still start with the definitions, but together with this explanation, I think it would be in pretty good shape. I like that this explanation focuses more on explaining how and why I think that's another reason the current version is hard to read. It tries to force you to imagine a bunch of situations where you'd want specific examples, rather than just explaining how Maybe I will just throw together a quick update for the in-depth page then... 🤔 Also, I thought of this visualization earlier, which could work (though I might make it a graphic instead of just some ASCII art):
|
And sorry to @ctuxboy if you're getting notifications for all these tangentially-related discussion comments. 😅 As I said before, don't be afraid to ask any other questions if you have them, and/or don't be afraid to open a New Issue with them if you'd like to get away from this discussion and ask something. 😂 |
I'll think about whether we can add
Thinking about it we should probably make this the default... We will still support |
@mayamcdougall , @PhrozenByte , |
I'm not actually sure that it needs to change. The parameter names fit well enough... they just need better explanations. Between the short descriptions and the little ascii diagram, I think it's actually really approachable now. 😳
That's why we like Pico too. 😉 I'm not a PHP programmer either, and you'd be amazed the stuff you can do in Pico with just some clever Twig code. In addition to the Default Theme, you can check out my recent Freelancer and Stellar theme ports, for some interesting Twig examples.
Yes, one (minor) shortcoming Pico has is scalability, due to the fact that everything is done on-the-fly, without caching. You might have seen this mentioned recently in #624 if you've been looking through the issues. Fortunately, we're just talking about a few extra milliseconds in most cases. And of course the You might also notice that a lot of the older Pico themes don't use the Pico might take a little more work to get going than other CMSs, but the extra control and flexibility you get is well worth it. You can do just about anything with Pico if you're willing to put in the time. 😉 |
Okay nice , i have the idea choosing the perfect cms :-)) Thanks for sharing your themes, can help a lot find how is the best way implement some code (snippets). |
An important thing to remember is that just because you can put HTML in your Markdown, doesn't really mean you should. It's more meant for an occasional snippet here and there, when there's something small that you can't quite do in pure Markdown. So, this issue of having the HTML slow things down isn't something you should normally encounter anyway.
Yep. I try to stay away from WordPress if I can. I've helped people with it too, but I'm far from an expert. Theming WordPress seemed FAR too complicated to ever bother with. And that's, of course, why I like Pico so much. You can use as much of as little of it as you want, and the rest is just HTML! Lately I've been comparing Pico to just being "glue" that "binds together Markdown, Yaml, Twig, and HTML/CSS". As long as you're familiar with those four things, there's not much else to it. Pico just stays out of your way. It acts as a bridge between those technologies, and then lets you do whatever you want with them. 😁 |
@mayamcdougall in my project it is not a priority adding html in the md-file's content, so thats good news 😃
Yes it is a lot of work and sometimes when updating themes/plugins the WP-site is broken 😒
Thats a fantastic explanation and 100% agree 👍 , I feel that Pico give me a lot of freedom building themes and snippets. Okay i know, my pico-knowledge it's at the beginning now, but i learn fast and start buidling my first theme with ease, and motivates how easy it is 😃 |
Hello,
I have a dir tree:
../province/city/location
Is it possible show the province-page title in the location-page in my theme?
Trying this but doesn't work
{{ parent.parent.page.title }}
The text was updated successfully, but these errors were encountered: