-
Posts
85 -
Joined
-
Last visited
-
Days Won
3
Everything posted by TomPich
-
So, @da², @MarkE, @gornycreative, thanks to you guys, I am able to do what I aimed for. Once again, I’m baffled with ProcessWire API smartness and simplicity. Thanks you again, guys.
-
Thanks @d'Hinnisdaël. I was editing my post because I found the solution. The value is stored as an actual date field type. As I need to get the date in french, using IntlDateFormatter, I have to store them as timestamp (I don’t want to install the whole traduction pack just for twelve months... ?). See the --- edit--- part of my last post.
-
Hey there! A quick, and, I’m sure, simple question about the Dashboard. I have a panel / collection. I want to display a date which is stored as timestamp (so I can display it properly in french in the front, with IntlDateFormatter). I can’t figure out how to format this timestamp date in the dashboard : $panels->add([ 'panel' => 'collection', 'title' => 'Meetings', "size" => "full", 'data' => [ 'collection' => 'template=meeting, limit=10', "dateFormat" => "d-m-Y", "columns" => [ "title" => "Meeting", "date" => "Date", ], 'sortable' => true, ], ]); }); The "dateFormat" option doesn’t do anything, I just get the timestamp. Any clue? Thank you ? ––– Found it ––– In the DashboardPanelCollection.module file, line 170, I found that : // Special case: timestamp fields // disabled for now (formatted datetime values work just as well) elseif (false && $fieldtype == 'FieldtypeDatetime') { $content = $this->datetime->date($this->dateFormat, $page->getUnformatted($markup)); } I got rid of the "false &&" and it works perfectly. So just my two cents : formatted values don’t work just as well : in my case, due to french language, I have to format the DateTime value from timestamp for the front site. And I don’t really care in the admin, but timestamp is a no go. ?
-
Waouh, thank you so much for detailing the steps. I have some food for thoughts. I’ll try to get my way into this.
-
Thank you @da² So the actual role of the module would just be to handle the practitioner pages in a more convenient way than standard pages (like showing each page data in a line of a table) using PW API. Sounds interesting, and not too complicated. I will dig deeper in that direction in the coming days.
-
Hello to all, So I just finished my third website with PW and I love it more and more. These were very simple sites, though. I would like now to explore deeper how to create modules for specific tasks, and I need some guidelines from you guys, as I don’t really know where to start from. Let take this case : I had, a few months ago, to do a website that has a public list of physiotherapists. Each member has some basic data. The client must be able to update the data from the admin side and add a picture. On the front, there is a main page with a list of all practitioners and each practitioner has their own page. All the initial data were exported from their previous Joomla website in a CSV file + picture for each member. I know how to import a CSV file content in a PHP array, and how to import the CSV data in a specific table in the database, so I can go either way. I was able to implement all that on WordPress (but I decided to quit WP). My goals – learn how to : import these data in PW in an automated way. make a specific admin page that allow CRUD operation on these practitioners. easily export this list when needed, in a convenient format (CSV would be the best). I guess this use case must be fairly common (importing existing data and managing them from PW admin). My questions : What would be, according to you, the best way to go : use a dedicated table in PW database (option A), or create a page for each practitioner (total of 50-100 practitioners) (option B) ? The last option sounds like making data export more complicated, but would benefit from PW native functionalities. Which docs / posts / tutorials would you recommand for a starting point ? I saw some stuff, but I still feel confused where to start from. In the meantime, I will start with ProcessHello module from Ryan. Thank you guys, for your time and your help. Even short answers would be greatly appreciated. ?
-
That’s absolutely great! Exactly what I needed.
-
Thanks for your answer. I just noticed that sometimes it works, sometimes not. I’ll have a deeper look at this.
-
Hello all, I have a tinyMCE field and a multiple images field in the same page. I would like to add a link to an image inserted in the tinyMCE field, something like : <a href="xxx"><img src="xxx"></a> I can’t achieve that : when I add a link to the image (after selecting the image in TinyMCE), the link appears inside <img></img> tags (wtf ?) and then it’s getting cleaned on submit. Linking some text works perfectly, though. Is it a bug, or am I doing something wrong ? Thanks in advance!
-
Pageimage: ksgcenter.0x260.webp - not a supported image type
TomPich replied to fisnik's topic in General Support
+1 to the question above ? -
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... ?
-
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 I would gladly do that, if I knew where this button is ?. Is the "thanks" trophy? Thanks.
-
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
-
@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?
-
Allow some HTML tags in textarea (without using RTE)
TomPich replied to TomPich's topic in General Support
Thanks for your advice. I also got to that conclusion. A restricted TinyMCE field with inline tool bar. -
TinyMCE toolbar configuration : default vs field specific configuration
TomPich replied to TomPich's topic in General Support
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
-
Sounds like a good idea. I’ll have a look on how to do this. I have currently no idea.
-
Creating custom route to a specific php file for logic handling
TomPich replied to TomPich's topic in Getting Started
Like I said, pure gold... ? Thanks Bernhard. I’ll dive into it. Edit : OK so I tried it, and it worked like a charm ! ? -
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.