-
Posts
1,699 -
Joined
-
Last visited
-
Days Won
14
Everything posted by renobird
-
Noticed that on a test install the other day and just assumed I had messed something up. I gave up and switched it to tinyMCE. Glad you found that, I really like CKEditor. Thanks.
-
A different way of using templates / delegate approach
renobird replied to Soma's topic in API & Templates
Apeisa, Thanks for sharing your approach, I'm just now getting a chance to really dissect it. I have been doing something kind of similar, but not quite as clean as your method. It still relied heavily on a naming convention for pages/templates. Setting the view via $page->layout allows for the flexibility I need, without having to worry about naming. Cheers! -
I can't. I don't. I'm crying.
-
Every time I use this module I laugh when it's complete. I just imported 200+ pages flawlessly — Beer:30.
-
Let that sink in. Ryan, I can't absorb the knowledge you share fast enough — thank you!
-
Kyle, One pointer (if you haven't figured this out already), use a search engine to search the forums. The forum search leaves something to be desired.
-
Hi Kyle, Welcome to the forums — adrian beat me to the response, but that's spot on.
-
IRC channel is where the cool kids hangout and smoke. *OK, so maybe we aren't cool. Drop by anyhow.
-
Ryan, Thank you for sharing this — I just spent an hour dissecting, and learned some new tricks. Much appreciated.
-
Ara, Welcome. I think you'll find that you can do a lot in PW only understanding a few PHP basics.
-
Is there a way to get a DB backup from within PW?
renobird replied to MarcC's topic in General Support
Ryan, Just implemented this for the 3rd or 4th time now — I've been meaning to say thanks. Dead simple, and works like a charm. -
Very nice site — congrats on the launch. I have to agree with kongondo about the main menu.
-
I have difficulties to find the right selector...
renobird replied to titanium's topic in General Support
yeah, I was a bit confused about the < 10. I was also thinking the goal was to "find" all pages that have a value for intro_text. Not just show show intro_text if populated. -
I have difficulties to find the right selector...
renobird replied to titanium's topic in General Support
Not sure how many pages you have (so this could be slow) — perhaps limit to a particular parent page or template? $ps = $pages->get("/")->children; foreach ($ps as $p){ if (strlen($p->intro) < 10){ // do things } else { // do other things } } untested, and written in the browser. -
Curious if anyone has a progress bar method for forms that have large images/files, or lots of processes happening. In the past I've successfully used one that was a PHP/jQuery combo, but it was always a bit finicky. Anyone implemented one they'd be willing to share?
-
ohthanks, Very nice! The only thing I was wanting was a more obvious way to move between "indicators". The sidebar nav works, but I missed it at first being under the rating system. (nitpicking). I love Avenir, nice type choice.
-
Hi Ryan, Using '=" works, but "%=" gives and internal server error. Ultimately I'm using this method to search a new comments field I added to the DB called "notify". That field contains a comma separated list of email address, so the LIKE operator seems to be the way to go. This is a non-typical usage for me, so the $db->query method will work. Thanks for your time responding and explaining.
-
Hi Ryan, I did eventually realize there was no "text" and started using "data" as soon as I went the $db->query route. Let's say I just need to find comments with a particular email address (Direct DB query works): $search = $db->query("SELECT pages_id FROM field_comments WHERE email LIKE '%me@tomrenodesign.com%' ORDER BY created"); API gives me an internal server error: $search = $pages->find("comments.email*=me@tomrenodesign.com, sort=-created"); Is it not possible to specify a subfield when searching comments, or do I need to do something different with the selector? No worries if this isn't possible, $db->query works just fine — Just clarifying.
-
Just in case there is anyone else who needs to search comments. I pieced together some stuff Soma and Ryan had posted in other topics. Here is a DB query workaround: $query = $db->query("SELECT pages_id FROM field_comments WHERE data LIKE '%SomeStringHere%' ORDER BY created"); $ids = array(); while($row = $query->fetch_row()) $ids[] = $row[0]; $results = $pages->getById($ids);
-
Alessio, I see you have $curriculum = new Page(); $curriculum->template = "curriculum"; outside of if($input->post->submit) Could there be an issue there? Also, can you get the new page to save without fields?
-
Soma, Much appreciated. The *hash* thing threw me at first—but as usual—it's not that complicated. What you posted was almost it, but it threw some error about using wire $input as an array. I tweaked a little, and ended up with this (which works perfectly) foreach($p->files as $file) { $id = "delete_files_". $file->hash; if(isset($input->post->$id)) { $p->files->delete($file); } } Thanks again.
-
So, I don't see this in the commits anywhere — could be overlooking it though. I have a lot going on with this site, and don't want to use the dev branch. Do you have a dev install with comments? If so, do you mind checking this: $pages->find("comments.text*=SomeStringHere, sort=-created"); Much appreciated. OK, installed the latest dev on a test server, still getting the same error. Seems this never got implemented. Anyone have ideas on a workaround? Maybe a direct DB query?
-
Soma, Haha. So it's complicated then eh? How much beer are we talking?
-
Matthew, Nice one. I wonder if you could have dropzone.js initially upload to a temp directory, and then when the form is submitted do the processing to add the files to your form?
-
Hi Soma, I think I'm moving beyond the "simple forms" portion of this topic. I'm trying to figure out how to delete files using this method. I can get a list of the current files to show using $field->value But can't seem to get my head around how to process the delete() $field = $modules->get("InputfieldFile"); $field->label = "Attached Files"; $field->required = 0; $field->value = $p->files; $field->attr("name+id",'pagefiles'); $field->destinationPath = $upload_path; $field->extensions = "doc docx pdf xls xlsx png"; $form->add($field); I see that each file has a checkbox associated, but not sure how to use that to delete the correct file. <input type="checkbox" name="delete_pagefiles_f86ba9c52a4f9cf4f81c3b8cf22fb6dd" value="1"> Can you nudge me in the right direction?