Jump to content

Ralf

Members
  • Content Count

    67
  • Joined

  • Last visited

Community Reputation

32 Excellent

About Ralf

  • Rank
    Full Member

Profile Information

  • Gender
    Male
  • Location
    Germany
  1. Dear processwire professionals, i have a question about the PW standard template "Regular". This template is great and I use it to create a new page with UIKit. But at the moment I still fail something due to a task... Is it possible to design the comment function for the blog part OPTIONAL? Which part of the code do I have to change if I don't want to allow a comment function for this homepage? I tried to comment out different lines in the file _uikit.php, but without success. The result were always PHP error messages... So now my question to the auditorium, if somebody could help me? If this question is already answered in the forum and I did not find it by my search, I apologize and would be happy about a link. Many thanks and many greetings Ralf
  2. Hello Can, I know the whole thing is a little older... but did you get any further back then? Have you been able to develop the whole thing into a module? Many thanks and many greetings to Peru
  3. Hello everybody, i have a question, which unfortunately i can't answer at the moment... A friend of mine is looking for a new homepage and asked me if it is possible to use PW to create a system with about 30-60 editors who can write articles/news in 3-5 "areas". But only have the possibility to either create NEW articles or edit their own articles. a) That means for user 1 the edit button is only allowed for his own articles, but not for articles from user 2 to 40. b) The new button should be displayed on the parent pages for all users. Excluded from this should be the SuperUser, be able to edit all articles. I'm sorry for a stupid question, but I'm on the line for a solution. My question now to the professionals, is this possible and if so how do I have to set PW with rights and permissions? I would be very pleased about feedback! Thanks Ralf
  4. Help... After the update from 3.0.98 to 3.0.118 the complete page doesn't work anymore there is only one error message left: Parse error: syntax error, unexpected 'new' (T_NEW) in /www/htdocs/xxxxxxx/wire/core/WireArray.php on line 2480 this is the code in WireArray.php /** * Create a new WireArray instance of this type, optionally adding $items to it * * This method call be called statically or non-statically, but is primarily useful as a static method call. * * ~~~~~~ * // Create new WireArray with a, b and c items * $a = WireArray::new([ 'a', 'b', 'c' ]); * * // This also works when called statically (array syntax can optionally be omitted) * $a = WireArray::new('a', 'b', 'c'); * ~~~~~~ * * @param array|WireArray|mixed|null $items Items (or item) to add to new WireArray * @return WireArray * @since 3.0.117 * */ public function ___new($items = null) { $a = self::new($items); $this->wire($a); return $a; } Could anybody help? Thanks Ralf
  5. Hello together, I´m a bit confused about doing the output of the securefile respectively securefiles... Wanze wrote this code: if ($input->get->download == 1) { $yourSecureFile->download(); } Now I'm a little overstrained and need your help. I build a template at the frontend for secure files and I generate the current output with this code $content = $page->body; $pdffiles = wire("page")->file; foreach ($pdffiles as $pf) { $content .= "<a href='' title='{$pf->name}'>$pf->name</a> ($pf->filesizeStr)<br />"; } but how can I now tell this link which of the secure files the user wants? This is the current output... Thank you for any hint Ralf
  6. Hi kixe, thanks - but hmm strange, the output is now nothing. But it should be 2 or 5 entries output - if i insert 1045 or 1041 as ID value. Have you else any idea? PS: a second challenge is to combine it with a query after "$user->roles"
  7. Hi kixe, sure, I can try. /* Home | |- events (template: events -> field: title) | |- event (template: event -> fields: title, date, jobs (PageTable - with the template "job" for items) | | |- job A (template: job -> fields: title, select_task (Page), job_begin, job_end, select_place (Page), | | | staff_needed (Integer), select_group (Page - PageArray with "Roles" as the Parent of selectable pages), | | | participants (Page - PageArray with "Users" as the Parent of selectable pages)) | | |- job B | | |- job C | | |- job X | | |- job Y | | | |- event | |- job D | |- job E | |- job F | |- tasks (template: basic-page -> field: title) | |- task A (template: task -> field: title) | |- task B | |- places (template: basic-page -> field: title) | |- place A (template: place -> field: title) | |- place B sorry that i missed the jobs in the first page tree.
  8. Hi, i build a ""assignment list" and want to find some pages with the same event select_groups as the active user has roles. My setting: Home |- events (template events) | |- event | |- event (template event -> title, date, jobs (PageTable) | |- tasks |- places The PageTable "jobs" has the template "job" (title, select_task, job_begin, job_end, select_place, staff_needed, participants & select_group -> which is a PageArray with "Roles" as the Parent of selectable pages!) And now I have tried using the following code to output the test data: $events = $pages->find('template=event, jobs.select_group=1045, sort=date'); foreach($events as $event){ $content .= strftime('%d.%m.%Y', $event->getUnformatted('date')) ." $event->title<br />"; foreach($event->children as $child){ $content .= "<b>{$child->select_task->title}</b> ({$child->select_place->title})<br /> ({$child->job_begin} bis {$child->job_end})"; } } which 1045 is only a example id from one Role. BUT this Code ignore the select_group and output ALL events?! Questions: - goes the whole at all with one "find"? - how can i search after x user roles in y pages? (so I only display these events per user which he is allowed to see with his roles) How can I achieve that? Thanks Ralf
  9. I found the mistake/ problem ... it were the curly braces // it doesn´t work $content .= "\$child->select_task->title: $child->select_task->title<br>"; // is working $content .= "\$child->select_task->title (with {}): {$child->select_task->title}<br>";
  10. Hi diogo, thanks for your fast answer. Sorry but "select_task" has in the settings -> Single page (Page) or boolean false when none selected?! And if i put your code behind the "print_r" foreach($child->select_task as $task){ $content .= $task->title; } i get this "Notice: Trying to get property of non-object..."
  11. Hello everybody, i try me just on a new project an "assignment list" for my association. I built years ago a first version with php and mysql but now i want to switch to Processwire My backend I have designed as follows: Home |- events (template events) | |- event | |- event (template event -> title, date, jobs (PageTable) | |- tasks |- groups |- places The PageTable "jobs" has the template "job" (title, select_task, job_begin, job_end, select_place, staff_needed, select_group & participants). And now I have tried using the following code to output the test data: $events = $pages->find('template=event, sort=date'); foreach($events as $event){ $content .= strftime('%d.%m.%Y', $event->getUnformatted('date')) ." $event->title<br />"; if($event->hasChildren > 0) { foreach($event->children as $child){ $content .= "<li>\$child->url: <a href='{$child->url}'>$child->url</a> // \$child->id: $child->id // \$child->select_task: $child->select_task // \$child->select_task->title: $child->select_task->title // \$child->select_place: $child->select_place //<br> \$child->staff_needed: $child->staff_needed // \$child->participants->count: $child->participants->count // \$child->job_begin: $child->job_begin // \$child->job_end: $child->job_end // </li><br><br>"; echo '<pre>'; print_r($child); echo '</pre>'; } } } the output you can see here: http://entwicklung.hungerberghexen.de/events/ My problem now is that with my code above i get not all values from the fields (it almost looks as if I would not be deep enough in the array?) e.g. "job_begin" & "job_end" -> work -- but for "select_task" i get only the ID ?! In advance thank you very much for any helpful hints cu Ralf
  12. Hi Martijn, thank you very much! It works perfektly again Have a nice Weekend cu Ralf
  13. Hello @all, its just a few days gone since Martijn write this beautiful code and PW is now in Version 2.6.1. available. This is the reason why i answer to this Thread, yesterday i updated my Installation with this code from Version 2.4.0 to 2.6.1 and at the first look around it seems all good. But when i open now a horse page in the backend i get the following Error: Recoverable Fatal Error: Argument 1 passed to InputfieldWrapper::append() must be an instance of Inputfield, boolean given, called in /www/htdocs/xxxxx/site/modules/HorseFamilyEdit.module on line 151 and defined (line 192 of /www/htdocs/xxxxx/wire/core/InputfieldWrapper.php) This error message was shown because you are logged in as a Superuser. Error has been logged. Administrator has been notified. This are the lines from "HorseFamilyEdit.module" // Markup $markup = $this->modules->get('InputfieldMarkup'); $markup->label = $this->_("Kinder"); $markup->value = $table->render(); $wrapper->append($markup); $view = $form->find("id=ProcessPageEditView")->first(); $form->remove($view); $form->append($wrapper)->append($view); } } And the the InputFieldWrapper Code are the same in Version 2.4.0 and 2.6.1, the only difference are the line in the file. My Question is now, could somebody help me? Thanks in advance Ralf
  14. @ Martijn fabulous - you made my day !! change the z-index from 2 to 10 makes the difference...
  15. @Manfred62 thanks for the confirmation. This misconduct is known to me. Unfortunately I have discovered this problem not until shortly before publication. But my first try, it failed to repair. Now I've decided to completely change the slider, but this will take some time ... I have tested Slider2 and thought I'll try it?
×
×
  • Create New...