Jump to content

ProcessWire on the web


apeisa

Recommended Posts

Writing some tutorials for Envato Tuts+ anyone have any recommendations of topics to help Processwire beginners? Starting with Installation, admin guide and themeing.

Hey Ben, that's brilliant news! Finally, someone who knows about ProcessWire writing about ProcessWire :-).

Could you please start a new thread about this? It is an important issue and should not 'be hidden' here amongst other stuff, thanks.

  • Like 5
Link to comment
Share on other sites

Writing some tutorials for Envato Tuts+ anyone have any recommendations of topics to help Processwire beginners? Starting with Installation, admin guide and themeing.

Awesome News.

Please Write about how easy is creating multilanguage sites using processwire.

I suggest taking themes from http://html5up.net/ and creating full sites with PW.

Or making an ecommerce with www.padloper.pw

Making custom field types and modules

Using wireshell

Oh lots of wonderful ideas :)

Whish you the best of good energy!

  • Like 1
Link to comment
Share on other sites

Greetings Everyone,

Christophe: I would not worry about those "best of..." sites.  Right now, the PHP community is nutty for Laravel.

I like Laravel generally.  However -- and I don't say this lightly -- most assessments I've seen are biased and a little rigged to help Laravel these days.  For example, in that Sitepoint survey, versions 1 - 5 of Laravel are lumped into a single "popularity" number.  But Yii framework (which is great, by the way), is split between version 1 and 2.

We often have these discussions about increasing PW's popularity.  But I wonder, maybe ProcessWire is doing well enough without pushing it?

Thanks,

Matthew

  • Like 6
Link to comment
Share on other sites

Writing some tutorials for Envato Tuts+ anyone have any recommendations of topics to help Processwire beginners? Starting with Installation, admin guide and themeing.

Hi Ben,

This is my very first post, so a big hello the the ProcessWire community!
 
Being new to ProcessWire, I'm in your target group I suppose :) I already started to read the Docs, the weekly newsletters and the blog posts as well (not to mention this forum), which are all useful, but what I am really after is an up to date (v3.x) introduction to all the most important bits that help me develop my very first ProcessWire site that is not just a basic website with a contact form being the most complex element of it, but something that shows us how entity relations should be implemented (Pages vs repeaters: pros and cons). 
 
It would also be nice to see how we should implement "fontend users", who can login to the site, update their profiles (info and personal photo) and check out the list of all members, search them, etc... This way you could also introduce us to forms and to saving the posted data, etc...
 
Actually, my site will be developed for a shotokan dojo, so entities like karate tests and results, competitions and results (individual and team), and other events as well will be needed. You get the idea...
 
One more thing: I'm still trying to figure out the best way to organize my template files (and the php partials included in them). I did read Ryan's introduction (How to structure your template files, and the others as well) but I don't really like neither the particular example of the "Direct Output with Includes" nor the "Delayed Output" method.
 
The particular example of the "Direct Output with Includes" method is too "simple and rigid", while the "Delayed Output" uses concatenation, and those php files do not use the PHP alternative syntax, which makes working with the HTML markup frustrating (in my point of view).
 
So I'm planning to come up with something between these two methods, based on Direct Output but utilizing both prependTemplateFile and appendTemplateFile.
 
Since I will build my very first ProcessWire site, I have to spend some extra time trying to figure out all the best practices that fit my usual workflow, and watching your tutorial might help me a lot in this regard. I will definitely consider watching it, whatever you produce :)
 
BTW, I suppose you have already gathered, that I'm suggesting to create a tutorial at least for reasonably skillful front-end developers, and not for complete beginners. Joss Sanglier's tutorial is just good for that purpose.
 
Thank you anyway! I hope your tutorial turns out to be successful.
  • Like 2
Link to comment
Share on other sites

Writing some tutorials for Envato Tuts+ anyone have any recommendations of topics to help Processwire beginners?

Envato Tuts is a respectable place to write on so that's a good thing in the first place.

1. decoupled cms make your own frontend with no cms rules

2. powerful and flexible api

3. accessible for both beginners, designers and coders

Of course, every post and tuto helps, but when I come to think about it, it won't accelerate things for Processwire.

My thoughts are that what would accelerate Processwire is a marketing plan.

  • Like 1
Link to comment
Share on other sites

It would also be nice to see how we should implement "fontend users", who can login to the site, update their profiles (info and personal photo) and check out the list of all members, search them, etc... This way you could also introduce us to forms and to saving the posted data, etc...

This is actually one area that I think may be too broad in scope for a tuts plus tutorial. That's because PW doesn't generate markup nor does it have an official front-end forms API, so it would be much more of an HTML and PHP tutorial than a ProcessWire one. 

The particular example of the "Direct Output with Includes" method is too "simple and rigid", while the "Delayed Output" uses concatenation

Keep in mind the guides there are to demonstrate the simplest possible cases. We use concatenation because it's really simple and easy (and what I prefer), but that doesn't mean it's a requirement of delayed output. You could just as easily use arrays, output buffering, wireTemplateFile(), wireIncludeFile(), etc. The point is to demonstrate delaying your output until the appendTemplateFile inclusion. That's what delayed output is. 

and those php files do not use the PHP alternative syntax, which makes working with the HTML markup frustrating (in my point of view).

ProcessWire's API is a PHP API, so I find it a lot simpler to stay in that API rather than constantly jumping in and out of HTML. After all, it requires <?php ?> tags to jump in and out of PHP from HTML, but does not require anything but quotes or heredocs to use HTML within PHP. PHP alternative syntax is handy for large blocks of conditional HTML. But for most markup generation situations I don't recommend it unless you personally find it more readable. For many of us, the additional verbosity and constant jumping in/out of PHP & HTML make it difficult to read and follow, but this is purely a preference thing as I don't think it matters to the end result at all.

When it comes to writing tutorials and/or documentation, I try to communicate the concepts in the simplest/shortest way possible so that focus remains on the concept and API calls that we are trying to teach. That doesn't mean you have to do the same, or that doing it differently means you aren't adhering to the concept. Whether you are using alternative syntax or not matters little to the concept. Though since you are in "direct output" when outside of a php tag, it does make your job a little harder for delayed output. But you can amend that by isolating your markup and rendering it with wireTemplateFile(). 

Writing some tutorials for Envato Tuts+ anyone have any recommendations of topics to help Processwire beginners? Starting with Installation, admin guide and themeing.
FYI I already wrote a PW article for code tutsplus. It's publication-ready and will be released mid-January. Can't wait what you guys will say about it!!

Fantastic! @benbyf and @isellsoap just let me know if there's anything I can do to assist. Thank you for writing tutorials for PW!

  • Like 5
Link to comment
Share on other sites

Thank you for you thoughts Ryan. I will check out wireTemplateFile() and wireIncludeFile() to see how they can help me to achieve what I am after. I use Pinegrow (Pro) Web Editor for frontend development, and the PHP alternative syntax is the only way to sort of preview what the actual dynamically generated markup will be, and the static preview helps to speed up the frontend design process. Thanks to this preview feature of Pinegrow, it is actually easy to visually separate HTML and PHP, since this is the basic idea behind this software; to be able to work easily with this particular syntax.

  • Like 1
Link to comment
Share on other sites

I am a fan of the php alternative syntax as well, szabesz, to keep the focus on the final HTML rather than on the logic when inside of a template and not have to escape your markup. And if you use short tags like <? if($foo): ?> and <?= $foo ?>, ternary statements like <?= $foo ? 'myclass' : '' ?> and leave off unnecessary semi-colons, then I find this solution cleaner and more readable most of the time. Like Ryan said, if you use php output buffering directly or separate all of your markup into individual files and load them using the TemplateFile class, then you can still use the delayed output method with alternative syntax.

Personally, however, I prefer setting all templates (in the template settings in the admin) to point to a single output file and then handle the rest with php logic, loading subfiles based on the name of the current template. Actually, I've developed an entire (H)MVC framework on our latest project, which hopefully I will be mature enough to release some time soon.

All that to say you can do anything with ProcessWire!

  • Like 2
Link to comment
Share on other sites

Yeah, I understand that we have sort of complete freedom regarding how we develop our site profiles, this is one of the many strong features of the system. However, for beginners like me, it would be nice to see various strategies. Even Ryan says "Stay tuned! More sections will be added shortly.", see "How to structure your template files".

I'm just longing for more :) However, since Ryan is always busy pouring more and more cool features and additions into the system (and also working on other projects), I understand that it must be extremely hard to find some extra time to extend the docs.

I think it is high time to dig up some site profiles I can find, just to learn various strategies. To see how others do it. 

Edited by szabesz
Link to comment
Share on other sites

Though since you are in "direct output" when outside of a php tag, it does make your job a little harder for delayed output. But you can amend that by isolating your markup and rendering it with wireTemplateFile(). 

Well, I do not even know what I am doing in front of the screen at this time..., but I must have drunk too much champagne anyway... so a little bit of ProcessWire template file building cannot hurt to much I suppose... :D

So, where was I ??? Sorry, it is off topic I know, but I wanted to reply to Ryan's suggestion, that calls this function in question as "wireTemplateFile()". When was it renamed to "wireRenderFile"? It is still called as "wireTemplateFile" in the comments, where it should be corrected I suppose. Oh, and in this changelog: https://processwire.com/blog/posts/processwire-2.5-changelog/

Other than that, I came up whit this version of the delayed output as my preferred one: in _main.php (which I renamed to _page.php) I have <?php echo $layout; ?> between the "header" and the "footer", and the actual template files do only this: $layout = wireRenderFile("layout/home.inc.php"); that is, they render the associated "alternative syntax style template partials", so this is similar to the simple direct output, but with the benefits of the delayed output.

To much champagne in my brain, told you, sorry for this post, and HAPPY 2016 everyone!

  • Like 2
Link to comment
Share on other sites

Other than that, I came up whit this version of the delayed output as my preferred one: in _main.php (which I renamed to _page.php) I have <?php echo $layout; ?> between the "header" and the "footer", and the actual template files do only this: $layout = wireRenderFile("layout/home.inc.php"); that is, they render the associated "alternative syntax style template partials", so this is similar to the simple direct output, but with the benefits of the delayed output.

That is an interesting way in how to expand on the delayed output strategy but in principal I see no real difference

when compared to swapping the _main.php solution that is already there in the backend:

post-1069-0-17799500-1451817523_thumb.jp

I mean in the end I only see more diversion but I see no real difference in principal between

swapping out _main.php's or $Layout's

Link to comment
Share on other sites

Actually, I didn't completely describe my concept, so it looks like it is about replacing _main.php, but it is something else. What I want to achieve is a tree/recursive like template file render method, which starts with $layout = wireRenderFile("layout/home.inc.php") and this $layout is echoed out in _main.php which I - normally - do not want to change since _main.php contains the head(er) and the footer of the site (in case of a "classic" page layout), however each page should be configurable to use its own "layout".
 
The actual "layout file" also contains wireRenderFile() call(s), to render reusable parts of the site. So the rendering process starts with echo $layout and continues down the "partial file tree structure" by using more wireRenderFile() calls to "include" the required template file partials. It is just like using simple php includes with direct output. So it's a rather simple concept, but it can be extended by using a few more variables besides $layout to solve problems like not loading not needed resources into a given page (like not loading jQuery on pages where it is not needed, etc...)
 
I hope I was able to explain it clearly this time.
  • Like 1
Link to comment
Share on other sites

Ok the goal has to be, to be able to maintain/edit output as much as possible in one place such as _main.php

(or in _page.php as a better conventioning naming)

and have layouts outside _main.php to be able to give some of your web site pages different looks. Yes, the wireRenderFile() enables a more dynamic approach compared with swapping out static other _main.php files. But could the same also not be done with conditional logic in a template file to select different include layout.inc files ?

Link to comment
Share on other sites

But could the same also not be done with conditional logic in a template file to select different include layout.inc files ?

Sure, it could (can, actually). But I try to avoid conditionals when there are alternatives. After all, first of all I just want to construct a given page based on partials, and the layout of them can be put together by using various reusable parts which are always the same on a given page (like sidebars, latest posts, banners, etc...). Of course, some "reusable parts" can be pretty complex which surely use conditionals, but complex features are implemented in those partials only (or as separate reusable functions, classes, etc...) and the scaffolding of the page is managed by this simple method which is easy to understand.

SilverStripe and Magento uses this method (built upon completely different implementations, of course) and I always found this type of rendering method to be easy to work with, that is why I was happy to learn that we have wireRenderFile() (which is easy to use).

Link to comment
Share on other sites

  • 3 weeks later...

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