Jump to content

New post: New PW website ready


ryan

Recommended Posts

@ryan - I feel like on the API ref main page the classes should be below the variables, or at least the variables should be on the left, but I prefer the former with two columns still, but with Primary left, Input & Output right, Users & Access left, etc ....

My reason being that for the most part variables are the main thing that is used in template files - these are what beginners need to know about. The classes themselves are generally a step removed from the code we are writing. The main exception is probably pagefiles/pageimages. The rest are used much less frequently.

Interestingly when you are viewing an individual variable or class and the left sidebar is showing, the variables are on top.

 

  • Like 2
Link to comment
Share on other sites

@ryan, the new site search is great - such an improvement over the previous version.

After searching I find myself trying to use the keyboard (arrow keys, enter) to highlight and select results, like I can in the PW admin search. Would it be possible to add this feature to the processwire.com search?

  • Like 10
Link to comment
Share on other sites

Does anyone know if all the old URLs that Google had indexed have been updated to the new URLs? If not, there'll be a pretty big dive in SEO rankings. 

As an example, I was searching for some API info and was brought to this page

https://www.google.com/search?q=processwire+selector+limit&rlz=1C5CHFA_enIE731IE731&oq=processwire+selector+limit&aqs=chrome..69i57j0.6332j1j7&sourceid=chrome&ie=UTF-8

If you click on the search result, you'll be taken to a 404 page etc.

 

 

  • Like 2
Link to comment
Share on other sites

Yep, I've got profilerpro monitoring them and if any url gets more than a couple hits then I add a redirect. It looks like there were a few I missed but slowly accounting for them as they pop up.

  • Like 3
Link to comment
Share on other sites

Firstly,

Great work on launching the new website! Looks great! 

The only feedback I have is a concern about the example code that is provided on the homepage. Which I believe may confuse some people. 

In 3.0.39 the FunctionsAPI was added (https://processwire.com/blog/posts/processwire-3.0.39-core-updates/#new-functions-api), which can be added in the config file, until you do that however, using functions will not work. Here are those examples:

// Render your site’s primary navigation
echo pages('/')->children->each('<li><a href={url}>{title}</a>');
// Find buildings: built before 1950, 10+ floors, sort by height
pages('template=building, year<1950, floors>=10, sort=height');
// Get “email” field from /contact/ page and use it
<a href='mailto:<?= pages('/contact/')->email ?>'>Email me</a>

These will not actually work out of the box and cause Internal Server errors. I feel like most people learning will look at the API Reference, I don't believe that FunctionsAPI is very well documented. In fact, I doubt new people will read that far back in the blog posts. I do believe that there is a lot of functionality that gets lost in blog posts.

What is everyone else's thoughts on this? 

 

  • Like 3
Link to comment
Share on other sites

I think that Functional API quite convenient, maybe we can introduce two code boxes with examples without and with Functional API with notice that it doesn't work out of the box and require some modification of config.php and add a link to the blog post or documentation page. 

Link to comment
Share on other sites

1 hour ago, Tom. said:

In 3.0.39 the FunctionsAPI was added (https://processwire.com/blog/posts/processwire-3.0.39-core-updates/#new-functions-api), which can be added in the config file, until you do that however, using functions will not work.

Ryan has just modified all included site profiles to turn on the functions API by default although I am not sure why the change wasn't made in the wire/config.php file so it works for all profiles even if they come from another source - I am sure I am overlooking a good reason though. Regardless I still don't like the mix of approaches used in those examples, but that has been discussed above ?

  • Like 5
Link to comment
Share on other sites

I personally see just a single benefit in the functions api: It's beginner friendly as it's keeping you from needing to understand how scoping and classes work in php/pw. But it brings the the big downside of relying on a global processwire instance, which is a well known code smell. It might not matter for many simple websites, but especially in modules one should never use those as it will simply prevent the module from being usable in a multi instance setup. Currently I feel like the tradeoffs and why one would use one API access method over the other just isn't very well described. Maybe something of this post could be incorporated into the current explanations: 

 

  • Like 6
Link to comment
Share on other sites

Hi Ryan, can you make all the text left justified instead of centered when viewing the site on mobile?  I find it hard to read when the text is ragged.

I'm referring to the blog posts and the blue footer text (twitter posts, forum postings, Latest news, etc.)

1759942123_ProcessWireAnopensourceCMSwithapowerfulAPI2019-01-1409-56-19.jpg.d3ec28465a718e6236a7c5189b73cea0.jpg

I also noticed after typing in the search field on the site, every time you hit the down arrow key to try to select one of the autocomplete suggestions a spinner shows like it is searching again.

  • Like 3
Link to comment
Share on other sites

Quote

The only feedback I have is a concern about the example code that is provided on the homepage. Which I believe may confuse some people. 

It's been mentioned a couple of times. I think functions API should lead the examples, but I understand the concern. Per the mention in last week's post, I'll be writing up all the details this coming week. Take a look, and if I haven't convinced you guys at that point, I'll be happy to change the examples. The only thing is, we'll probably need to come up with new examples because they get too long without the functions API. And at that point, they no longer serve the intended purpose at least on the marketing aspect. 

Quote

How about a new favicon of the ProcessWire logo instead of being lost in the clouds?

Favicons now added. 

Quote

These will not actually work out of the box and cause Internal Server errors. 

The same could be said of using an API variable inside of a function or method. These are short examples to get you interested, they lack surrounding context regardless of what style API you are using with PW, and there will be cases where they work and where they don't either way. We're just trying to give people a small sip to see if it tastes good, not show them how to brew the beer. However, with that said, the intention is that they will work out of the box. They do work on the dev branch right now (which is the branch we recommend for new installs). This will also merge to master again soon. The examples have always worked on the core Regular site profile as well. Error messages have also been added to detect when you use a functions API call without them enabled, and it then tells you exactly what you need to do to enable it. 

Quote

Ryan has just modified all included site profiles to turn on the functions API by default although I am not sure why the change wasn't made in the wire/config.php file so it works for all profiles even if they come from another source - I am sure I am overlooking a good reason though.

As far as the core goes, the values set in /wire/config.php have to be settings that work on all existing installations. Whereas the values set in /site/config.php are those intended for new installations. We can't enable the functions API on existing installations—only new installations. The reason is that someone may have defined their own pages() function (for example) years before we even had a functions API, and upgrading to a version of PW that has it pre-enabled would then break their installation. I make an effort to ensure anything that gets added in PW is done so in a backwards compatible manner, and this is why there are properties like $config->installed and independent config files. 

Quote

Regardless I still don't like the mix of approaches used in those examples, but that has been discussed above

The mix of approaches is actually relevant here because anything using a function refers to something where only one instance can exist, and anything using a variable refers to something that can have any number of instances. So I would use a variable like $page in an example when the intention is to say "can be any page", whereas I would use page() when the intention is to say "page being viewed", as there can only be one. 

Quote

I personally see just a single benefit in the functions api: It's beginner friendly as it's keeping you from needing to understand how scoping and classes work in php/pw. 

That is one benefit, but definitely not the only one. Read what I have to say later this week. 

Quote

But it brings the the big downside of relying on a global processwire instance, which is a well known code smell.

Context is important here and the statement above skips that. I'm recommending the functions API for front-end templates, where PW manages the instance for you. But this is also where our audience is going to be 99% of the time. Of course if you are developing modules, then neither pages() or $pages is right for you, as you are going to need to ask for them from $this. I'm not trying to appeal to module developers, they already have a good handle on this stuff. 

Quote

Hi Ryan, can you make all the text left justified instead of centered when viewing the site on mobile?  I find it hard to read when the text is ragged.

I went back and forth on this one a couple weeks ago, but settled on the centered version after a lot of testing. Centered felt much more balanced, perhaps because the lines are so short that all the weight ends up on the left side. These are just short snippets of text, but if it were any longer then no doubt we'd want to go left aligned. 

Quote

I also noticed after typing in the search field on the site, every time you hit the down arrow key to try to select one of the autocomplete suggestions a spinner shows like it is searching again.

Good one and I agree. I think Robin S. also mentioned this if I recall, and I do have it on my list to add this capability. Uikit 3 doesn't come with an autocomplete component (Uikit 2 did), and we don't have one to use from jQuery UI like we do in the admin (since not using jQuery UI on this site). So the current autocomplete search is completely homegrown. I don't really know how to add the arrow key nav to this at the moment but do plan to hopefully figure it out soon. 

Quote

Would you also consider adding more contrast/weight to the active link to help show your current position/location in the sidebar navigation?

Between the existing wire highlight pointer, and the existing darkened text, and then add on that the text usually matches that of the headline, to me this just seems like way too much emphasis and redundancy if we also add a color change to it as well? At least my opinion is I don't want my eyes to be drawn to that unless I'm specifically looking for it. 

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

8 minutes ago, ryan said:

So I would use a variable like $page in an example when the intention is to say "can be any page", whereas I would use page() when the intention is to say "page being viewed", as there can only be one. 

In the template context, how can $page be any page unless you have overridden it, which we always discourage. Otherwise, $page is always the current page. I do understand that page() can't be overridden like $page can, so maybe going forward the functions API should be the recommended approach, but we are going to confuse the hell out of beginners if homepage examples show both approaches.

10 minutes ago, ryan said:

However, with that said, the intention is that they will work out of the box. They do work on the dev branch right now (which is the branch we recommend for new installs).

But the save() example won't work as is and will confuse the user to see an error about outputformatting which they will not understand anything about yet. We have setAndSave() - why not use that example? Same goes for my observation about the image example and the issue with the need for first() on the site profiles which I think mostly come with "images" fields, rather than an "image" field. As a new user to a system all it often takes is one unexpected error early on to send them packing - I know I have done that myself. Sorry to be so blunt but I feel like many of us here have expresses our concerns regarding this - either through lots of likes on my posts above about it, or through their own comments.

Please accept these comments in the spirit they are intended, which is to help make PW easy for beginners to fall in love with. 

 

 

  • Like 10
Link to comment
Share on other sites

1 hour ago, ryan said:

We're just trying to give people a small sip to see if it tastes good, not show them how to brew the beer.

I agree, but even the small sip should taste like the beer. If it tastes like anything else other than the beer, then one may not be interested in the drink. The gist is if even the simple examples don't work right out of the box or are confusing (small sip of beer tastes like....[insert non-beer drink here]), then one may go elsewhere for their beer... [insert other non-ProcessWire CMS/CMF here]). Besides, it just screams unprofessional/rough edges, etc. 

1 hour ago, adrian said:

Please accept these comments in the spirit they are intended, which is to help make PW easy for beginners to fall in love with. 

What @adrian said ?.

Edited by kongondo
  • Like 6
Link to comment
Share on other sites

1 hour ago, ryan said:

I went back and forth on this one a couple weeks ago, but settled on the centered version after a lot of testing. Centered felt much more balanced, perhaps because the lines are so short that all the weight ends up on the left side. These are just short snippets of text, but if it were any longer then no doubt we'd want to go left aligned.

- Sorry if I wasn't fully clear.  I meant to only left justify these elements on the mobile breakpoint/view when everything is vertically stacked.  Above that breakpoint everything looks fine center justified.

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...