Jump to content

TomPich

Members
  • Posts

    111
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by TomPich

  1. Hello again, So now that I have the basics of PW in minds, here is the most important question to be 100% comfortable : How can I get and process data sent with POST in a specific file, dedicated to this logic? Let’s take the example of a contact form (I know there is a module for that, but I want to be able to handle post data in other contexts). When I develop from scratch, the strategy would be to define a specific url to receive the post data, and then pass the data to a controller to handle them. What about ProcessWire ? Do I have to create a template, then a page with this template (to have an url) and then handle the data from the php file associated to the template? It seems a bit of an overkill. Actually, my question boils down to : I have a php file handling some logic, how can I create a custom route to this file? Again, many thanks to everyone who answered me so far.
  2. Thanks Bernhard, Interesting comparison, with which I may not agree at 100%. In my opinion, you are comparing end users of OS, with devs. For end user, I think PW is at least as good as WP. It is simple and straight forward. But for devs, PW is so much simpler. You don’t have to struggle against stupid native functionalities with custom functions like in WP, or implements stuff that would really have to be part of the core (like opengraph tags or even simply a description to each page). I don’t even mention the endless updates, with every time the risk of breaking something. So for me, it’s just easier to develop on Processwire. And after only about 8-10 h of learning (far less than I needed to learn how to create a custom template in WP). Anyway, thanks for the tip. I didn’t know you could add class properties on the flight in PHP. That was my first thinking, but I didn’t even try it. And for the <link>, that is exactly my use case. ? Thanks again
  3. Hello all, So I just finished my first website for a client using ProcessWire. That was a really nice experience and for now on, it will be my one and only CMS for professional purposes. I wonder why ProcessWire is not more used, considering that it is pure gold. I have two questions (I’ll ask the second one separately, as it’s not related to this one). Where to create a constant which will hold the version number of the website (to have a handy way to avoid .css and .js files caching problem) for best practice ? For now, I did it in the config.php file of the website (after all $config->xxx settings). Is there a smarter way to do this? Thanks again for your help.
  4. Great! Thanks LMD, that’s good to know. I will do it right away.
  5. Hello da², When I have time, I’ll look into this VS code config settings. PHPstrom is not free, so for now I’ll stick to VS code... Thanks for the tip about Formatter. It works perfectly. Processwire is really a jewel of smartness and simplicity. I just love it, and I’m happy to use a CMS again. It’s not something I have to fight against any more... ? And it’s very pleasant to know that there is a reactive and friendly community. Have a good day.
  6. Thank you for your answer. It’s already the case. The class is in a .module file, maybe it is due to that? –––– Okay, so I discovered that you can not import a class just like normal php application. This worked : $md_formater = $modules->get("TextformatterMarkdownExtra"); $content = $md_formater->format($her->content); I wonder, however, if there is a way to get the result directly with the input config, instead of doing it programmatically...
  7. Hello there, Back again for a new question. So I began a website for a customer and came upon a small problem that I can’t solve. I have a textarea field for which I don’t want the end user to be able to enter title or list, so I don’t want to use TinyMCE. It is supposed to be a simple paragraph. I decided to allow <strong> and <em>, so I thought using MarkDown would be a possible solution. I installed and used the TextformatterMarkdownExtra module, and it works fine, but VS code keeps reporting an error because it’s not able to find the class definition. Here is the code in the template : $md_formater = new TextformatterMarkdownExtra; $content = $md_formater->markdown($hero->content); When I implement a new instance of TextformatterMarkdownExtra (first line), VS code underscores it in red, saying that the class is not found. It can’t import it, neither. Apparently, in the final result, Processwire sorts it out because it works perfectly. But the error reporting is annoying because it may distract me from real errors. Am I doing something wrong? Many thanks in advance. TomPich
  8. Thanks @ngrmm. It’s definitly that! It’s so logic, I should have thought about that. ? Thank you @Krlos. But before I use any modules, I’d rather have a fair understanding of what’s going on under the hood. Cheers Thomas
  9. Thank you for your answer. That was quick! ? That’s indeed what I read. But, even without a php-template file, when the page is published and I enter the corresponding url, it uses the basic-page.php file to display the content. It seems to act as a fall-back template. I don’t understand why. Just to clarify the situation. The page name is informations-generales. It uses a template named "general_informations" with some fields, but with no template file associated. The page is published. When I enter [localhost/myprocesswiretestsite]/informations-generales/, I get the basic-page.php template displayed. Maybe I missed something in the config file.
  10. Hello there, I’m exploring Processwire and I really like what I discovered up to now. I would like to abandon WordPress and I have quite fair knowledge in both back- and frontend dev. So, from what I saw with Processwire, it seems to really fit my needs. Here is my question: I need a place to store global data (like phone number, socials links, website title, etc...) and some pictures that will be used in several pages (like a logo). As per my understanding, I created a page based on a template with all fields required. This page must not be displayed in the front site (and I didn’t create any template file for it). When I keep it unpublished, the title of the page, in the admin page tree, is strikethrough. That may be a bit confusing for the end user (i.e. my client). And I’m pretty sure that, if my client edit this page, they will press the "publish" button instead of "save + keep unpublished". So keeping it unpublished is kind of a lame option. If I publish it, it uses the basic-page.php file to render (although I read somewhere that if no template file is provided, the page will not be shown). So that’s not good either. Am I missing something? Is there some kind of best practice that I’m not aware of? Sorry if I didn’t RTFM enough, but I did some research and didn’t find the answer to my question. Thank you, Cheers Thomas
×
×
  • Create New...