Jump to content

joe_ma

Members
  • Posts

    182
  • Joined

  • Last visited

Everything posted by joe_ma

  1. Hello I tryed to modify the search template so as to search also descriptions of an upload field. $selector = "title|body|upload->description~=$q, include=hidden, limit=50"; That throws the following exception: Exception: Unknown Selector operator: '' -- was your selector value properly escaped? So how is this correctly done? Thanks.
  2. Thanks Adrian I changed all these lines and now it works. Sort of. But: the leaflet.js script that is now loaded still contains links to unsecure sites. I get the following errors/warning:
  3. I changed my site to https using the Let's encrypt certificate. Therefore I uncommented the respective lines in the .htaccess. But the leafletmap module doesn't seem to get this right and includes the css files in the head of the page with http only. So the page doesn't load because of mixed content. Where can I fix this so as the https files become included? Thanks for help.
  4. Thanks a lot. Works like a charm and is – of course – much more elegant than my gobbledigook.
  5. Hi Trying to setup a customized navigation. Page tree looks like this: home – upcoming exhibitions –– exhibition 1 –– exhibition 2 –– … – about – archive –– arch 1 –– arch 2 –– … – impressum Now I'd like to have a navigation, that lists only the subnav of "upcoming exhibitions" but not the one of "archive". I modified a snippet I found here in the forum. It looks like this so far: <nav class="mainNav"> <ul> <?php $homepage = $pages->get('/'); // first item links to the homepage echo "<li><a href='$homepage->url'>Aktuelle Ausstellung / current exhibition</a></li>"; $children = $homepage->children(); // render an <li> for each top navigation item foreach ( $children as $child ) { if ( $child->id == $page->rootParent->id ) { // this $child page is currently being viewed (or one of it's children/descendents) // so we highlight it as the current page in the navigation echo "<li class='active'><a href='$child->url'>$child->title</a></li>"; // if upcoming page has children, list them } elseif($child->id == 1020 && count($child->children)){ // build the subnav and list all items echo "<li><a href='$child->url'>$child->title</a><ul class='upcoming'>"; foreach($child->children as $c){ echo "<li><a href='$c->url'>$c->title<br>{$c->date_from}–{$c->date_to}</a></li>"; } echo "</ul><li>"; // otherwise list only main items } else { echo "<li><a href='$child->url'>$child->title</a></li>"; } } ?> </ul> </nav> This puts out the navigation as wanted, but only for main items (see fig. nav-open.png). As soon as "upcoming exhibitions" or one of its children is active, the navigation collapses (see fig. nav-closed.png). I cannot find out, where I went the wrong way. Thanks for help.
  6. Thanks a lot. I think that solved the problem. The admin of the server started a thread of his own and got the problem solved:
  7. I'm trying to run pw (intranet) on a IIS Server. Now I encountered permission issues: It is only possible to create new pages (with file uploads), when permissions are set to "everybody is allowed to do everything". Obviously our server admin is not happy about this. As I don't know anything about permission settings on IIS servers I'd be glad if someone could tell me what user should have which permissions. And: when in config.php debug is set to true, the page tree in the back end is no more accessible. Thanks for help.
  8. Hi I've got the following tree of pages: - page with press overviews per month - page 1 with press overview per day (hidden, template=pressespiegel) - page 2 with press overview per day (hidden, template=pressespiegel) - page 3 with press overview per day (hidden, template=pressespiegel) - … The template of the parent page lists the child pages. I'd like to modify search.php so as to search the child pages for the search term, but if the page has the template of "pressespiegel" list only the parent page. So my code looks like this: //look also in hidden pages $selector = "title|body~=$q, include=hidden, limit=50"; // Find pages that match the selector $matches = $pages->find($selector); //new array to store the final list of results //because I don't want to list hidden pages $result = new PageArray(); foreach ($matches as $m){ //if the page is hidden, list the parent of the page //because subpages are already listed via template of the parent page if ($m("template=pressespiegel")){ $result->add($m->parent); } else { //otherwise add the page $result->add($m); } //list parent pages only once $result->unique(); } // then put out $result But this results in always listing the parent pages, even when they don't have the template "pressespiegel". Thanks for help.
  9. Exactly. That did the trick, everything is fine now. Thank you very much, Soma.
  10. I am releaved! I think the problem is that dataTables modifies the DOM when you navigate to another table page. So the obfuscator only «sees» the addresses of the first table page and resolves them to their correct email address. So I thought it was a good idea to call EmailObfuscator before the </head> tag instead of the </body> tag. But this doesn't work either. In this case not even the emails of the first table page are being resolved.
  11. I don't think so, at least I don't. The module I use is Email Obfuscator and the link for «more information» on this module lead me to this thread.
  12. Hmm … I just became aware, that this problem doesn't occur on my local installation, only on the live server. And with the drawCallback function on the live server, pagination doesn't work any more.
  13. Thanks Macrura I am not sure how to do this though … Would this be correct? $("#myTable").DataTable( { paging: true, lengthChange: false, pageLength: 5, pagingType: "simple_numbers", info: false, responsive: true, language: { search: "_INPUT_", zeroRecords: "Ihre Suche ergab kein Resultat<br>Votre recherche n'a pas reçu des resultats", searchPlaceholder: "Tabelle filtern nach … / filtrer le tableau pour …", paginate: { previous: '‹', next: '›' }, aria: { paginate: { previous: 'Previous', next: 'Next' } } } "drawCallback": (function() { // restore mailto: links $("a[href^='GOSPAM:']").each(function(){ var email = $(this).attr("href").substr(7); // replace email with its reversed version email = email.split("").reverse().join(""); // replace "GOSPAM:" with "mailto:" $(this).attr("href","mailto:" + email); }); $(".email-obfuscator-unreverse").each(function() { $(this).replaceWith($(this).text().split("").reverse().join("")); }); }); });
  14. I encounter problems using this module and jquery datatables together. Datatables is used to filter and paginate big address lists. The problem: EmailObfuscator works nicely on the first page of the paginated addresses. But it doesn't on the following pages of the paginated address table. Email addresses on the first page are correctly resolved to links like "mailto:name@domain.com". From the second page of the paginated table onward links keep the "GOSPAM:" prefix and the email address is following in reverse. jquery and datatables scripts are called before the </body> tag, as is EmailObfuscator. My script for the datatables looks like this: $("#myTable").DataTable( { paging: true, lengthChange: false, pageLength: 5, pagingType: "simple_numbers", info: false, responsive: true, language: { search: "_INPUT_", zeroRecords: "Ihre Suche ergab kein Resultat<br>Votre recherche n'a pas reçu des resultats", searchPlaceholder: "Tabelle filtern nach … / filtrer le tableau pour …", paginate: { previous: '‹', next: '›' }, aria: { paginate: { previous: 'Previous', next: 'Next' } } } }); Thanks for help.
  15. I changed the textarea field from inline editor to regular editor, now the error doesn't occur anymore. Changing back to inline editor produces the error again. In both cases ACF and HTML Purifier are set to "yes". Don't really know, what seems to be the problem here. EDIT: Changing the textarea from inline to regular did not quite solve the problem. Now the error message is thrown when trying to save the page. So I set HTML Purifier to "no". Now everything seems to work ok.
  16. Hi Due to a major redisign of my site I upgraded from pw 2.4 to 3.0.42, following all the steps explained in the readme file. So far almost everything worked fine. The front end works as expected, no errors there. In the backend however, when trying to edit some of the pages I get the following message: Looking up line 9706 of this module, there is nothing at all. In fact lines 9705 through to 9709 are empty … I am not aware to have used this module at all. The difference between pages I can edit and the ones I can't is the template. The ones I can edit don't use the body field but another one. Both fields are textareas with CKEditor and I can't see any difference between the settings of the two. And I don't exactly know, whether HTMLPurifier has anything to do with these fields. (Please don't ask me, why I use different fields … don't know it anymore. It's history. ) Update: This error doesn't occur on my local installation, from where I uploaded the site to the live server.
  17. Thanks Robin, exactly what I needed. Works like a charm.
  18. Wow, this is great! I've also got a sorting problem, maybe this could be achieved in a similar way? The problem is this: I need a list of pages, that contains elements from the respective parent page. Is there a way to sort the list by a field that is only in the parent page? Something like: $results = $pages->find("template=name-of-child-template, sort=parent->field-on-parent-template");
  19. Oh, thanks very much! Could have known this from the search template …
  20. Hi How can I seperate pages whose title contains a certain string from an array of pages? So with $results = $pages->find("template=template_name"); I get an array of all the pages. Now I should like to extract only the pages that contain the string 'Nr. 7' in the title. How can I do this? Is there a direct way with strpos()? EDIT: Found the solution: $tickets = array(); foreach ($results as $result){ if (strpos($result->title, 'Nr. 7') !== false){ $tickets[] = $result; } }
  21. OK, thank you very much for these clarifications. I think in this case pagination won't be a problem, because there will not be more than up to ten results anyway. So I probably stick with my solution. Thank you both for your help.
  22. So the structure of the site is like this: - event (template: event) - event date (template: event_date) - event date (template: event_date) … Each child of event has a unique event number that is also its title. But the children are not viewable, because they are listed in a table. I like the titles (i.e. the event numbers) of the children also to be searchable. So I tried this $selector = "headline|title|body|sidebar|untertitel|mitwirkende.title|moderator.title~=$q, limit=50, template=event|basic-page|kontakt"; $eventNr = $pages->get("title~=$q, template=event_date"); //Subpage that has title equal to query (not viewable) $eventParent = $eventNr->parent; // Get the parent (viewable) of this subpage if($user->isLoggedin()) $selector .= ", has_parent!=2"; // Find pages that match the selector $matches = $pages->find($selector); if($eventParent){ $matches->add($eventParent); } // rest see original post That works fine, but lists also pages from the trash. How can I exclude the trash?
×
×
  • Create New...