toni
Members-
Posts
65 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
toni's Achievements
Full Member (4/6)
25
Reputation
-
Hi @SamanthaWalker In the end I took an easy path and ended up with two templates. One for mail sending which is actually a cerberus markup and another for web rendering with common browser css. I choose the one or the other based on the get var processwire automaticully sets with promailer.
-
ah great good news! thanks will give it a try!
-
Oh wow @monollonom thanks you so much! But from what I read I then are forced to use Mailjet? As I will need an API key? I already have a mailserver in place that I would use for sendout.
-
Hello everyone, I'm not sure where this post fits best. I hope here is okay. I am planning to implement a newsletter with ProMailer. As far as I understand, ProMailer sends an existing page, which means that the page can be used for sending and for viewing in the browser, correct? My idea was to write 90's table markup as newsletter clients are very picky. However, the documentation names Foundation for Emails MJML (Mail Jet Markup Language) Maizzle Cerberus as possible (CSS) frameworks. My question is, does anyone have experience with one of them? Can one of them be used to use markup for the browser and email client at the same time? Is one perhaps used for the Processwire newsletter? Best regards Toni
-
Wordpress like option to create free content structure
toni replied to toni's topic in General Support
Hi Andreas, Thank you so much! This was exactly the answer I hoped to hear! Best, Toni -
Hi Community, I hope this very basic hasn't been asked before. As with processwires repeater fields Wordpress has the option to add unlimited content items to an article. The difference is, with processwire repeater field authors can add a defined set of inputs fields. For example ten headline and body items. With Wordpress I can do the same (see screenshot below), but the User can choose which content/input type should be added. So instead of adding a bunch of headline and body fields, authors are free to choose for example a headline followed by an image gallery followed by an article Text followed by an image description … Is it possible to do something similar with processwire repeaters (or an other field type) that allows authors to "build" their needed content structure (without creating a new template that definies the exact fields)? Thanks for your help, Toni
-
@wbmnfktr thanks for starting this topic, very interesting! After reading all replies I think I get your point. I mostly develop with Django (Python) where DRF gives a powerful standardized API centered around models. Still, as you said, while working with other systems I always miss processwire for it's flexibility ;) From what I understood other systems include a REST API out of the box (more or less) where processwire "forces you to write some lines of codes" … and I guess that is the strength of processwire. It does not force you into a one fits all solution. My two cents: For an upcoming project I tested different solutions. With AppApi indeed I got resonable results in not 2 but 15 minutes. With JWT included, nice! (thanks @Sebi) For smaller needs URL hooks … for bigger needs –without auth– PageQueryBoss … –with auth– appAPI, is my way to go. But yes +1 for a core integrated solution that publishs pages based on standards . Doing so it would even be easy to get a clear, understandable and standardized API Documentation.
-
Hi @Sebi thanks for your reply. I've thought about it again. The website where I'm working on will be fully headless. The URLs mappings are then handled by a vuejs frontend. So in this case it does not matter much if it's controlled by a var or URL segement (Forgot about this when asking :roll_eyes:). The requirements of the site are still a bit unclear but it looks I do not need the c-u-d of C-R-U-D. This is why I most likely will just build a small API with the new URL Hooks. This is how I would handle the language there (Quick and dirty example): $this->wire()->addHook('/{lang}/api/books', function($event) { $books = $this->pages->find("template=books"); $response_arr = []; foreach ($books as $book){ $current_page = []; $current_page['title'] = $book->getLanguageValue($event->lang, 'title'); $current_page['author'] = $book->getLanguageValue($event->lang, 'author'); // ... array_push($res, $current_page); } header('Content-Type: application/json; charset=utf-8'); echo json_encode( $response_arr ); }); But it's great to have your Extension available in case there is some "heavier" API to build ;)) @Jukka Nice to hear!!
-
Return json from __execute in backend module
toni replied to toni's topic in Module/Plugin Development
thank you so much @kongondo now it is clear! -
Return json from __execute in backend module
toni replied to toni's topic in Module/Plugin Development
Ok got thanks a lot to both of you, I've tested with the autoload bool but did not know that it does not work with backend modules. Am I right that backend modules are defined by extending Process where 'satelite autoload modules' extend Module? Thanks a lot for your patience and help! – T -
Return json from __execute in backend module
toni replied to toni's topic in Module/Plugin Development
Wow this is fantastic! @kongondo May I ask, do you know of an example where I can see how to correctly set a hook like I've tried within the init method but it does not what I would expect: class ProcessMyModule extends Process { public function init() { $wire->addHook('/hello/world', function($event) { return 'Hello World'; }); } ... -
Return json from __execute in backend module
toni replied to toni's topic in Module/Plugin Development
thanks @kongondo -
Hi, sorry if this might be a super easy one but I couldn't find and answer in https://github.com/processwire/processwire/blob/master/wire/core/Process.php In a custom backend module I can just return html that gets rendered. How would I create a json endpoint that can be used from other pages of my module? This is what I've tried public function ___executejson() { return json_encode(array("a"=>"b")); } And from I an other page in frontend fetch('http://localhost/pw-dev/processwire/test-list/json') .then(response => response.json()) .then(commits => console.log(commits)); Obviously this is the wrong way. Thanks a lot for your hints Toni
-
Ah nice, thanks Zeka. This clears things up!
-
Hi experts, as my module is growing, I'm looking for ways to split up my code. I've seen instead of returning markup from the main module AppApi has excluded those to a views folder. https://github.com/Sebiworld/AppApi/tree/main/views Can someone explain how this is wired together, how each __execute* knows what to render? Thanks a lot for your help – Toni