-
Posts
101 -
Joined
-
Last visited
-
Days Won
3
Posts posted by TomPich
-
-
Thanks Brendon. Happy to know that I’m not blind.
I will give a thanks trophy anyway. People in this forum are so friendly, if I can boost their ego, it will be my pleasure... ?
- 4
- 3
-
Hey everyone,
A short and easy question about this forum. I posted some questions before and always got a helpful answer. I keep receiving saying
Quote"Help others by going to the topic and use the 'Mark as Solution’ button on the post with the best answer"
I would gladly do that, if I knew where this button is ?. Is the "thanks" trophy?
Thanks.
- 1
-
I had the same problem today. I can confirm that the solution above works. Just add $config->dbCharset = 'utf8mb4'; to the config.php file in the site folder.
My DB collate is set on utf8mb4_general_ci and it works perfectly. I can past emoji character in a TinyMCE field. Thank you @Raymond Geerts
- 1
-
@d'Hinnisdaël I investigated a bit more in the problem and here is what I found.
For the field postdate (a datetime filed), what’s in the blue borders (see attached picture) is the date format in the front part of the website.
I can format the date in the dashboard with the entry in the green borders – I don’t understand the difference between these two fields.
But it seems that whatever format I enter in the panel configuration ($panel->add(...)) has no effect.Sorry, the screenshot is in french, as I wanted to learn how to install PW core translation.
It’s not urgent. I will try again on a clean new install just to see if I can get this behaviour again and I’ll let you know. Enjoy your trip.
-
Thanks d’Hinnisdaël. I will do that.
-
Hey there. This is a wonderful work.
I’m new to ProcessWire, and I just tried this module for a couple of hours. Everything works fine except for a very small problem with dateFormat.
I have the following code :$panels->add([ 'panel' => 'collection', 'title' => 'Articles', 'data' => [ 'collection' => 'template=blog-post, limit=10', "dateFormat" => "Y-m-d", "columns" => [ "title" => "Titre", "tags" => "Tags", "postdate" => "Date de publication" ], "actions" => ["view", "edit", "trash"], 'sortable' => true, ], ]);
Everything is fine, but I get the postdate like "12 October 2023 9:12 am", whatever I use in the dateFormat value (I’d expect "2023-10-12" in the example above). Can someone please tell me what I am doing wrong?
-
Thanks for your advice. I also got to that conclusion. A restricted TinyMCE field with inline tool bar.
-
Hello to all,
I have a very strange problem. I have a staging site at https://dsc-1024.situp-webcreation.com. It was running okay since this morning. I made some minor changes and now I get blank page and 404 error.
–– Solution
It seems I’m tired. It had uploaded the wrong database... ? -
OK, so that explains why I can get the updated toolbar buttons if I erase all content of the Field>Input>Toolbar. It recreates the buttons based on the default toolbar.
Thanks a lot. I will correct the title of the topic without mentionning a bug, because it’s not a bug! ?
-
Hello all,
I think I found a bug (or maybe I’m doing something wrong?) when trying to configure TinyMCE toolbar.
I made a copy of the TinyMCE default settings file defaults.json in the site/modules/ folder, entered the link to this field in TinyMCE module options (Default setting overrides JSON file) and customized the new file a bit. It worked perfectly. Then, I tried to delete some buttons (blockquote). But it is still visible. Tried to add some predefined one (removeformat). It didn’t show up.
Then I tried to do the same on the original defaults.json file (after removing the link to the customized setting file). Again, everything worked except when I try to modify the toolbar content. It sticks to the same buttons : "styles bold italic pwlink pwimage blockquote hr bullist numlist table anchor code" whatever I try. Is that a bug ? From TinyMCE itself? Or its integration in ProcessWire?
Please enlighten me,
Again, thanks in advance and good day to all.
-
Hello guys,
I have a field that is supposed to be a simple paragraph inside a homepage section. The user is not supposed to be able to insert headings, or list, or whatever block tags. But I still want them to be able to use <b>, <strong>, <sub> and that kind of inline tags. MarkDown Parser would almost do the job, but I’m not 100% happy with the fact that you can’t have <b> and <i> tags with it. <strong> has a semantic meaning that <b> doesn’t have (same for <em> and <i>). And using both of these tags (<strong> and <b>) allows you to apply different CSS rules (like bold and primary colour for <strong>, and only bold for <b>).
So I was wondering if there is a way to allow certain HTML tags in a text or textarea field. I saw that there is a Strip Tag option in the Input tab, but it does not allow you to specify allowed tags, like with the strip_tags PHP function...
Have a nice day
-
Quote
I'm using file modification timestamps
Sounds like a good idea. I’ll have a look on how to do this. I have currently no idea.
-
Like I said, pure gold... ?
Thanks Bernhard. I’ll dive into it.
Edit :
OK so I tried it, and it worked like a charm ! ?- 1
-
Just a tip, it may be useful to someone :
I tried to set $config->version in config.php (site folder), but, no matter what value I enter, I get Processwire version.
So I defined $config->site_version, and it worked like a charm! -
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.
-
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
- 1
-
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.
-
Great! Thanks LMD, that’s good to know. I will do it right away.
-
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.
-
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...
-
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
-
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
- 1
-
Thank you for your answer. That was quick! ?
QuoteAs long as you don't create a php-template file for it, you will be not able to display it under it's own path.
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.
-
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
Pageimage: ksgcenter.0x260.webp - not a supported image type
in General Support
Posted
+1 to the question above ?