• ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Sten
      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
       
       
       
    • By j00st
      Hi all,

      I've set up a filter on my product-page, which I then use to...filter my products!
      – I've got pagination set up, and 30 items per page.
      – When I active the filter it works perfectly (in my opinion).
       
      Here's what I'm struggling with though:
      When I'm on another page (filtered as well/or the total overview) and I put my GET request in for the filter,
      it gives back the result, but still with the page-number there. In some cases, this is no problem – like a A-Z or Z-A filter,
      but others (say, per location) I might have less pages.
      Visual/code ref: (I DO have 3 pages of authors, but I don't have 3 pages from London)
      url: books/page3?author=ascending url: books/page3?studio=london  
      The current setup for my pages that get rendered are as follows:
      $allbooks = $pages->find("template=book, sort=$sort, $q, $tagged, $select_studio, start=0, limit=$limit"); As you can see I have the start=0 in there, but I read that's for the start of the pagination, not so much where it'll drop me in the search results.
      $q, $tagged and $select_studio are all empty values, unless they're returned from the GET request
      To repeat it, in it's most simplest form:
      When I click a filter, and a GET request is done, I want to 'reset' the page-number to 0, and get my results...
      Perhaps I'm missing something obvious, but I'd be really grateful to have your input.
    • By chcs
      After running this code in my module's __install() the template_id is not set. Any ideas why?  (The export contents from the template created and the one that I built with Admin are the same. Both exports have the template_id is set to mm_state. When I go to edit the field in Admin, the template is not showing on the Input tab and it doesn't show the template title on a page using the template that uses this field. Using processwire 3.0.98)

      // mm_state
      $field = $this->fields->get('mm_state');
      if (!@$field->id) $field = new Field();
      $field->type = $this->modules->get("FieldtypePage");
      $field->name = 'mm_state';
      $field->label = 'State';
      $field->derefAsPage = 2;
      $field->inputfield = "InputfieldSelect";
      $this->fields->save($field);
      $field->labelFieldName = 'title';
      $field->template_id = 'mm_state';
      $field->columnWidth = 100;
      $field->required = true;
      $this->fields->save($field);
    • By rareyush
      I added a field type 'page reference' using checkboxes knows as services.
      now i want to display the pages according to service.
      I can display all services list but when i click on any services then I can see whole code of site 
       
      any idea where i am wrong
      ?
      main cate1 subcate1 subcate2 cate2 subcate1 subcate2 services first-service second services  
       
      these services is being used as a page reference  in subcate1, subcate2 templates.
       
      and in the navbar when i click on services and then when i click on any of the following service then i can see whole source code of my site.
    • By benbyf
      Hello, having trouble getting PW to save my user or field in cron hook.
      It seems to report the same field info each time unchanged. It should be counting down in seconds.
      public function init() { // set to every30Seconds in settings $this->defaultInterval = $this->cron_check; // add hooks to CRON $this->addHookAfter("LazyCron::{$this->defaultInterval}", $this, 'checkUserSubscription'); } public function ___checkUserSubscription(HookEvent $e){ // seconds since last lazycron $seconds = $e->arguments[0]; $log = wire('log'); $field = $this->exclusiveRole; // users with specific role and field $users = $this->users->find("roles=$field"); foreach ($users as $user) { // get stored time $currentTime = $user->get($this->fieldName); // if time not null if($currentTime){ // evalute stored time minus time past $resultTime = intval($currentTime) - intval($seconds); $log->message("result ".$resultTime); // save user page $user->set($this->fieldName, $resultTime); $this->users->save($user); } } }