Jump to content

New post: New PW website ready


ryan

Recommended Posts

@ryan - just looking at: https://processwire.com/api/ref/wire-mail/

Quote

Below are 3 different ways you can get a new instance of WireMail. When possible we recommend using option A or B below.

$m = $mail->new(); // option A
$m = wireMail(); // option B
$m = new WireMail(); // option C

I feel like there needs to be some better explanation as to which can be used where. I know this is similar to the $pages / wire('pages') debate, but it's another example where a newbie might wonder why there are options and just assume PW is confusing for no good reason.

Do others agree, or is it just me?

  • Like 7
Link to comment
Share on other sites

1 hour ago, adrian said:

I feel like there needs to be some better explanation as to which can be used where. I know this is similar to the $pages / wire('pages') debate, but it's another example where a newbie might wonder why there are options and just assume PW is confusing for no good reason.

Do others agree, or is it just me?

I agree if that helps ? I also find it confusing why there are multiple options and what is the benefit of each...

Link to comment
Share on other sites

4 hours ago, adrian said:

Thanks for your thoughts @wbmnfktr - I agree that examples must work as they are - they shouldn't result in a message explaining why they don't work.

Ok, I'm done now, I promise :)

Don't be done, please. We need your valuable opinions.

  • Like 1
Link to comment
Share on other sites

Actually @ryan - I have a question myself about the new WireMail() option - it doesn't work with @horst's WireMailSmtp module. It does work in the WireMailMailgun module, but the "hack" to make it work prevents you from hooking into WireMail::send. I'd really appreciate your input on this here, or over here: https://processwire.com/talk/topic/12667-wiremail-mailgun/?do=findComment&comment=178727

Thanks again and sorry for getting OT.

Link to comment
Share on other sites

4 hours ago, ryan said:

The issue with the overlapping dropdown should be fixed now, please let me know if anyone else is still seeing it.

Please see the attached screenshot, Business to Consumer is written over the Blog. But not a big deal...

There are still two prev posts in the footer (see attached screenshot from @gmclelland).

4 hours ago, ryan said:

But I also agree about how useful and important Tracy is and that we should give her first class treatment around here

We all agree on that. I think the examples on the site should have run button (like Codepen) so that users can run the examples and play with them, I think Tracy could fit here (I think Adrian already suggested something in that regard). 

Quote

I think the example is fine because it just depends if output formatting is on or off.

@ryan While an example is good, for newbies this is odd. What is "output formating"??? I think we should use simple examples that just work. Mixing $pages and pages() is confusing too. Why don't we just stick to one notation, at least in examples, and have a special page where all these options are explained in details?

Screenshot_20190111-044244.png

157710218_RebuildingtheProcessWire.comwebsite(part5)2019-01-0917-11-00.jpg.1690c9e9f2451f34065a8e9d24c130f5.jpg

  • Like 3
Link to comment
Share on other sites

On 1/10/2019 at 7:58 AM, adrian said:

With the new font, I think the "More" link at the end of the initial blurb is no very obvious. I think it needs to be separated and say "Read More" or something more obvious.

Agree. Search engines also don't like links that aren't descriptive, eg "more" or "read more", etc, for accessibility reasons. Maybe make it italic with "Learn more about ProcessWire"?

  • Like 1
Link to comment
Share on other sites

12 hours ago, wbmnfktr said:

It still confuses me sometimes... to be honest.

I end up interchanging $this->pages and wire('pages') in modules depending on my mood. I've never learned which one is better than the other which is my problem, but I think it needs to be explained up-front, and as I think others have said any examples on the website should use the most efficient (or readable, but make a choice of one or the other) versions for where they're used. If there's a little "did you know the difference between x, y and z" on the documentation page for all the $pages info then that would be handy and link to the same explainer on a different page so the explanation is always there but the documentation and code examples are consistent (not saying they're not, I've not had 5 minutes to look yet just want to make sure we're not confusing people too much :)).

15 hours ago, adrian said:

There is of course Soma's old Modules Manager, but I haven't used it in years now. 

Maybe a new Modules Installer panel for Tracy ?

A module installer that would install Tracy from wihtin Tracy? ? I'm kidding ? What I meant was an overhaul to the core module installation area really. I vaguely remember even MODx had a way to browse modules from within the admin - it just saves time and it's not like there should be more bandwidth using a REST api than rendering the modules directory as you're not rendering all the assets at the same time. There may be more bandwidth if it results in a spike in usage, but that can only be a good thing.

What I'd love to see eventually is, after the installer runs, it then suggests some things for you to install on a first-run splash screen, so setting up a new site is ticking some boxes and you're away. Even better (though harder to code) would be remotely logging into the PW site from your installation and getting a list of your personally-chosen regular-use modules so you can tick the ones you need for your new project and they all install in one go. Sure, that's the ultimate nice-to-have, but anything that speeds up initial setup helps I think, especially for newbies ?

  • Like 7
Link to comment
Share on other sites

9 hours ago, adrian said:

@ryan - just looking at: https://processwire.com/api/ref/wire-mail/

I feel like there needs to be some better explanation as to which can be used where. I know this is similar to the $pages / wire('pages') debate, but it's another example where a newbie might wonder why there are options and just assume PW is confusing for no good reason.

Do others agree, or is it just me?

As per my last post above, if there's no explanation then yes, it is adding confusion, especially for newcomers. Well, and me, because I never bothered to learn the difference as I'm always in a hurry to get stuff done - tricky few years personally so if something works well I do it and move on quickly, but I do come to docs and examples every now and then and for the sake of a quick explanation on the docs page that would make me think "aha!" I should use that way, it's a shame not to have that explanation.

If we're giving examples though, as in the case of wireMail, it should surely just be ONE way to do it (the most efficient?) with the other ways stored somewhere further down the page maybe even at the bottom in this case. Like "alternative ways to get a WireMail instance" (but with better wording). The funny thing is, I used Option C from that page the most at the moment as I'm often using it in my own classes, outside of PW modules on a current long-running client project, so again I'm not able to see why that option isn't recommended or where I would go to find out why (I'd actually love to know if anyone has the answer? My classes do extend PW's core, so maybe I can get away with option B?).

Flogging a dead horse by now, but yes, for that specific doc page just list option A as being for use in templates, option b for use in modules and explain option C somewhere else under a "did you know?" or "alternative methods" header or something.

And yes, don't shut up Adrian, this is all good feedback ?

  • Like 3
Link to comment
Share on other sites

@ryan Hey Ryan, I have a minor problem with the site showcase. A while ago I submitted Engfer Consulting (https://processwire.com/sites/list/engfer-consulting/) to the showcase. If you look at the description, the last character is a question mark, that was supposed to be a unicode heart (♥, see https://unicode.org/cldr/utility/character.jsp?a=2665). I don't see a way to edit a submitted site, could you change the question mark to the heart, pretty please? ? If unicode is not possible there, something like "<3" would work as well ^^

As a future feature, it would be cool to have unicode support in there, or get a warning in those cases, though that's really a minor thing ?

Edit: Also, right now after submitting a site I'm redirected to https://processwire.com/sites/thanks/, which gives a 404 page. Can you confirm if the submission feature is working at the moment? I just submitted schwarzdesign.de and wanted to submit two more sites, would like to know if the submissions are not vanishing into nirvana right now ^^

Link to comment
Share on other sites

1 hour ago, Pete said:

I end up interchanging $this->pages and wire('pages') in modules depending on my mood.

Apparently Ryan does that also, so don't feel bad, eg $this->modules vs $this->wire('modules') in his LoginRegister module:
https://github.com/ryancramerdesign/LoginRegister/blob/7e6395393d46f9fba3a6769cc2ce85d4e495b8a4/LoginRegister.module#L492
https://github.com/ryancramerdesign/LoginRegister/blob/7e6395393d46f9fba3a6769cc2ce85d4e495b8a4/LoginRegister.module#L430
 

1 hour ago, Pete said:

A module installer that would install Tracy from wihtin Tracy? ? I'm kidding ? What I meant was an overhaul to the core module installation area really.

I completely agree that this belongs in the core modules installation area - I'd even be keen to work on it, and I love the idea of being able to favorite modules for easy access on other future installs.
 

1 hour ago, Pete said:

And yes, don't shut up Adrian, this is all good feedback ?

I was just starting to feel like a broken record on the $pages vs pages() etc stuff, that's all. I certainly won't keep quiet on other feedback I have!

  • Like 4
Link to comment
Share on other sites

1 minute ago, adrian said:

I completely agree that this belongs in the core modules installation area - I'd even be keen to work on it, and I love the idea of being able to favorite modules for easy access on other future installs.

Maybe we could collaborate on that. The "favourites" idea was just something that popped into my head because I've been working on integrating the forum member bar into other parts of the site (and forum member auth into the Modules and other interactive aspects as well). My test member bar currently does an AJAX request once the page is loaded so we can keep ProCache running on all pages, so a similar method could be used to remotely authenticate a user against the central PW database and retrieve the user's favourite modules. I think that this could be extended to do all sorts of cool things really, but an revamped module installer first, maybe with user-defined favourites, would be a good starting point - even if we only get as far as a mock-up of the design to begin with and run it by Ryan before we get too far ahead of ourselves ?

The layout of such a module installer should be pretty similar to this idea we've been discussing for a while for the main Modules forum here as well, so maybe we could kill two birds with one stone there with the layout and basic search functionality at least ?

  • Like 3
Link to comment
Share on other sites

+1 for explanations of the numerous variants of $pages / pages() / $this->pages..or when do i have to use "wire" etc --- generally explain the different methods of variable instantiation, scope, when where, why, differences ... with bringing the mostly used / recommended method on first place.

+1 for a codepen like playground / console for a API demo

a module installer as described above would be great!

  • Like 1
Link to comment
Share on other sites

Just a quick little play around with returning results directly from the modules directory. It is pulling in from a cached JSON feed from the modules directory. Obviously we want browse/filtering by category functionality as well, rather than just searching like this, but I think this would also be very useful for those who already know what they want.

EDIT: new version and further discussion here: 

 

TdrBxUvPsX.gif.4ceeada96a7abafb02a5ca0919ae38ae.gif

  • Like 15
Link to comment
Share on other sites

For what is worth... Here are my notes that I've gathered from the forums and other places.  Maybe something like this can be used somewhere?

from @kongondo and others

****************************************

When coding inside of modules you cannot directly access the PW API variables like $pages, $session, $input etc.. Those are available at $this->pages or wire('pages'). If you have static method(s) in your modules then you need wire('pages') there - so if you want to play it safe always use that (it works on command line scripts also)
 
**Outside a function and class.  Ex. in templates
$page;
$pages;
$sanitizer;
$input;
$modules;
$templates;
$fields;
$user;
$users;
$log;
$session;
$config;
__('Translate me baby');
 
**Inside a function or classes not extending WireData
wire('page');
wire('pages');
wire('sanitizer');
wire('input');
wire('modules');
wire('templates');
wire('fields');
wire('user');
wire('users');
wire('log');
wire('session');
wire('config');
 
**Inside classes extending WireData
$this->pages->find('something');
 
**Inside a class not extending WireData
$this->wire('page');// also $this->page;
$this->wire('pages');// -ditto-
$this->wire('sanitizer');// -ditto-
$this->wire('input');// -ditto-
$this->wire('modules');// -ditto-
$this->wire('templates');// -ditto-
$this->wire('fields');// -ditto-
$this->wire('user');// -ditto-
$this->wire('users');// -ditto-
$this->wire('log');// -ditto-
$this->wire('session');// -ditto-
$this->wire('config');// -ditto-
$this->_('Your string to translate’);
 
$title = wire()->fields('title'); // in a regular function outside of an object
$title = $this->wire()->fields('title'); // in a Wire-derived object
$title = $this->fields('title'); // in a Wire-derived object (alternate syntax)
 
from here
/**
* Global function, therefore does work everywhere,
* but will always refer to the first pw instance
* in case of multi instance usage.
* Because of that it's discouraged to use this in
* modules.
*/
wire("apivar")
 
/**
* Safest way to get the api variable in wire derived
* classes like modules.
*/
$this->wire("apivar")
 
/**
* Does work as well, but some (core) classes have that
* type of access disabled. It also prevents you from
* using a custom paramater $apivar in your class.
*/
$this->apivar
 
From here
In hooks use $event->wire() instead of wire() because it is multisite instance aware
 
****************************************
  • Like 9
Link to comment
Share on other sites

Quote
/**
* Global function, therefore does work everywhere,
* but will always refer to the first pw instance
* in case of multi instance usage.
* Because of that it's discouraged to use this in
* modules.
*/
wire("apivar")

I hadn't considered multi-instance issues but that totally explains an issue I was having a few months ago ?

Link to comment
Share on other sites

3 minutes ago, gmclelland said:

For what is worth... Here are my notes that I've gathered from the forums and other places.  Maybe something like this can be used somewhere?

from @kongondo and others

[ ... ]

 

Thanks for posting. This is exactly the kind of information which should be displayed centrally and not scattered around various places...

Link to comment
Share on other sites

1 minute ago, bud said:

As long as the processwire community can not even offer a real working contact form module for free

I do think that is a little unfair - @bernhard's RockForms (https://processwire.com/talk/topic/18763-alpha-rockforms-flexible-fast-and-secure-frontendforms-for-processwire/) is actually really nice. There is also http://modules.processwire.com/modules/simple-contact-form/

Nothing is perfect and PW is no exception, so you have to figure out what option suits your needs and skills the best and I think PW is that product for me. Do I agree with how everything is done - no I don't, but for now the pros outweigh the cons for me which is why I am still here ? And the community is also a huge part of why I am here - never come across such a helpful group and that has stemmed from Ryan's communication style here in the early days (when he had more time).

  • Like 2
Link to comment
Share on other sites

13 minutes ago, bud said:

The navigation in the docs is a nightmare! As long as the processwire community can not even offer a real working contact form module for free we may do better not putting down wordpress so hard. Processwire is far from perfect!

Thanks for sharing your opinion ? 

Thank you adrian ? He already knows about my module: https://processwire.com/talk/topic/18763-alpha-rockforms-flexible-fast-and-secure-frontendforms-for-processwire/?do=findComment&amp;comment=178767 and he also knows about FormBuilder (which would be a possibility for him to contribute to the project as it supports Ryan). I don't feel offended - I'm also happy to be here and thankful that I found PW (thx again @gebeer!) and that lots of people here are providing such valuable tools and helpful posts. Let's get back to topic...

 

  • Like 2
Link to comment
Share on other sites

I found a small problem with the search field on new PW Website:

searchfield-problem.thumb.gif.9684a4e9c3af23aeee5784be848d9caa.gif

 

OS: MacOS Mojave
Browser: Safari (latest version) & Chrome (latest version)

Steps to reproduce:

  • go to Docs
  • click on Search icon
  • enter search text

The results popup is placed half outside the right browser window.

I can't reproduce this every time. just open close the search field and delete/re-enter search-string...

 

Link to comment
Share on other sites

6 hours ago, adrian said:

Just a quick little play around with returning results directly from the modules directory. It is pulling in from a cached JSON feed from the modules directory. Obviously we want browse/filtering by category functionality as well, rather than just searching like this, but I think this would also be very useful for those who already know what they want.

TdrBxUvPsX.gif.4ceeada96a7abafb02a5ca0919ae38ae.gif

Hey @adrian and @Pete I think a revamped module installer would be great. Adrian's AJAX approach is a nice addition for devs who know what they are looking for. But for all others we need a browsable experience. We should open another forum topic for this.  I might come up with an initial mockup as a starting point in the next weeks, but as always my time is limited. First I have to update the german language files for the new PW dev version.

  • Like 2
Link to comment
Share on other sites

57 minutes ago, jmartsch said:

Hey @adrian and @Pete I think a revamped module installer would be great. Adrian's AJAX approach is a nice addition for devs who know what they are looking for. But for all others we need a browsable experience. We should open another forum topic for this.  I might come up with an initial mockup as a starting point in the next weeks, but as always my time is limited. First I have to update the german language files for the new PW dev version.

Thanks for your input - I totally agree that we need a browsable / filterable interface as well.

Let's start discussing this more over here: 

 

  • Like 1
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...