Jump to content

rick

Members
  • Posts

    650
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by rick

  1. If Apache is throwing an error, you have a server config issue. Follow @wbmnfktr instructions and try again.
  2. ASCII art needs to make a come-back. I like your work! Keywords aren't used as much now as they once were thanks to their abuse. The description is still used and should reflect the current page content. That being said, keywords may play a part if they are content relevant as well. Blindly stuffing keywords on every page may result in page demerits. N N III CCC EEEEE JJJJJ OOO BBBB NN N I C C E J O O B B N N N I C E J O O B B N N N I C EEEEE J O O BBBB N N N I C E J O O B B N NN I C C E J J O O B B M N III CCC EEEEE J OOO BBBB
  3. If you allow the user to select one or more products, you can use a select field to present the options to the user. Of course it depends on the number of available products. If there are a large number of products, you may want to separate them by category. The select field's options allow for values that you require.
  4. @itsberni, I'm not sure I understand your specific use case completely. When you say "Form sends my specific value", there are only two values for a checkbox when submitted: It's either present or not. For example: if( isNull($input->post('YourCheckboxFieldNameHere')) ) { // User did not check checkbox, so set a default or whatever. } If your specific value (used in your computations) is numeric, ie, a dollar amount, or temperature, or distance measurement, etc., then you will need to use an input type that accepts numeric entries. The checkbox is not the correct input type for your data. I don't use form builder so I can't provided specific instructions. In HTML it would be the input type text. Can you be more elaborate with what you are trying to accomplish? I'm sure someone here will have the answer you seek.
  5. Thanks @Gideon So, that sent me in the right direction.
  6. Yeah, I had specified include=all in the selector as well with the same results. I removed it after checking the template settings.
  7. Can someone please point me in the right direction. I've been staring at this for a few hours and I can't see the tree. $userPage = wire('pages')->get("template=member-home,name={$user->name}"); In Tracy console, the page object is returned. In the template, however, a null page is returned. What am I overlooking?
  8. This should be pinned! It's Awesome! ?
  9. Something like this maybe? // Just thinkin' out loud foreach ( $page->getInputFields() AS $fld ) { fldArray[] = $fld; } flsJson = json_encode( $fldArray );
  10. Been on linux since early 2000s and haven't looked back.
  11. Thanks @Robin S! That is a great solution. I'll close this out now.
  12. Okay, here is a workaround. I call it a workaround, because one, it works for what I need, and two, this will present problems when I have to process all 5K+ pages for each of the three parent pages in this current project. Here is the tracy code: $p = $pages->findMany("template=my_template"); // 34 total $s = array(); foreach( $p AS $m ) { $s[$m->id] = $m->comments->stars(true); } arsort($s); $s = array_slice($s,0,12,true); d($s); Produces this result: array (12) 1064 => 5.0 1121 => 5.0 1120 => 4.75 1056 => 4.5 1065 => 4.43 1054 => 4.41 1068 => 4.33 1086 => 4.3 1122 => 4.29 1062 => 4.25 1127 => 4.25 1058 => 4.22
  13. Well, sorting by stars seems to not work. When I expand the test data the sort fails. Here is the tracy test code... $p = wire('pages')->findMany('template=my_template,sort=-comments.stars,include=all,limit=12');//34 total pages foreach( $p as $m ) { $stars = $m->comments->renderStars(true, array('schema'=>'microdata','partials'=>true)); echo $m->id.': '.$stars.'<br />'; } which gives the following results... 1027: ★★★★★4/5 (7 ratings) 1068: ★★★★★★4.3/5 (6 ratings) 1148: ★★★★★★3.8/5 (17 ratings) 1086: ★★★★★★4.3/5 (10 ratings) 1056: ★★★★★★4.5/5 (2 ratings) 1114: ★★★★★4/5 (9 ratings) 1057: ★★★★★4/5 (7 ratings) 1120: ★★★★★★4.8/5 (8 ratings) 1121: ★★★★★5/5 (3 ratings) 1063: ★★★★★★3.8/5 (12 ratings) 1064: ★★★★★5/5 (1 rating) 1065: ★★★★★★4.4/5 (14 ratings) Also notice that some ratings display 6 stars. The default config is set to 5. I am not concerned with sorting by the number of ratings, only the average ratings. Anyone have an idea what I am doing wrong?
  14. @wbmnfktr Yes it does. Even the fractional star rating, eg, 5, 4.75, 4.5 ... to 0 works.
  15. For other's and my reference: Sorting pages by stars requires the comment field name prefix, eg: // From previous post... $pc = $p->children('sort=-comments.stars, limit=12'); // Returns pages with 5 stars, then 4.5 stars, etc. I must have mistyped the comment field name before. My apologies. Thanks for your help @dragan.
  16. $this->halt(); As shown at the bottom of this thread. Is this what you are referring to?
  17. Yes Sir, I've tried a few combinations with the same results. I haven't seen anything in the source regarding an average other than the public function stars itself.
  18. @dragan, I'm using the core comments with star rating field type. Yes, the test code doesn't return any errors... // Tracy console $p = wire('pages')->get('template=my_template,include=all'); if($p->hasChildren) { $pc = $p->children('sort=stars, limit=12'); // One of many combinations I've tried d($pc); } But the results (12) are not sorted by stars, rather the results are returned in the order the pages were created (Id)... total => 34 start => 0 limit => 12 pager => "1 to 12 of 34" (13) items => array (12) Page:0 => array (5) ... Page:11 => array (5) selectors => "parent_id=1026, sort=stars, limit=12, status<1024" (49) [edit] Also, each template has the comments (fieldtypecomment) and stars are enabled.
  19. Howdy all, Is there a means to return pages sorted by star ratings? I apologize if I have missed a topic, but I haven't found anything related with my searches. Thanks for your help!
  20. I believe what you are looking for might be answered here.... If not, please elaborate and someone will jump in and help.
  21. Thank you @Robin S! That was it.
  22. Hello all. I've been lookin' at this for a couple of days now with no luck. I have a localhost test site where I set up an example as shown in example #2 in this article. The test template has page numbers enabled. There are 20 pages using the test template. $results = wire('pages')->find("template=test,sort=-published,limit=12"); $pagination = $results->renderPager(); echo $pagination; foreach($results as $result){ blah, blah, blah } The pager is rendered correctly, ie., 1 2 Next, including the link href attributes: ?page=2 for the second and Next links. The problem is the same pages are returned regardless of which link I click. There are no error messages. The response header shows page 2. Tracy shows the following for $results: count => 12 total => 20 start => 0 limit => 12 pager => "1 to 12 of 20" (13) items => array (12) What am I missing? Thanks for your help!
  23. It's been acting this way for the past 2 weeks for me.
  24. You have three forms on one page, so provide a hidden element with a unique name (as @horst suggests), then test for the form name when submitted and process accordingly. The page with your forms... <form> <input type="hidden" name="form1" value="form1" /> ... // Your form data collection fields </form> ... <form> <input type="hidden" name="form2" value="form2" /> ... // Your form data collection fields </form> ... <form> <input type="hidden" name="form3" value="form3" /> ... // Your form data collection fields </form> Then within your page, test for each... <?php if( $input->post->form1 == "form1" ) { // process your data and send your message for option 1 } elseif ( $input->post->form2 == "form2" ) { // process your data and send your message for option 2 } elseif ( $input->post->form3 == "form3" ) { // process your data and send your message for option 3 } // render your page as normal
×
×
  • Create New...