-
Posts
7,484 -
Joined
-
Last visited
-
Days Won
147
Everything posted by kongondo
-
Hi @OllieMackJames, This is a basic example because I don't know what want to do with the contents of page2use4homepage. $content = ''; // if page2use4homepage is a multi page field if($page->id == 1 && count($page->page2use4homepage)) { foreach ($page->page2use4homepage as $p) { $content .= $p->title;// @note: $p is a page; you can access all its properties } } /* // if page2use4homepage is a single page field if($page->id == 1 && $page->page2use4homepage) { $content .= $page->page2use4homepage; // alternatively, you could create a property on the fly and assign to $page, e.g. (a silly example) $page->content = $page->page2use4homepage->id; } */ else $content = $page->body; // do something with your $content You don't want to do this. You are overwriting $page which is a native ProcessWire variable. Same goes for $pages, $template, etc. You want to use different variable names (in general) I highly suggest you go through some basic PHP tutorials. It might seem hard at first but the benefits thereafter will be worth it. Otherwise, copying and pasting code will only get you so far. Please don't take offence; just friendly advice .
-
Change Default Admin Page Loaded / Hide Pages Tree
kongondo replied to geekpete's topic in Getting Started
These topics might be of interest, especially Macrura's dashboard And this module (page list hidden by default) -
Welcome to the forums @activestate. Have a read here about selectors, specifically about MySQL and short words. Please use code blocks (@see the <> icon) around your code.
-
Thanks for the post! How would getMatchQuery() work if data is encrypted or that's the compromise, i.e. you lose search functionality?
-
User - display field values from their most recent created page
kongondo replied to Peter Knight's topic in API & Templates
Not necessary since he's using get(), which assumes these things already . http://processwire.com/api/selectors/#access_control -
Module Module: Matrix Fieldtype & Inputfield
kongondo replied to kongondo's topic in Modules/Plugins
For storage, no, for reference, yes. Matrix stores a page ID for Row, a page ID for Column and a varchar for the value of the matrix (i.e. row-column = value). Using the page IDs of Row and Column, you can use PW API to get the page and hence, any field on that page. Maybe not what you are after but thought to clarify anyway. -
How to deny access to images attached to not accessible pages?
kongondo replied to LAPS's topic in General Support
Would field level access work as well? Access tab when editing a field -
@geekpete, Welcome to ProcessWire and the forums. In addition to what has been said, especially the comment about roles and permissions, just remember to test your work/module as both a superuser and a normal user. Some stuff will not be viewable, editable, etc, by default for non-superusers.
-
Glad you liked the module . Yes, but a closed one for a couple of people who are still in the free upgrade period.
-
Preview of upcoming Media Manager Version 012 Better, cleaner, ProcessWire 3 UI! Custom columns (add custom fields to media templates; frontend access via API: e.g. $m->email; $m->body, etc) Edit media page directly Ajax update of Media Manager field on a page Disable media views centrally (e.g. manage only image media) Add extra images to image media field (e.g. front, back, top, side views, etc of an image) Better media previews More..... ETA: 3 - 5 weeks Early screenshots (some stuff subject to change)
-
Hence this discussion. I am learning as well, so thanks for your pointers .
- 35 replies
-
- 1
-
Thanks for the input guys! An app that you have to pay to use/install . So, I am told...but at the cost of what? You get a slower app? Just what I've read. But the point about using technology you already know (HTML, etc) is a good thing (most times). I think it depends on the language you are using. If developing. If using TypeScript + NativeScript, all you need to know is JavaScript (and CSS and (X)HTML)). Is this still the case or am I misunderstanding the below? https://auth0.com/blog/introduction-to-progressive-web-apps-push-notifications-part-3/ https://dockyard.com/blog/2017/07/13/safari-ios-and-progressive-web-apps Sound advice. I think I'll take this approach, albeit start with native and get into PWA's later.
- 35 replies
-
- 1
-
How to output wire message after running a hook problem
kongondo replied to Juergen's topic in API & Templates
Just a by the way, this code: if($page->template == 'event_businessvacations'){ $itemtemplate = 'single-business-vacation'; } if($page->template == 'event_dates'){ $itemtemplate = 'single-date'; } if($page->template == 'event_events'){ $itemtemplate = 'single-event'; } if($page->template == 'event_specialbusinesshours'){ $itemtemplate = 'single-special-business-hours'; } The conditions you are checking are mutually exclusive. A $page->template can only ever have one name. So, there is no need to check it four times. You can use if, elseif, etc (or case:), to have PHP break out of the condition check once a match has been found. E.g. if($page->template == 'event_businessvacations'){ $itemtemplate = 'single-business-vacation'; } elseif($page->template == 'event_dates'){ $itemtemplate = 'single-date'; } elseif($page->template == 'event_events'){ $itemtemplate = 'single-event'; } elseif($page->template == 'event_specialbusinesshours'){ $itemtemplate = 'single-special-business-hours'; } -
How to output wire message after running a hook problem
kongondo replied to Juergen's topic in API & Templates
Hmm. I don't think so. Both of these work for me $pages->addHookAfter('saveReady', function($event) { // here comes the logic #$this->message('Überraschung');// single quotes $this->message("Überraschung");// double quotes }); I have tested in both the old messages and the new(ish) system notifications. Normal Notification System Notification So, there must be something else going on (and yes, I tried without my English Text in there as well ). -
Uncaught ArgumentCountError: Too few arguments to function
kongondo replied to Peter Knight's topic in General Support
What Adrian said. It is not even a ProcessWire issue but a computer programming issue (are there languages that would ignore the error? I know JavaScript is pretty laissez faire, but even it would throw an error). I'm curious though, how come@Peter Knight didn't see the error at the old host? Did size() just fail silently? -
How to output wire message after running a hook problem
kongondo replied to Juergen's topic in API & Templates
I've tested with ProcessWire 3.0.88 and the latest, 3.0.90 and your code works fine in both. Maybe a code collision? -
Going forward, I have been thinking for adding the 'resize' slider like in ProcessWire's image field so that the user can select their default preview size. I wanted to implement this in the last version but ran out of time. I would like to incorporate the input for the percentage widths right within or next to the respective column definitions (in the asmSelect). I'll have a think, thanks I use the same theme, although I test in all themes. I'll test some more, starting with FF.
-
Migrate Processwire with Plugin but Backend does not work as expected
kongondo replied to Maxplex's topic in General Support
I have been bitten by this several times. Last time it happened, I had two AdminThemeUiKit, one under /site. I deleted that one and the theme was able to load correctly. Similar cases, have been reported here in the forums, albeit with different suggested solutions. Welcome to the forums. -
OK. Suggestions? However, I noticed that in Thumbs Grid view, if for some reason ProcessWire fails to properly create an image thumb 260px high, some crazy-wide images will be displayed. I ran into this in Media Manager which I am currently upgrading. I have made changes there and will do so in VPS as well. That is weird! I'll have a look. I don't have Win10 though... (blissfully stuck on Win7 )
-
For a while now, I've wanted to expand my skills into mobile app development. Having done some Googling and watched several YouTube videos regarding native versus hybrid apps, I decided to go native. I did my homework regarding React, Ionic, etc and decided to go native. I settled on the NativeScript + TypeScript combo although it seems most tutorials are about Angular. Anyway, after watching quite a number of videos, just when I was about to dive into things, someone turned off the lights! Progressive what? PWA? Haven't you heard about this? No, I haven't! Where have you been? Let's not go there... OK, so I don't know much about mobile apps as you can tell (or even much about frontend development as my personal websites do tell, ). At first, I dismissed Progressive Web Apps as another Google tech that is bound to fail....until I read that Twitter, Blah Blah, have joined the bandwagon and the thing is gaining serious traction. It was back to more Googling. I now know (I think) what Progressive Web Apps are (or are meant to be). Naturally, my first question was Progressive Web Apps versus Native apps. So, I asked Google. Google told me to stop asking that question. To be precise, it told me (at least with the first couple of results) that that was the wrong question to ask! I tried finding out why, but the answer was hidden down some deep mobile rabbit hole that I didn't have time to fully descend into. It seems I am back to where I started. Native apps seem to be promising first class citizenship (who doesn't want that?). On the other hand, I am being told, Progressive Web Apps are the bright shiny future that will solve all our problems (and maybe even shutdown the Play Store! ). Please be gentle with my ignorant self. I have asked Google but she hasn't bothered or cannot be bothered to reply or I am asking her the wrong questions. I simply want to know if Progressive Web Apps can or will one day be able to be used to: Build apps like WhatsApp, etc? Build games like Candy Crush (what?)? Build premium apps (how would that work?) Or...are Progressive Web Apps just a replacement for mobile.domain.com? Should I ditch my NativeScript?? If someone could help me out here (once you're done laughing at my silly questions ) and/or point me to resources that will answer my questions, I'll be forever grateful . Thanks
- 35 replies
-
- 4
-
Glad you sorted it out.
-
Page Reference Selector counting grandchildren
kongondo replied to hezmann's topic in General Support
We'll be hear to help as much as we can .- 3 replies
-
- page reference
- selector
-
(and 1 more)
Tagged with:
-
Hi @mikhail, Thanks for the purchase. Sorry for the confusion. We have the following in the docs about setting up here: If you read that but was still unsure how to proceed then we need to tweak it. Please let me know, thanks. Edit I've gone ahead and tweaked the docs a bit. I hope it is clearer now. Thanks for the suggestion.
-
I wanted to mention this but forgot. I have seen this several times in ProcessWire 3, but can't recall how far back I started noticing it with respect to the exact version. I think I've seen the issue in other admin themes as well (besides UIKit) but can't say I am 100% sure. However, a page refresh always works for me. I've never had to log out and in again. I think I trigger the network error if I click around too fast, saving in different tabs.
-
Wild guess.. Does it also occur if using other admin themes besides UIKit?