Jump to content

Search the Community

Showing results for tags 'values'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 7 results

  1. Hi, I have a lot of difficulties with getting a field value. First I created a template, inside I created several fields two fields are a dropdown select box So I have a value and a label for each line. Then I want to get the field value in _init.php or in the template to display it. How can I get the value of a field for the page ? I need to understand the flow through which data goes. Could someone help me ? Thank you
  2. I am currently working on a site that lists about two hundred product series, which are displayed to the visitor as a web page. Beneath each of these Series pages are one or more children, and they may be nearly identical, with a few key differences. Does anyone have any advice on how I might run through the 'foreach' of the children on the Series' output page, and determine if the field values are the same or unique, and output the unique values while "merging" the common values? For example: Product Series A contains: Model A - which has a "color" field value of "blue" Model B - which has a "color" field value of "blue" Model C - which has a "color" field value of "green" Model D - which has a "color" field value of "red" So in this example, I'd want to list this information as: Product Series A [[bunches of info from the Series parent page's fields]] Specifications Color: Blue (Models A and B), Green (Model C), or red (Model D) Or, if the values were all the same, it would list just the value without the model mentions. Thanks in advance, even if you just have a direction to point me in, I'd appreciate any input. My brain is fried from all the crazy logic I've had to implement for this site already.
  3. Hey guys. Need some little help for a newbie. How can i foreach all possible values from existing field of a child template into select form? Trying like this but it showing me results from created pages and their fields. $fields = $page->find("template=item, sort=item_type"); echo "<select>"; foreach($fields as $item) { echo " <option>{$item->item_type->title}</option> "; } echo "</select>";
  4. how can I achieve something like this: in a custom process module ? I made a Interface(form) with the Inputfields components, but i don't know how to make the asmSelect to set the values so that it looks like above. At the Moment mine InputfieldAsmSelect looks like this in my alternative Interface: Here's the code which I have so far: $field = $this->modules->get("InputfieldAsmSelect"); $field->columnWidth = 50; $field->label = __("Titel"); $field->attr("id+name",'titel'); $fieldsTitel = $this->fields->get('titel'); $options = $fieldsTitel->type->getOptions($fieldsTitel); foreach ($options as $option) { $field->addOption($option->value, $option->title); } $valArray = array(); foreach ($entryPage->titel as $value) { $valArray[] .= $value->title; } $field->value = $valArray; $form->append($field);
  5. Hi all, I'm not sure how to best store multiple timestamps in a field for a page. As there can be 100 or more timestamps attached to the page, I need to find the most efficient way to save those timestamps in a field and later search through that field. My use case: I have pages for advertisements with start date, end date and start time, end time and frequency of publishing (every 15, 30, 60 minutes). From that data I calculate timestamps at which the advertisement will be available for viewing. One advertisement can have 100 or more timestamps attached to it. Example: title of page: Advertisement1 field "ad_publish" contains timestamps: 1413136860,1413136920,1413136980,1413137040,1413137100...(can be a lot) Now what would be the best way of storing these multiple timestamps. IOW: what field type to use? I need to take into consideration that the field needs to be searchable with a *= selector like $publishedAds = $pages->find("template=advertisement, ad_publish*={$timestamp}") 2 options that I can think of for my "ad_publish" field: 1. textarea field, store timestamps as comma delimited values. 2. page field: store each timestamp as a page What would be more efficient and faster when it comes to searching through hundreds of timestamps? I'm sure some of you had similar use cases in their projects and I would be happy if you could share your experience or give me pointers on how to best approach this. Thank you.
  6. Hello, I'm building a form through the API. In that form I am using a repeater field that is setup with 5 Ready-To-Edit New Repeater items. In the repeater is only one text input field named "servername". Now I'm having trouble accessing the repeater field values when I process the form. I read through the docs at https://processwire.com/api/fieldtypes/repeaters/. But when processing form input post values things seem to be different. I add the field to the form with: $registrationField = $fields->get("reg_servers")->getInputfield($pages->get("/registration")); $registrationField->attr("class","form-control"); $registrationForm->append($registrationField); The field is there in the form and working fine. Now when processing the form, I need to access the values of my repeater. Here's the relevant code: if($input->post->submitregistration) { $registrationForm->processInput($input->post); $servers = $registrationForm->get("reg_servers")->value; var_dump(count($servers)); // this gives int 5, which is fine foreach ($servers as $server) { echo "<pre>"; print_r($server->fields->servername); //servername is my text input field in the repeater echo "</pre>"; } exit(); } In the print_r output I can't find the value of my fields. I also tried var_dump($server->servername) and var_dump($server->servername->value) inside the foreach which gives an empty string. var_dump($server->fields->servername->value) gives null. How can I access my field values?
  7. I was following the examples given in Diogo's answer here - However, I am either making a mistake or not getting it. $products = $pages->find("parent=/products/"); foreach ($products as $product) { //Database queries and while loops to give me the width, depth, height and seat_height variable values. They echo out fine. echo "<p><strong>The next dims are: " . $width . ", " . $depth . ", " . $height . (isset($sh)?", " . $sh:"") . "</strong></p><br />"; $product->of(false); $product->width = $width; $product->depth = $depth; $product->height = $height; if(isset($sh)){ $product->seat_height; } $product->save; //print_r($product); if(isset($sh)){ unset($sh); } } The script completed without errors, but nothing appeared in the forms for the individual product pages in admin. However, the values do appear in the array if I print out the $product array, for example: Array ( [title] => 111 Spindle Side Chair => 111 [width] => 490 [depth] => 530 [height] => 830 [seat_height] => 465 ) Bit confused. Any help appreciated.
×
×
  • Create New...