Soma

ProcessWire Cheatsheet

Recommended Posts

Just wanted to mention some updates I was recently working on.

1. The Cheatsheet is now a ProcessWire Site (since couple months already). This allows for easy updating by team members. Also it allows for implementing stuff that wouldn't be easy with a static html. So all entries are now pages. This was very easy to setup and import the html data via a simple script.

2. Since we now got all the power of PW there, my idea was to create a API doc Site that would serve as a alternative extended sort of cheatsheet. Similar to php.net where you can see more details along with simple code examples and further information like what version introduced or if it's depreciated, related links to other API's. Also there's possibility to add comments. 

This opens great possibilities to give more information to you, add a "social" aspect, and at the same time also open it for indexing by search engines . :)

You can see the current (not finished) version of the extended API doc here:

http://cheatsheet.processwire.com/pages/built-in-methods-reference/pages-find-selector/

We are currently adding content and examples to the API's so this will take some time. Also there will be added some cross linking from the Cheatsheet to the extended docs when ready. Hope you like it.

(edit: just realized that this was the 100th response in this thread! great coincidence)

  • Like 15

Share this post


Link to post
Share on other sites

This is brilliant Soma, thanks so much for all your time on it. I think it will be useful for everyone but can especially see some of the new users who often ask for examples finding this a great resource. :)

  • Like 1

Share this post


Link to post
Share on other sites

It's a pity line numbers change as code evolve, else it would be nice that you could add links to the processwire core where example are.

Share this post


Link to post
Share on other sites

It's a pity line numbers change as code evolve, else it would be nice that you could add links to the processwire core where example are.

Good idea. I think on Captain Hook Soma managed to do this. Lines should point to the Stable Release, hence won't change until the next Stable version...

Share this post


Link to post
Share on other sites

in file or image properties, isn't there now a $file->httpUrl or $image->httpUrl

  • Like 1

Share this post


Link to post
Share on other sites

in file or image properties, isn't there now a $file->httpUrl or $image->httpUrl

Thanks for mention, but this is not in latest stable (2.3). 

Share this post


Link to post
Share on other sites

Great plan.

I would love to be able to see some quick examples along with the overviews.

Share this post


Link to post
Share on other sites

Has the cheatsheet been updated for 2.5 ? It's unclear from the page itself what version of ProcessWire it is for or when it has been updated.

Also, bonus points if it could be possible to highlight new or modified core functions. :)

  • Like 1

Share this post


Link to post
Share on other sites

Has the cheatsheet been updated for 2.5 ?

Same question here.

Share this post


Link to post
Share on other sites

Well, gentlemen, I think Soma is always looking for volunteers to help....

  • Like 1

Share this post


Link to post
Share on other sites

Apologies, Joss, I'm sure the posts were meant as questions not complaints.

  • Like 2

Share this post


Link to post
Share on other sites

@totoff, actually it's true. Programming is one thing, describing it is an other. Describing what functions do takes sometimes way longer then actual programming of it, next to the fact that you have to repeat this explanation in many places.

Share this post


Link to post
Share on other sites

For the record, "Introduced in" seems a bit off in some cases. http://cheatsheet.processwire.com/page/built-in-methods-reference/page-parentsuntil-selector/ for an example; this was apparently introduced in 2.3, not in 2.0.

I just stumbled on this myself, while working on a 2.2 site..  :)

Edited by teppo
2.3, not 2.4

Share this post


Link to post
Share on other sites

You could use the comment box to have this information in the cheatsheet.

Share this post


Link to post
Share on other sites

Getting back to this topic may I ask if there are any plans to update the cheatsheet in near future? Or is it discontinued? The cheatsheet is such a valuable resource. I would be glad to assist in updating it but I'm afraid my understanding of the API isn't good enough.

Thanks for keeping us informed.

  • Like 3

Share this post


Link to post
Share on other sites

Hello everybody. 

Last night (no sleep) I was thinking about the state of the PW documentation and Cheatsheet in general. How about we relaunch this project, make it open and PW based? There seems to be so much knowledge and doc buried in Blog Posts and added in newer Versions of PW but Cheatsheet and Docs don't seem to reflect these…

So i thought about building a new version with the following:

  • New Cheatsheet based on PW
  • Open for contribution by community, the PW community is so great, I think we could keep it uptodate with community effort…
  • Indicate what Version a feature was added
  • Comments on features etc.
  • Links to Blog Articles, PW Weekly & useful Forum entries
  • Example Implementations
  • Hooks and Hook Recipes
  • Maybe open API?

What are your thoughts? Any ideas about how to implement stuff? Am I the only one who regularly finds himself tracking down blog-posts, poking for infos in the forum, comments inside files etc? I'd be happy to kickstart and support the project…

 

  • Like 1

Share this post


Link to post
Share on other sites

The cheatsheet is PW based. Theres vesion added and comments. Theres couple members having access to it, but nobody seems to have time or care.

  • Like 1

Share this post


Link to post
Share on other sites

Yep, just saw the comments and version 😉 missed that from memory…

How about setting up a workflow: If @ryan adds new features etc. he'd notify a mailing-list and whoever has time could add the stuff to cheatsheet? How could we breath life into it again? Because I think it's already great, it would just need some more love 🙂

  • Like 1

Share this post


Link to post
Share on other sites

Every time this topic comes up I'm slightly worried about the relation between any community-led documentation project and the new(ish) API reference at https://processwire.com/api/ref/. This already gets (somewhat?) automatically populated based on the latest core release, and I seem to remember @ryan mentioning something along the lines of updating / releasing a new cheatsheet that would use same data. If that's really the plan, it could easily make any manually updated documentation obsolete.

That being said, I'm not 100% sure that this actually was Ryan's plan – or even if it was, is that still true? Additionally it might take a long time before he gets there (he's a busy fellow, after all.) Would be great if the man himself could chime in and let us know what the current plan regarding the docs is, and if we can somehow help make that happen 🙂

One problem with the current, auto-generated docs might be that (as far as I remember correctly) the code that generates it is also powering the (commercial) API Explorer module, which could make Ryan somewhat hesitant to share it with others – which is perfectly fine, of course, but could also mean that we can't do much to help him there. But anyway, this is mostly just guessing.

I've been quite happy with the new API reference, with the main problem being that one can't switch between core versions. For us who manage and work on different ProcessWire versions (for me this means everything from 2.2 .to 3.0) that's a major downside: currently when I'm working on anything other than my own projects, where the core version is generally speaking always the latest one, it's much easier to forget the docs and dive into the codebase to see which methods were available at the time.

  • Like 4

Share this post


Link to post
Share on other sites
2 hours ago, Ivan Gretsky said:

The cheatsheet is missing on the new site. Is it by plan or by accident?

 

On 1/9/2019 at 5:28 PM, ryan said:

... currently it's too far out of date so I'm not showing it in the docs navigation at the moment. I'm hoping to get the cheatsheet connected to the API Explorer module so that it can always be up-to-date like the API Reference section. 

 

  • Like 3

Share this post


Link to post
Share on other sites
3 hours ago, Ivan Gretsky said:

The cheatsheet is missing on the new site. Is it by plan or by accident?

It is still available though: http://cheatsheet.processwire.com

It's also linked to from the PW Info panel in Tracy

  • Like 1

Share this post


Link to post
Share on other sites

Actually speaking of the cheatsheet - these days I just refer to the API Explorer panel in Tracy - it's all there and always up to date and I generally prefer it to the PW website docs for quickly finding stuff. 

That said, I still think there is a place for the cheatsheet for beginners because it lays out the most used stuff so well.

  • Like 4

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.