Jump to content

ProcessWire Cheatsheet


Soma

Recommended Posts

I finally started a Cheatsheet for ProcessWire2.1+ ;)

Now it's also on processwire.com (auto fetching it from git)

http://www.processwi.../api/cheatsheet

The github project page:

http://somatonic.git...WireCheatsheet/

And there's the git repository:

https://github.com/s...sWireCheatsheet

I'll continue to add or remove things as times goes by. At some point this will get converted to a PW App. :)

02.06.2012:

- added with $input->urlSegments

- added support for GET param in url to &filter and set &advanced

- added support for hash in param to filter section

06.02.2012:

- updated urlSegment($n) description to avoid confusion

- remove some of the alternative syntax

17.12.2011:

- added new section "Files" to the sheet

- minor structuring of some advanced entries

08.12.2011:

- added fix to menu when scrolling

- moved some entries to advanced mode

- added toggle button on sections

- minor changes

04.12.2011:

- some restructuring, adds and removes

- minor tweaks overall, typos, ordering

- added "advanced" mode

27.11.2011:

- Added index collumn on left side

- You can now toggle sections using the index

- Also toggle show/hide all description of a category when clicking on blue titles.

- It resets all if you click in the table somewhere (in white space)

ADVANCED mode:

Mainly it started with only "System Configurations" being advanced, but I added many of the more advanced functions overall. I don't know if it really is the thing to go, but I thought why not try to have very simple and basic version so it would fit on a matchbox ;). So they're my guess on to what would be the more advanced stuff, and I had kinda hard time to decide what to do and how. After long back and forth I decided to just give it a go and see what people think.

Filter

I noticed that in mozilla, the live search filtering wasn't working after the changes i've done to it. I figured mozilla has no innerText, which is very practical to get content of a node but not subnodes. I had to use textContent, which returns all text including subnodes, so the search filter doesn't work as good as in other Browsers. May I find a way to work around it.

*Found that restructuring the markup was the only way to solve this problem. It should also now work much better in FF for the live search.

---

Bug reports, feedback and suggestions are always welcome. Hope you like it!

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

I've not seen the API like this before. This is really awesome! Gives me new perspective, ideas, and very thankful for your effort here! And its hugely useful, usable and really pretty! Today was a day that I just wanted to work on PW and was forced to work on client rush work all day (like most of this week) and seeing this really makes my day (and week!) Thanks Soma!!

Link to comment
Share on other sites

great soma!!

edit: courier is not that readable with these colors, at least in my screen. would you consider changing it to "monospace, courier;". Since this is aimed at developers i bet everyone has a favorite monospace as default in their computer. Maybe it would ruin a bit your design though ;)

Link to comment
Share on other sites

Thanks guys, I'm really happy how it turned out and glad you guys like it.

I added some more for markup pager and page fields and some more selector properties.

I also added some font options now. It's better to have that optional. I can't say what font works best for you, I don't even have monospace installed... I changed default to Courier New, don't know if that helps. But now you can chose one you like.

Ryan, I would be very thankful if you could help a little with looking through if there's anything you would add, or maybe you spot something wrong or something really important that we forgot we could put in. – I don't know if Fuel would have to be added like Nico suggested. Breadcrumbs? That's something really easy to form with foreach over ->parents array, breadcrumbs does also only that I think.

I don't want to add every little bit that's in PW, but the most useful for reference.

Link to comment
Share on other sites

ahh Thanks apeisa for the head's up

that makes sense now... :)

hm, something must be wrong with the fonts, my default monospace font is dejavu, but i still get courier...

You mean if you select monospace? What browser? For me it also shows courier, dunno what my default monospace font is

Link to comment
Share on other sites

I still get courier on chrome after cleaning the cache (!?)

But now it's smaller if i choose monospace and bigger if i choose courier

edit: But i can see you are making some changes. It's different everytime I refresh :)

edit2: Actually, I think this choice only adds one layer of complexity. Isn't it better to just decide on a good font stack?

Link to comment
Share on other sites

Then you have Courier set in Chrome as default monospace font (it's the default).

It works all well for me in Chrome and all others.

Don't know if I'll change it back, now that it's configurable I don't see any big level of complexity here.

---

May be best to just specify monospace as font, so whatever you define in your browser is chosen. Since courier is default in all browser I would be fine with it.

I quickly changed it, can you have a look diogo if that works for you, I guess you'll still see courier...

Anyway, for the font sizes, not each font will render same size consistent, that's why you seen the font size change because I defined "Courier New" and your default monospace is "Courier" and set different size or may render differently for you.

Link to comment
Share on other sites

Btw you might wanna serve this also through github, see http://pages.github.com/

Ah haven't done that yet. Thanks for the tip.

I've tried and created a branch and now I'm a little confused with those two separate branches "master" and "gh-pages".

Is there a way to have the master always getting pushed to the gh-pages?

The github project page is now available here:

http://somatonic.github.com/ProcessWireCheatsheet/

Link to comment
Share on other sites

Some: how does filtering works or how you are planning to do it? If I write "field" it leaves quite a lot stuff visible which have nothing to do with fields..?

BTW: I have some late night coding ahead and will give good test for this! ;)

Link to comment
Share on other sites

Some: how does filtering works or how you are planning to do it? If I write "field" it leaves quite a lot stuff visible which have nothing to do with fields..?

BTW: I have some late night coding ahead and will give good test for this! ;)

Thanks for asking. I use some code from JResig from a while ago, he showed an improved example for someone elses live search. It's using quicksilver js for scoring. So it checks for if score > 0.1 , which is pretty lazy and finds many things. I tried to find a setting which is a good balance, but it's two sided sword. BTW, the hidden description texts also count. Also if you enter -> or $ it works better. If I set it to > 0.5 or 0.8 it seems to not find stuff that should... I don't know if it has to do with the $-> chars.

I'm still trying to see if I can improve it, I'll try to do some investigations. But also would like to hear what you think - try again using  the -> in search..

Link to comment
Share on other sites

Yes, it has a search heuristic which find also wrong spelled word similarities.

I can't really agree that it's not desirable, I like how it works to filter and also find similar matches, which can even be helpful if you consider it. Like config->modules find more than just the exact match. It's just that I can't figure the best setting and think it's stumbling over the -> chars, and because of the description texts adding to the results.

Link to comment
Share on other sites

I think it is way too lousy at the moment. If I write "config" it shows almost everything.

But I don't see that much of a problem. For my taste chrome search (ctrl + f) works just fine, since it highlights all the results.

My only gripe is how the description goes over the title. I would prefer if it would fold open and show description under the title. Also I would like to "open" many items at the same time (and also "open all" from certain category).

These are just ideas and details - I have found this super helpful already!

Link to comment
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.
×
×
  • Create New...