Dean
Members-
Posts
60 -
Joined
-
Last visited
About Dean
- Birthday 11/06/1976
Profile Information
-
Gender
Male
-
Location
West Midlands, UK
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
Dean's Achievements
Full Member (4/6)
7
Reputation
-
Dean started following Site put live -> Fatal Error , Field set up for voting and Splitting search results by page
-
I'd be grateful if people could offer some advice on the best set up to allow users to vote for their favourite page. Registered users will be able to choose a 1st, 2nd, 3rd and 4th place page. Once voting is closed, the page with the most 1st place votes will be the winner, followed by the most 2nd place votes and so on. I did think of adding some fields to the user template, e.g. 1st_place_page, 2nd_place_page, 3rd_place_page, 4th_place_page. These would hold the ID of the page that they voted for. Then I could loop through all the users and calculate the totals. The issue is that there are lots of different categories to vote on, so that would mean adding 1st, 2nd, 3rd, 4th place fields for each category to the user template. Is there a better way of doing this that anyone can suggest? Thanks!
-
Sorry @BillH, I had to work on something else for a few days. So, back to this. If I change $traders = pages($selector); to $traders = $pages->find($selector); I get Notice: Undefined variable: pages Fatal Error: Uncaught Error: Call to a member function find() on null Regarding sorting, I'm sorting by title if I haven't specified a search string if(strpos($selector, "~=") === false) $selector .= "sort=title, "; If there is a search string, are the results not sorted by ProcessWire according to relevance?
-
Thanks @BillH, I'm using the code from the Skyscraper demo: // check if there are any keyword searches in the selector by looking for the presence of // ~= operator. if present, then omit the 'sort' param, since ProcessWire sorts by // relevance when no sort specified. if(strpos($selector, "~=") === false) $selector .= "sort=name, "; I'm using renderPager(): $traders = findTraders($selector, 5); $pager = $traders->renderPager(); ... echo $pager; findTraders() is a slightly modified version of findSkyscrapers() function findTraders($selector, $limit=10) { // check if there are any keyword searches in the selector by looking for the presence of // ~= operator. if present, then omit the 'sort' param, since ProcessWire sorts by // relevance when no sort specified. if(strpos($selector, "~=") === false) $selector .= "sort=title, "; $selector .= "limit=$limit"; echo '<small>'.$selector.'</small><br />'; // now call upon ProcessWire to find the skyscrapers for us $traders = pages($selector); return $traders; }
-
I have an issue with ordering and repeated results when limiting search results and splitting into pages. Selector is shown just above letters. This is what I get when all results fit on one page: If I limit to 5 per page, I get a different order, missing results, and a repeated result on page 2: Can anyone shed any light please?
-
Strangely, installing Reno's admin theme has fixed everything. Thank you @renobird
-
I did find this in the console log: Uncaught ReferenceError: ProcessWire is not defined at ProcessPageListInit
-
Many thank-yous @kongondo. The site is now working. Kind of. For some reason ProcessWire is showing as the crummy old version (see screenshot), yet I'm using v3.0.148. And the pages aren't showing on /processwire/page/. Everything else seems fine.
-
Dear community I have put a site live by FTPing files, copying database, updating config, emptying cache DB table. But I now have this: Fatal Error: Uncaught Error: Call to a member function execute() on null in /var/www/vhosts/mydomain.com/httpdocs/index.php:55 Can anyone help please?
-
Thank you @Jan Romero. I have since started posted in the Formbuilder forum. This is an old post. ? I shall have a read of https://processwire.com/store/form-builder/hooks/.
-
Thanks @Jan Romero, but this isn't in my code, it's part of the Form Builder. Can I hook into the 'Send checked to pages' function somehow maybe?
-
This is magical @Jan Romero. When you say 'put this in there', where is 'there'? ?
-
Actually, it was my fault. I hadn't matched the title to the relevant form field in My Form > Actions > Save to ProcessWire Pages > Page Fields to Form Fields. While we're discussing this, is there a way to trigger an email when sending the form entry to a page. I'd like to be able to tell the user their log in name and password and tell them they can log in now.
-
The reason I was creating another user template was because I think there is no name field on the user-hunt template which I think is what was causing the issue with the weird name that was being added when a new user registered. Can you add the name field for me?
-
Possibly because I deleted it out of the templates table thinking that was the issue.
-
I think the last thing I did was to duplicate the user-hunt template and call it user-hunt2. If you think you can undo what's causing the issue then super! ?