Jump to content

rick

Members
  • Content Count

    438
  • Joined

  • Last visited

  • Days Won

    5

rick last won the day on December 26 2015

rick had the most liked content!

Community Reputation

477 Excellent

About rick

  • Rank
    Sr. Member

Contact Methods

  • Website URL
    https://simulatedconcepts.com

Profile Information

  • Gender
    Male
  • Location
    Texas
  • Interests
    Web applications, scotch, hunting, fishing, scotch, graphic design. Did I mention scotch?

Recent Profile Visitors

3,479 profile views
  1. 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.
  2. @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.
  3. Thanks @Gideon So, that sent me in the right direction.
  4. Yeah, I had specified include=all in the selector as well with the same results. I removed it after checking the template settings.
  5. 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?
  6. This should be pinned! It's Awesome! πŸ˜„
  7. Something like this maybe? // Just thinkin' out loud foreach ( $page->getInputFields() AS $fld ) { fldArray[] = $fld; } flsJson = json_encode( $fldArray );
  8. Been on linux since early 2000s and haven't looked back.
  9. Thanks @Robin S! That is a great solution. I'll close this out now.
  10. 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
  11. 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?
  12. @wbmnfktr Yes it does. Even the fractional star rating, eg, 5, 4.75, 4.5 ... to 0 works.
  13. 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.
  14. $this->halt(); As shown at the bottom of this thread. Is this what you are referring to?
  15. 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.
Γ—
Γ—
  • Create New...