Leaderboard
Popular Content
Showing content with the highest reputation on 01/11/2022 in all areas
-
3 points
-
Assumes "categories" is a multiple Page Reference field and that you have a hex colour defined on each category page: $wire->addHookAfter('ProcessPageListRender::getPageLabel', function(HookEvent $event) { $page = $event->arguments(0); if($page->template == 'accommodation') { $out = ''; foreach($page->categories as $category) { $out .= "<span class='uk-label' style='background-color:$category->hex_colour'>$category->title</span> "; } $out .= $page->title; $event->return = $out; } });2 points
-
This week we have ProcessWire 3.0.192 on the dev branch. This is about 20 commits ahead of the previous version and contains 11 issue fixes and 5 pull requests, along with various other updates. PR code contributors in this version including Daun, MrSnoozles, Radon8472, BernhardBaumrock and Tyde. Thanks! For more details see the dev branch commit log. In addition to core updates, in recent weeks I've also been working on a new module similar to the PageAutosave (developed for the admin) except that it is for front-end forms. It works with any front-end form (whether home brewed or from something like FormBuilder) and remembers the entered form values every time a field is changed. If the user doesn't submit the form, they get an email with a link to finish filling out the form after a configurable period of time. This is especially nice for order and reservation forms. Accompanying the module is a separate Process module that lets you view all the forms in progress in the admin. Each form entry has its own unique URL, making them easy for users to return to, from any device. Once the user submits the form, the data gets removed from the pending submissions database. This is something I've been meaning to develop for awhile, and with the admin PageAutosave module still fresh on my mind, I thought now was a good time to do it. Thanks for reading, Happy New Year and have a great weekend!1 point
-
For anyone interested, I have created a set of placeholder images to be used for webshop projects and such. Should be useful for fellow Padloper 2 testers :) Download it from over here: https://szabesz.hu/_dl/pw/shop/dummy_webshop_images_v1.0.0.zip Note: some items have color variation images included as well.1 point
-
@horst Sorry, I just disabled it all together for now ? I don't know how to correctly specify the pattern to include curlies, as the pattern syntax uses curly brackets itself ? It's best if someone more knowledgeable helps us both ?1 point
-
I'd be interested to see that code to see if there is something I can do to prevent Tracey from not capturing that error and breaking it from loading.1 point
-
That’s how it’s supposed to work. You can also use the whole path: $pages->findOne("template=whatever, path=/es/donde/esta/la/pagina/")1 point
-
A few days ago I stumbled upon this old module, which had been laying in the modules directory of one of my sites since 2017 in a half-finished state. I have no recollection why I left it like that, but figured it might be useful for someone, so here we go: https://github.com/teppokoivula/Snippets https://processwire.com/modules/snippets/ Snippets is a tool for injecting front-end code snippets (HTML/JS/CSS) into page content. The way it works is that you create a snippet — say, a Google Analytics tag — and then choose... which element it should be tied to (there are some pre-populated choices and custom regex option), whether it should be placed before/after said element or replace it entirely, and which pages the snippet should apply to. The "apply to" option also has some ready to use options (such as "all pages" and "all non-admin pages") or you can select specific pages... or use a selector. Snippets are regular markup, with the exception that you can use values from current page (behind the scenes the module makes use of wirePopulateStringTags()). Available hooks: Snippets::isApplicable, which receives the snippet object and current Page object as arguments and returns a boolean (true/false). Snippets::applySnippet, which receives the snippet object, page content (string), variables (an object derived from WireData), and an array of options for wirePopulateStringTags() as arguments and returns the modified page content string. That's just about it. It's a pretty simple module, but perhaps someone will find this useful ?1 point
-
There's no simple way because the home page is a special case in PW, but some similar topics with suggestions:1 point
-
Hi @Krlos You can do it by hooking ProcessPageListRender::getPageLabel like here https://github.com/FlipZoomMedia/PageHitCounter/blob/master/PageHitCounter.module#L460 https://github.com/FlipZoomMedia/PageHitCounter/blob/master/PageHitCounter.module#L9501 point
-
Hi @johnstephens Did you check your browser console for errors?1 point
-
Hi @Malinda. Welcome to the forums and ProcessWire. We have a jobs board here, in case you need it in future: https://processwire.com/talk/forum/22-jobs/ Yes. That is to be expected. For YouTube, you have three options at least: 1. Tell CKEditor to stop stripping your iframe, as explained here: 2. Use Hanna Code. An example can be found here: There are simple Hanna Code examples but I cannot find them at the moment. 3. Use one of the available Video embed modules: https://processwire.com/search/?q=video&t=Modules You would need to be a superuser (the higher up level [highest in fact]) to be able to access ProcessWire templates. However, the files that go with the templates (template files) and styles are stored in your directory/folders where your ProcessWire installation files are stored (on your webhost / server). Access to them is usually via FTP or a CPanel-like dashboard. The template files will be under /site/templates/. The location of styles is a matter of choice for your developer but the usual locations are /site/templates/styles/ or /site/templates/css/ or similar. By head area I assume you mean the <head></head> of a template file or an auto-appended file like _main.php (/site/templates/_main.php). The JavaScript would be picked up, yes. However, the code does not (shouldn't even, I would argue) go into CKEditor. It would be stripped out anyway by CKEditor. I am not sure what you mean by code in this case as well. Usually, that code would go into your /site/templates/scripts/main.js or /site/templates/js/main.js. The main.js is usually a custom file created/amended by your developer so it could be named something else, even scripts.js. I hope this helps. It would be helpful to know the what version of ProcessWire you are using. All the best ?.1 point
-
Hi, Have you had a look at one/some of these PageList modules ? There's also many discussions in the forum related to your query : You may also want to have a look into the ProcessWire hooks system. Hope this helps1 point
-
This would be some kind of a dream for me to have in ProcessWire. ?♂️1 point
-
Depends on what you guys want me to prioritise. I haven't looked at it in detail but from the expression of interest form it seems that Stripe is pretty high up the list. <?php namespace ProcessWire; $this->addHookAfter('PadloperCart::getProductPrice', null, 'customProductPrice'); function customProductPrice(HookEvent $event) { $product = $event->arguments('product'); // get the product field with the price $stock = $product->padloper_product_stock; // grab the price $price = (float) $stock->price; if (wire('user')->name ==='my_best_friend') { $price = 0.01 * $price; } $event->return = $price; } Padloper is very versatile. You can use it as a POS using the backend only; as a full ecommerce solution with a front and backend or as a headless CMS or API only shop. :-).1 point
-
Just a quick question: I cannot see any sign of promotional coupons/discounts in the screenshots nor in the text of the docs. When do you think you might be able to start working on it in the future, the earliest? Regarding the projects I need to work on, coupons/discounts and Stripe payment is the only major missing bits I could spot so far. It would be great to see them being implement during the beta period. As far as coupons/discounts are concerned, first and foremost I am thinking of a developers' API (and/or hooks?) upon which we can implement virtually anything we might need to. Usually my clients do not even want to touch this area in the webshops I manage, so for me there is no need for an admin GUI at all. Sure, being able to manage coupons/discounts in the admin will be a must for many, but to start with, a versatile way to tap into the calculation of the Total price would be preferable as most of the time I am asked for promotional methods which often not pre-made in any system out there at all. And this also includes adding gift items to the cart, and sometimes such gifts are not even sold in the store, being promotional gifts only. So I am mainly interested in an API which allows us to modify the Cart / Coupons / Subtotals / Shipping / Insurance / Total based on any custom requirement. Meaning adding any customs cost as well, when required. I hope this makes sense :)1 point
-
I pushed a new release fixing an issue from the previous update: I forgot to update the name of the inputfield as well when switching from templates to allowedTemplates, resulting in an issue when trying to add/remove templates. You might need to uninstall / reinstall the module, though it shouldn't be an issue to do so.1 point
-
This is now possible using owner selectors! http://processwire.com/blog/posts/processwire-3.0.95-core-updates/ $pages->find('template=repeater_collections_detail_images, your_repeater_field.owner.collections_detail_designer=123, include=hidden, sort=name');1 point
-
To give you another option: I almost always use Reno and add an admin stylesheet to it via a hook in init.php $this->addHookAfter('ProcessController::execute', function (HookEvent $event) { $this->config->styles->append("/site/templates/css/adminstyles.css"); }); and CSS to style stuff like Repeater: .Inputfields .Inputfield_auswahl404.InputfieldRepeater>.InputfieldContent .InputfieldRepeaterItem>.InputfieldHeader, .Inputfields .Inputfield_auswahl404.InputfieldRepeater>.InputfieldContent .InputfieldRepeaterItem>.InputfieldHeader span {background:#59261E;} .Inputfields .Inputfield_auswahl404.InputfieldRepeater>.InputfieldContent .InputfieldRepeaterItem>.InputfieldHeader:hover, .Inputfields .Inputfield_auswahl404.InputfieldRepeater>.InputfieldContent .InputfieldRepeaterItem>.InputfieldHeader:hover span {background:#F5B92C;} where .Inputfield_auswahl404 your fieldname is. Like Robin S said, inspect with your DEV tools..1 point