Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by Orkun

  1. Still the same. But I have found out something. The grandchilds that I am not getting are living under the child "jobs". When I add another grandchild to another child inside the domain_root I get it in the pagefield. Looks like it has something to do with the "jobs" page or so...
  2. Hi Guys I have a pagefield called footer which has this code: return $page->find(''); As for as I know, this should return all descendants of the corresponding page. Now I am using this field on template called domain_root. I have many domain_root pages with some descendants. But one of these domain_roots are just returning the first level of children or. direct childrens. But all the other domain_roots are returning all descendants. I don't know why this is happening. Do you have some ideas what could cause this? All descendants are published, all langstatuses of all descendants are active, access for all descendants are inherited by the domain_root page. All covered up (I think). Greetings Nukro
  3. Hi @adrian False Alarm.. I tested it again and it looks like it's working . Since the template/pages were protected, I had to loggedin in the right "domain root/alias".
  4. Hi @adrian Thanks for this great Module! Is it possible to use your module with somas Multisite module? I tried it with somas latest module version and it didn't worked for me. https://github.com/somatonic/Multisite/tree/dev2 Or should it already work? Have you tested with it? It would be very great! Greetings Nukro
  5. Hi @kongondo For the moment I made some temporary additions to the MediaManagerActions.php file, so that it saves the title in all lang tabs. I added this lines to the code: actionEdit() foreach ($this->languages as $lang) { $p->title->setLanguageValue($lang, $sanitizer->text($media['title'])); //temporary by Nukro } //$p->title = $sanitizer->text($media['title']); actionCreateMedia() foreach ($this->languages as $lang) { $p->title->setLanguageValue($lang, $this->actionRenamer($title, $titleFormat)); //temporary by Nukro } //$p->title = $this->actionRenamer($title, $titleFormat);// @see @todo in actionRenamer() I made this because my customer needs it urgently. Greetings Nukro
  6. Thanks for you answer @tpr I have already installed the plugin. It looks like it only works when you paste in a link and not type it.
  7. Hi Guys When I type www.google.ch inside an ckeditor field it should automatically turn it into: <a href="https://www.google.ch/">www.google.ch</a> And when I type an E-Mail(example@mail.ch) it should turn it into: <a href="mailto:example@mail.ch">example@mail.ch</a> Do I need to install the http://ckeditor.com/addon/autolink Plugin or is this already somehow achievabe inside processwire? Greetings Orkun
  8. Hey @kongondo I think I have encountered an Issue with using the Media Manager with an multi language setup. It looks like the title field is always only filled out in the user language. Let's say I have 2 Languages, english(default) and german. Let's say my user language is german at the moment and I am uploading a new image. Now the default tab of the title of the uploaded image is empty. So when I change the user-language to the default language it won't show any titles in media manager interface since it is empty in the default tab. Would it perhaps possible to fillout the default langauge tab of the title field too even my user language is not the default at the moment? When you are adding tags to the image, all language tabs are also filled out.
  9. Isn't that only available for the 3.x Branch? I am using 2.7.3 dev version. Sorry that I have forgot to say which version of processwire I use.
  10. Has anyone made this module to support multilanguage textareas?
  11. Hey @BitPoet I saw that multilang description of files are somehow ignored. Do you perhaps know why? Greetings Orkun
  12. lol, how I could miss that... haha Thanks, now It's working perfectly (Y)
  13. Thanks for your help @BitPoet I am using your code now and it works still halfaway. Somehow navbar, footer, header and stuff like that are also translated to the new lang inherit even when they have content in the actual active language. They only should take the new language inherit when they have no content in it. Somehow the check inside the loop has no effect I think? Or is it something else?
  14. EDIT: Ok it doesn't matter anymore. I removed the index field from overview-content-page and fetch-content-page template since I realised that they are just overview pages which can be searched through their title and body field. So no need for an index field. I have now another really strange problem. When I try to change the template of a page to a specific template (in this case overview-content-page or fetch-content-page) I end up on a blank page with this url (/processwire/page/edit/saveTemplate) and the template doesn't get changed. It's because of my Hook for updating the index field. But I don't know what is actually causing this. Since I have also other templates with the field index in it and there are no problems.
  15. Ok Guys I could make it to work changing: wire('pages')->setOutputFormatting(true); $content = $page->render($options); wire('pages')->setOutputFormatting(false); like this: $page->setOutputFormatting(true); $content = $page->render($options); $page->setOutputFormatting(false);
  16. Hi Guys I am trying to save Pages with the API from the root Folder in a file named refreshIndex.php. The code looks like this: $root = "/path/to/root"; include($root . "index.php"); //$doctors = wire('pages')->find("template=doctors"); $jobs = wire('pages')->find("template=jobs"); //$news = wire('pages')->find("template=news"); //$specialities = wire('pages')->find("template=specialities-clinics"); //$events = wire('pages')->find("template=signup-form-formbuilder"); //$dbpages = wire('pages')->find("template=doctors|specialities-clinics|news|signup-form-formbuilder|jobs"); //$allpages = wire('pages')->get(27200)->find(""); foreach ($jobs as $stpage) { $stpage->save(); } Now at the moment I am trying to save Job Pages. They are 2 job pages right now. It saves 1 of them and at the 2 one I get an Error like this: Error: Uncaught WirePermissionException: Page '/de/jobs/test-job_ge/' is not currently viewable. in /pathtoroot/wire/modules/PageRender.module:319 They are both using the same template with the same permissions respectively they are visible (guest user is viewable). And also the languages of the page are all active inside page settings. Somehow my Hook is responsible for this. The hook is the reason for my Script above. I am trying to update the index field for my site search. The hooks works fine when I am saving the pages from the backend interface, but I can't save all pages from the backend since they are over 1500 pages I need to save. $this->addHookBefore('Pages::saveReady', $this, 'hookIndexingBefore'); protected function hookIndexingBefore( HookEvent $event ) { $options = array(); $page = $event->arguments("page"); // abort when true if(!$page->template->hasField("index")) return; if($page->isNew() || $page->isTrash()) return; // save user lang $language = $this->wire("user")->language; // clear index field at the begin $page->index = ''; if($page->is("template=specialities-clinics")){ $options['sender'] = $page->choose_sender_2016->id; } $options['pagename'] = $page->name; foreach($this->wire("languages") as $lang) { $this->wire("user")->language = $lang; // change user lang wire('pages')->setOutputFormatting(true); $content = $page->render($options); wire('pages')->setOutputFormatting(false); if($content){ $startStr = "<!--### start-indexing-area ###-->"; $endStr = "<!--### end-indexing-area ###-->"; preg_match_all('/'.$startStr.'(.*)'.$endStr.'/siU', $content, $matches); $newContent = preg_replace("/<div class='breadcrumb.*'>.*<\/div>/siU", '', $matches[1][0]); $newContent = str_replace('<', ' <', $newContent); $newContent = strip_tags($newContent); $newContent = preg_replace("/\s\s+/", " ", $newContent); } $page->index .= $newContent; } $this->wire("user")->language = $language; // restore user language }
  17. Just an addition. You could use the range() function from PHP to create the array. For example like this: range('A', 'Z')
  18. ok i could make it to work when I remove this from the header of my css file: @charset "UTF-8"; /* CSS Document */ And also changed the code to this: $pdf = $modules->get('WirePDF'); $pdf->setTitle($urlpage->title); $stylesheet = file_get_contents($config->paths->templates. "styles/pdf_styles.css"); // external css $pdf->WriteHTML($stylesheet,1); $pdf->WriteHTML($template,2); $pdf->download($urlpage->title.".pdf", "D");
  19. Hi @Wanze I am using the WirePDF module which works great! The only Problem I have is setting the path to a css fille inside the module settings. Somehow the css file didn't get load no matter which path I type in inside the "CSS File" textfield. At the moment my code to generate the pdfs looks like this (working): $pdf = $modules->get('WirePDF'); if($urlpage->template->name == "jobs"){ $template = wireRenderFile("partials/pdf_layouts/pdf_jobs_template.php", array( "urlpage" => $urlpage )); }else{ $template = wireRenderFile("partials/pdf_layouts/pdf_doctors_template.php", array( "urlpage" => $urlpage )); } $pdf->markupMain = $template; $pdf->setTitle($urlpage->title); $pdf->download($urlpage->title.".pdf", "D");
  20. Hi @kongondo I wanted to ask, how it is going with fixed filters inside the media manager? You had said you would look further into it when you have dispensed the version 7. It is a top priority of my customer since it would pretty simplify the workflow of his workers. It's very important, I would be glad when you could say a period (Version 9 ? ) when you would release such a feature. In the end I wanted to thank you for all you efforts you have put in this respectively in your Product, in my eyes it is a masterpiece of work! Greetings Orkun
  21. @Robin S I have now made a file inside the root folder and bootstrapped PW in it. Now I don't get any internal server errors anymore. Some pages get saved now from the api until it stops, when the page is not viewable ( which is right ). But I have looked at this pages and they are visible to the guest user? I get errors like this: page "it/page-name" or "de/page-name" is not viewable etc... So i tought the languages are not activated in the page settings but they are all activated?
  22. Hi Guys I had looked before inside all Apache/PHP/PW log files. There was nothing suspicous. But I have found something else that could be helpful. I logged my hook so that I can watch what is happening. I have found out that my beforeHook on saveReady is called 4-5 times when I am saving from API and when the $content comes from $page->render(). When I save from API and the $content doesn't come from $page->render() it only calls 1 time like it should be. Does page->render calls saveReady function or something similar?
  23. Got it working by creating a template file for the detail pagetemplate with this code inside: $out .= wireRenderFile("partials/jobs-detail.php", array( 'urlsegment' => $options['pagename'], )); Removed this other code from the jobs-detail.php file: if($options['pagename']){ $urlpage = $pages->get("name=".$options['pagename']); } And also changed the hook: if($page->template->name == "jobs"){ $options = array("pagename" => $page->name); }
  24. I am using this index field because there are many many fields. And with many many fields I also mean pagetables, repeaters, lot of pagefields and options fields. Most of them is for the controlled output which makes it harder to define which fields I should search inside my search.php. So I decided to go this way, since It will search anything that is visible/rendered on a page and this erase the step to define which fields I should intelligently include in my search so that it would return good search results. Because of this I also abandoned the idea to change the actual method with the one where I loop through all fields and prepare them, since every template has a lot of other complexity and purpose. It just would take to much time to consider all this factors within the search query since I would need to update the code every time a new field or new complexity are added to the template output. For the urlSegments I have thinked of giving some arguments to the render method like this: protected function hookIndexingBefore( HookEvent $event ) { $page = $event->arguments("page"); if(!$page->template->hasField("index")) return; // no index field in this page/template if($page->isNew() || $page->isTrash()) return; $language = $this->wire("user")->language; // save user lang $page->index = ''; if($page->template->name == "jobs"){ //the page is a detail page so render the partial file with some options $filepath = "templates/partials/jobs-detail.php"; $options = array("pagename" => $page->name); }else{ // render the page with its own template $filepath = ""; } foreach($this->wire("languages") as $lang) { $this->wire("user")->language = $lang; // change user lang wire('pages')->setOutputFormatting(true); $content = $page->render($filepath, $options); wire('pages')->setOutputFormatting(false); if($content) $content = $this->parseContent($content); $page->index .= $content; } $this->wire("user")->language = $language; // restore user language } And the inside the partial file at the moment I have this: <?php if($urlsegment){ $urlpage = $pages->get("name=$urlsegment"); } ?> markup .... I need to add this so it also works with the hooks above: <?php // check if detail page is accessd and rendered in normal way if($urlsegment){ $urlpage = $pages->get("name=$urlsegment"); } // page is render via page->render() method from the saveReady Hook if($options['pagename']){ $urlpage = $pages->get("name=".$options['pagename']); } ?> markup... Don't know if this will work have to try this. Greetings Orkun
  25. Thanks for your Input @Robin S! I think I will go with the last option since it would solve another problem I have ;D. Greetings Orkun
  • Create New...