-
Posts
7,479 -
Joined
-
Last visited
-
Days Won
146
Everything posted by kongondo
-
Exactly. The more reason you should start migrating
-
Yes, it's still true today (that's PW 3.x). If you can though, I'd urge you to migrate to PDO
-
is is possible individual field setting for different template ?
kongondo replied to adrianmak's topic in General Support
Checks if you already have an image in that image field. If count returns something, it means there's an image in the field already. It presupposes you've never added more than one image before. If its empty, you can add an image, if not empty, do something else. This is near-pseudo code so things can be changed around...Edited the code above for clarity -
is is possible individual field setting for different template ?
kongondo replied to adrianmak's topic in General Support
if($page->template == 'one-image-template') { if(!count($page->multi_image_field)) { // add image, none added yet } } else { // add as many images as you like } -
This works for me $c = $page->child;// page here is the parent page //$repeaterItems = $page->repeater_test;// repeater with 6 fields (email, file, integer, text, single image, multi-images) x 2 repeater items //$c->repeater_test->import($repeaterItems);// alternative import $c->repeater_test->import($page->repeater_test);// import (into an existing repeater field in the child page) $c->of(false); $c->save('repeater_test');
-
Edit @see post below...Use import instead! (duh!, early morning!) ------------------------------------------- The process then would be: Create the child page The child page's template should have the repeater field ready to receive items Add a repeater item(s) to the child page. See this (using API to add repeater items)....getting values from the parent page Maybe there's a different way of doing this....not sure...yes...import!
-
Excluding fields in repeater when copying using API
kongondo replied to alexcapes's topic in API & Templates
More than a year later..... From the docs $building = $page->buildings->first(); // or whatever item you want to remove $page->buildings->remove($building); $page->save(); -
Or you, the module author, can click to edit the module and save (no need to make changes), and PW will fetch the latest version immediately.
-
Yeah, ta. But that means I can't use System Notifications. It reverts to the old notifications. It also means that I need to tell users of my module to have that setting off (Leave them alone) if they want to see notices in modals. Not great. Anyway, thanks guys. Currently, I am using a custom jQuery solution to show notices in modals....but still curious why System Notifications is turned off in modals
-
Benjamin, how please? I can't seem to find that setting.
-
Hmm..I wonder what the reason behind that is.
-
Yep...That was it. System Notifications notices don't show up when in a modal. The 'normal/older' notifications show up OK in a modal.
-
I need to test with the older/original PW notifications then. See below for test with the 'new' System Notifications module: Normal window notices show up OK; modal window ones do not show up at all.
-
Hmm. They've never showed up for me. What I want is for notices to show up as normal when I save, regardless of whether I am in a modal or a normal window. When I save any page in a modal (e.g. try editing a page in Batcher or a post in Blog) or when I edit and save any custom module page (e.g. some settings page in Media Manager) in a modal and call $this->message() or $this->error(), they never get shown.
-
Media Manager version 009 (released 16/12/2016) Happy to announce the latest release of Media Manager. Changelog Filter Profiles: Feature enables configuring of various media filter interfaces (similar to ListerPro). This feature was requested here. Please see otes below Filter Profiles Usage To use the so-called Filter Profiles feature, you will first have to enable it in your settings (see images below). Head over to any media view. You will see a 'config' tab next to the Filters tab. Click on it. It will open a modal Create your profiles (one at a time). These are added to a table in that modal view. Click on the title of a filter profile to configure it's filters. Moves to 'single filter profile edit view' Set a filter as active by selecting it in the dropdown at the top of the modal view (#2) To delete one or more filter profiles, click their trash icon and save (there's a checkbox to confirm action) Close the modal. The Media Manager Library will reset and if you set an active filter in #5, your Media will be filtered according to your settings Currently, any user can create filters. Depending on your feedback, this might change. We might also add other features, e.g. locking down filters so they cannot be deleted. OK, that's it from Media Manager for this year. Hope it's been fun! Thanks.
-
Welcome to ProcessWire and the forums @vvanasperen . A theme, in the sense you describe it, is a so-called 'site-profile'. We don't really have themes in ProcessWire. Personally, I think a great place to start is reading the docs, the basics. My motto would be I can make it all nice and shiny (theme) later, once I get to know the basics. If you already have a PHP background, great, you will be quite comfortable. If not, you will need to learn a few PHP basics in order to use ProcessWire, Here's a couple of docs to get you started: https://processwire.com/docs/tutorials/ http://processwire.com/api/variables/page/ : must know http://processwire.com/api/variables/pages/ : must know Sorry, typing in a hurry...but others will chime in am sure.
- 5 replies
-
- 1
-
- collection
- collector
-
(and 1 more)
Tagged with:
-
You should be able to do your 'automatic checks' in getModuleConfigInputfields(). If the checkboxes are on that screen then I see no harm in letting them be part of the config. See how we do it in Blog. If Blog is installed, we show a different form, if not, we show the pre-install form. Search the forums for that method for simpler examples. It's a static method, mind you, so you will be 'wiring' a lot
-
I am not sure you can do that (without hooking into something). Module configs are are processed internally by ProcessWire. It will correctly save radio values, checkboxes, etc. The module config form has the ID: ModuleEditForm. Is there any reason you want to also process them? If, on the other hand, you need access to the saved configs, you get those using: $happyImageConfigs = $modules->getModuleConfigData('HappyImage');// assoc. array
-
E-Commerce with Processwire - Accounting
kongondo replied to FrancisChung's topic in General Support
Yes. It's quite advanced to be in the cheatsheet . Besides the links below, you can Google (forums) $database (or even PDO) to find out more if you wish. Also, just grepping $database in ProcessWire core files, especially Fieldtypes should yield interesting stuff API documentation on ProcessWire site: Class Database More API Docs: Class Database Example usage: Blog and Matrix modules.- 5 replies
-
- 3
-
- e-commerce
- accounting
-
(and 2 more)
Tagged with:
-
E-Commerce with Processwire - Accounting
kongondo replied to FrancisChung's topic in General Support
You can still use your SQL in ProcessWire, either raw or using $database variable. I have done this myself in various modules. Also, maybe not to the extent you want, but Padloper generates sales reports.- 5 replies
-
- 3
-
- e-commerce
- accounting
-
(and 2 more)
Tagged with:
-
Add the field to your user template Do what you want ...e.g. $process = wire('process'); $u = $process->getPage();// this is an object $id = $u->id; return $id;// will return 40 for guest, 41 for superuser, etc... //return $process->className();// would return ProcessUser. Useful to know if you are using the field elsewhere and want to do different things based on context // return $u->email;// etc... Edit: But that only works when you are actually editing that page, of course