-
Posts
7,480 -
Joined
-
Last visited
-
Days Won
146
Everything posted by kongondo
-
Usage of own php interfaces in modules possible?
kongondo replied to blynx's topic in Module/Plugin Development
Interesting topic! I'm very curious if/how this will work (if you get past the not found issues.). Is this of any help? https://stackoverflow.com/questions/3704841/php-interface-problem-class-not-found Back to ProcessWire, the processwire/wire/core/Module.php file has some important documentation at the top about requirements for modules, e.g. modules need to implement the module interface, etc. -
[SOLVED] Chechbox group: How to show selected options on frontend form
kongondo replied to jacmaes's topic in API & Templates
Excellent. Glad you got it sorted .- 4 replies
-
- 1
-
- checkboxes
- frontend
-
(and 1 more)
Tagged with:
-
[SOLVED] Chechbox group: How to show selected options on frontend form
kongondo replied to jacmaes's topic in API & Templates
Edited code above...but still incomplete...- 4 replies
-
- 1
-
- checkboxes
- frontend
-
(and 1 more)
Tagged with:
-
[SOLVED] Chechbox group: How to show selected options on frontend form
kongondo replied to jacmaes's topic in API & Templates
Untested, quickly thought through, blah blah.. From the docs you linked to: Under Manipulating options on a page from the API, see Getting all possible options // @note: forget this code! // get the Select Options Field $field = $fields->get('licences'); // get all the defined options $all_options = $field->type->getOptions($field); foreach($user->licences as $licence) { // check 'checked' status $checked = $all_options->get("id={$licence->id}") ? ' checked': '';// untested! $content .= "<label for='$licence->id'> <input name='licences[]' type='checkbox' id='$licence->id' value='$licence->id' $checked>$licence->title</label>"; } Edit: I am not sure my logic above is correct but I have to run. It might be you need to loop through the $all_options instead. I'll check back later..., sorry Try this one instead. @note: incomplete, but gives you an idea // get the IDs of selected options @note: untested! + pseudo-code $selectedOptions = getArray($user->licences);// untested! pseudo-code; Here, manipulate to get IDs! // @see: https://processwire.com/api/ref/wire-array/ foreach($all_options as $option) { // check 'checked' status $checked = in_array($option->id, $selectedOptions) ? ' checked': '';// untested! $content .= "<label for='$licence->id'> <input name='licences[]' type='checkbox' id='$licence->id' value='$licence->id' $checked>$licence->title</label>"; }- 4 replies
-
- 3
-
- checkboxes
- frontend
-
(and 1 more)
Tagged with:
-
Is there a particular reason for this? Couldn't you just show a message such as 'no posts found in this category'? If the parent of this categories is the current page, why not just use $page->children rather than parent=$page->id? I see no way of doing this using one selector. $pages->count() is quite efficient actually. I'm no expert but I don't think 5 - 30 will hurt. In some cases (not necessarily the present case) this is the way to go. Have a look at $database.
-
Aah, I didn't know that.
-
$this outside class context shouldn't work as well...
-
[solved] iconv() in sanitizer.php error during module installation
kongondo replied to bot19's topic in General Support
Sorry, I've been a bit busy. It has nothing to do with hidden too deep. In fact, it is not hidden. I follow the topic and am also aware of unread posts . What @matjazp said. I don't know how I missed that error. Check if that resolves your error. This thread in an external forum suggests that AMPPS has iconv disabled by default. So, you'll need to enable it. ProcessWire requires iconv support to work; did it not throw an error when you installed it? -
Hi @bot19, I've been a bit busy with other stuff. I see from your other thread that the issue is not Blog-specific but a general ProcessWire issue. Let's talk there.
-
Typo?
-
Mike is using PW 2.3
-
Thanks for the clarification @Robin S. I appreciate the comments, they are helpful. The things that I was unsure about I have asked for clarification and you've provided this. I am passionate about all my modules, both commercial and free. I would never knowingly release a module that is half-finished . In this regard though, I must apologise to all VPS users because there has been an oversight on my part. I'll explain in a minute. My workflow is that I develop my modules in ProcessWire 2.7 using Reno Theme. I then test in the default admin theme. When I have everything working and looking as it should (PHP, JS, CSS, inside repeaters, etc), I repeat the process in ProcessWire 3.x. There are some cases where I even have Reno Theme-specific CSS classes, to make sure everything works fine irrespective of the theme. In the case of the last version of VPS, I now realise, I forgot to test using default theme in ProcessWire 3.x and for this I apologise to all of you. I am glad Robin caught this. I am equally very curious why others didn't notice this. It can only mean, either you don't use the default theme, or mainly use ProcessWire 2.7 or etc? Either way, I will fix this. And it is Robin. Please don't hold back! Like I said, I was unsure about some statements and you've clarified them. To all, please, don't hold back on the feedback. Not wanting to repeat this statement everywhere, this goes not just for VPS, but for all my modules, free and commercial. However, I can't promise to implement every suggestion since I need to consider things like backward compatibility.
-
@Robin S, I don't know what you mean by this. Are you implying that I don't care about the visual details of my modules as long as they work? Given that this is a commercial product, it could be insinuated that I'm just after the buck?
-
Mods can do it but let's leave this here to help the next guy.
-
Currently no. I will look into this, maybe start with text fields. In the code, I see I had this previously. I cannot remember why I commented it out; will look into it. Good idea; Will add to next version Thanks for catching this. Will amend. Sorry, I don't understand this one. Please clarify, an illustration maybe? Thanks. They do, in my case. See GIF below. I've tested in PW 2.7. Will need to do further tests in PW 3.x Looks fine here. Must be some CSS issue. Will investigate. Looks fine to me (in different resolutions); see below. Must be your browser. What browser are you using? Ditto. Strange. I'm not seeing that here (see my demo) nor have any other users reported this; you are the first one. Must be your browser, so let's start from there. Ditto. See the screenshot below from ProcessWire 3 Test. I'll have to have a think about this one. My guess is that the editor already know the aspect ratio of that image? I think this is a matter of (stylistic) taste. Absence of rounded corners in Thumbs view Table (Thumbs view has two layouts; grid and table; List view is the other view without images) was just an oversight. I'll have a think about this one. I agree with the idea about making the modal load faster, although I would add, 'initially load faster' since once thumbs are created, they do not have to be recreated. As for 260px high thumbs, unless I am mistaken, that's a ProcessWire 3 feature. I have to take into account prior versions of ProcessWire. Meaning, they would still need their thumbnails to be created at 260px, so nothing gained for them. I have no empirical evidence, but it seems to me, PW 2.x users are still the majority. In addition, given that we have VPS in use out there already using 100px high thumbs, switching to 260px high thumbnails will lead to some disruption. As for too small, that is also a matter of taste? I don't like large thumbs . Incidentally, ProcessWire 2.x has been using 100x100 thumbs. Maybe if we made this configurable? Disconcerting? I'm not sure how to respond to this one to be honest . RE layout, I will do further tests. Will also look into the label line height. Will look into this, thanks. Good idea. Will make it configurable, thanks. Yes, there is no easy way around this. Users will just need to be taught that hitting save will implement the changes they've made. I'll have a think. Again, I haven't seen the overflow here, nor text cramped against the margins. I understand border radius are not everyone's cup of tea. I tried to replicate ProcessWire's System Notification notices. Apart from the white border, they are virtually identical, in my opinion. I'll look into this. Good catch. Will address this in next version. You are probably going to guess what I am about to say. I can't see that here. So, browser issue? Erm...what would you suggest? I see where you are coming from. I try to do my best to make sure what I put before clients works well but also looks nice. It seems some issues are browser specific. Others are a matter of taste, but certainly not trivial. Thanks for the detailed feedback.
-
Yes, you can. Double click on it .
- 14 replies
-
- 1
-
- table of content
- anchor
-
(and 1 more)
Tagged with:
-
True.. Maybe better to get it like this...(in case down the road someone wonders what the 2 is all about, etc).. $pages($config->adminRootPageID)->httpUrl();
-
Template caching maybe? Check the Cache tab when editing the relevant template. As for CSS, browser cache? Chrome is notoriously 'cachy!'. You will want to develop with dev inspector open and set not to cache, if that is the case.
-
Great. Try and re-install Blog and we'll take it from there.
-
Hi @bot19, Welcome to the forums. The second error is, yes, as a result of trying to install again whilst there are left over components from the first install that failed. I am not sure why the first one failed. I have never seen that error before. As for cleaning up, normally, if the install had worked, you would have a cleanup menu. Since install failed, that cannot help you now. I have an old gist for such eventualities. I believe it should still work. Please use it to cleanup and then try to re-install Blog. If it fails again, we will debug the issue step-by-step.
-
FYI, Lister (as seen in Find, Templates, etc) in PW admin is Ajax-driven content that utilises pagination.
-
To the best of my knowledge, there is no module that will make phone numbers on your site clickable. We have a Phone Fieldtype, but I don't think that's what you want.