Jump to content

szabesz

Members
  • Posts

    2,960
  • Joined

  • Last visited

  • Days Won

    20

Everything posted by szabesz

  1. I think clsource and rick are right; even a tutorial for those new to ProcessWire should assume a general understanding of entity relationships, procedural programming, html and css, and it should concentrate on the methods and design patterns that beginners can easily implement to craft a site with typical components such as general pages, blog posts with categories and tags, a simple contact form and maybe a simple user management to protect a given page (and its children) on the frontend ("customer area"). By choosing a css framework, you can skip the design process altogether.
  2. Would it be a "basic setup" similar to those page builders that are so popular these days in WP/Joomla and (possibly) others? Interesting idea.
  3. I read the article so now at least I get the basics of this new feature. Issue 1 One thing is really confusing about how it works: - I deleted the "FileCompiler" folder in "cache" - I set the compile option of a template to "Yes (template file only)" - "FileCompiler" folder and its content was re-generated - I reloaded a page of the frontend and the wireRenderFile("partials/top_nav.inc.php", $_p); call ran fine - I set the compile option to the default "Yes (and included files)" - I reloaded a page of the frontend and the cached/compiled version of the template file of that page did NOT change. I suppose this is because the original template file did not change either. However, this can be confusing, because later on I might easily change the original template file, and the cached/compiled version will change to this (which fails to run): $layout = wireRenderFile(\ProcessWire\wire('files')->compile("layout/home.inc.php",$_p,array('includes'=>true,'namespace'=>true,'modules'=>true))); So the problem will only crop up later on, just to "surprise me" a little bit, which is not the best experience ever Issue 2 I have just created a gif screen-grab to show you what happens when I try to use the "No" option:
  4. Thanks clsource! It would be nice to learn more about this compilation feature. So far, I have not found anything that describes it in detail. Any good articles or forum posts on it?
  5. It took me a while to figure out what causes wireRenderFile() to fail processing its second (optional) parameter in ProcessWire 3.0.3, but finally I could pass those variables to the template file by using the "Yes (template file only)" option of "Use Compiled File?" setting in the admin panel. The default setting is "Yes (and included files)", but with this setting selected, wireRenderFile() cannot receive its optional array parameters. Is it a bug or a feature? I also tried to switch to "No", but this option cannot be saved, after saving the template it switches back to "Yes (and included files)". Again, bug or feature? All my template files begin with <?php namespace ProcessWire; so in this case is this automatic namespace updating necessary at all? I don't know how this compiling thingy works, so I do not know what the right answer to this "Use Compiled File?" question should be. Is it ok to use "Yes (and included files)"? Or should I use "No" (if it was possible)? Or "Yes (and includes files)" which renders wireRenderFile() sort of useless? Any help is appreciated!
  6. @rick: In this case we are back to square one, that is "processwire shouldn't be implying endorsement of 'anything else'" which is the current state we are in Without an easy to use ("shape it to your needs") frontend "framework", you cannot guide beginners/non-developers in tweaking the profile they use. In this case, we are talking about bloggers, small companies, etc, who need a reliable, easy to maintain CMS (ProcessWire) and want to tweak the frontend a little bit, but they do not want to "develop" anything. They just need useful tips and code snippets with step-by-step instructions on how and where to apply them. I know, this is not the basic idea behind ProcessWire, but the topic here is "PW Site Profiles are like WP Themes?", and we cannot solve it without anything pre-build for the frontend.
  7. 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).
  8. I do not know about others, but I have fallen in love with ProcessWire at first sight However, I hate social media and maybe it is not just me who does so.
  9. 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.
  10. I have just found this css framework (called Responsee III) the other day (actually, I've been looking for something like this for a while). It is not as "bloated" as (say) Bootstrap or Foundation, so it is easy to figure out what is behind the scenes, as it uses vanilla css so no sass/less or similar is used. This framework is not re-written from scratch every second year either. I tested one of its v2 based demo website by replacing the framework's files with the new versions found in v3, and nothing has changed on the frontend, so even upgrading the framework was as simple as replacing some files. A framework like this would be a good choice to be used for this "quick start site profile". People can customize it easily by using their own "custom.css" to overwrite the rules. Besides the css framework, the profile should support something similar that WordPress does right out of the box (standard blog features with categories). I also support (actually I am implementing my own PW version) a variation of the delayed output, when (e.g) basic-page.php only does this: $layout = wireRenderFile("layout/basic-page.inc.php"); and basic-page.inc.php contains the alternative syntax style template code, which is often preferred by beginners and people coming from WordPress and similar... Edit: I forgot the name and the link of the css framework, so I just added it...
  11. To reply to my own question: for simple selects, this might be a better option, I suppose: https://processwire.com/api/modules/select-options-fieldtype/ https://processwire.com/blog/posts/new-options-fieldtype-processwire-2.5.17/
  12. Thanks Jonathan, I have not yet used repeaters so far, but been wondering for a while when they could be used. Maybe for constructing simple select dropdowns when enum would suffuce?
  13. Pretty cool! It even has a "confirm" button, nice touch.
  14. 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... 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!
  15. I found this one to be the easiest to use: https://www.mamp.info/en/ You can find a lot of tutorials on the net on how to set it up. There are alternatives too, for example: https://www.apachefriends.org/hu/ Edit: and if you want to move it later on: https://processwire.com/docs/tutorials/installation-moving-and-troubleshooting/page5
  16. How about building these sections by using Repeaters? I'm new to ProcessWire, but as far as I understand, Repeaters are well suited for this type of page constructing task. Although, I do not know what happens, if you want to use a section on another page. Repeaters are kind of "hidden" in the admin too.
  17. Why not just do this: https://processwire.com/docs/tutorials/installation-moving-and-troubleshooting/page5 As far as I understand, there is no need to use the Profile Exporter in this case. However, if you want to start with a clean db, using Import/Export might be what you need.
  18. You're welcome.
  19. How about using <base href="<?php echo $config->urls->templates?>"> as the first child of the <head> tag? In this case you only need: <script src="assets/js/docs.min.js"></script>
  20. Hi Roland, Nice work! You might want to know, that by blocking the Google AJAX Search API the site will not get through the "preloading" phase, it gets stalled at the flashing circle in the center. I use Safari with Ghostery installed which is set to block anything Ghostery "knows about", but by whitelisting this script in question, the site loaded just fine.
  21. Thanks Charles
  22. Thanks, I've read that a few times Being new to ProcessWire, the way we install modules ("Type or paste in the "class name" for the module you want to install.) is still a bit confusing for me to use (how do I find out the proper class name? Sort of not obvious for newbies like me).
×
×
  • Create New...