-
Posts
2,920 -
Joined
-
Last visited
-
Days Won
17
Everything posted by szabesz
-
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.
-
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...
-
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/
-
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?
-
Pretty cool! It even has a "confirm" button, nice touch.
-
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!
-
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
-
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.
-
Migrating Pages (templates) to live site
szabesz replied to louisstephens's topic in API & Templates
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. -
You're welcome.
-
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>
-
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.
-
Thanks Charles
-
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).
-
Thank you very much, I've found it! I got the impression the it was "System Updater, Manages system versions and upgrades." which is installed by default, but I was simply wrong, I see.
-
Hello, I am struggling to figure out how to find this module in the admin. I'm playing with 3.0.2 and thought why not try this upgrade module to update to 3.0.3. I can see from the screenshots above that the module should show up under Setup, however, I have no "Upgrades" menu item. What am I missing here? I read the whole forum thread twice, the readme, but still clueless... Thanks in advance!
-
As far as I understand tibs (just correct me if I'm wrong), his issue is not about how to update PW with one line of cli command or how to update with a few clicks, but it is about how to utilize the official git repo, since this method would fit his workflow, and he thinks that it might be possible to support both the "ProcessWire development" and personal projects based on a workflow he describes.
-
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.
-
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.
-
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.