Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

4 Neutral

About CalleRosa40

  • Rank
    Jr. Member

Profile Information

  • Gender
    Not Telling
  • Location

Recent Profile Visitors

529 profile views
  1. @teppo Thanks for your help! Sorry for the delay (and sorry I have to get back to this). Yes, you're right, I use Hanna Code on my site. My code works fine though except when called by your indexer. I noticed another thing: When trying to save the page which calls my HC, PW gives the same error as above. This is the content of my HC causing the trouble: if($page->images_gallery->count()) { // images_gallery is a repeater field $gallery = "<div class='gallery'>"; foreach($page->images_gallery as $img) { if($img->image_caption) { $titleAttr = "title='" . strip_tags($img->image_caption) . "'"; $imgCaption = "<div class='lightbox-caption'>$img->image_caption</div>"; } else { $titleAttr = ""; $imgCaption = ""; } $gallery .= " <a href='{$img->image->url}' $titleAttr> <img src='" . $img->image->size(250, 250)->url . "' alt='" . $img->image->description . "'> $imgCaption </a> "; } $gallery .= "</div>"; echo $gallery; } This is tailored to output formatting being on, as is usually the case when HC is called. How does your indexer handle OF when it pulls content from fields? I'm still confused by the fact that triggering your indexer via API does NOT lead to any error. The error seems to appear only when the backend is "involved". Any ideas? Thanks a lot!
  2. Hi @teppo, Thanks a lot for your module! Whenever I check "Index pages now?" in the module's backend config and save to build/rebuild the index field, PW throws a lenghty error (see attached PNG). I've selected a couple of text/textarea fields to index and included the index field in my templates. Calling $modules->get('SearchEngine')->indexPages(); from the search template seems to work fine though. Am I making some newbie mistake here or is that an actual bug?
  3. Hi, I had this piece of code in my template file's head section, a fix for older IE browsers: <!--[if lt IE 9]> <script src="<?=$config->urls->templates?>js/html5-3.6-respond-1.4.2.min.js"></script> <script src="<?=$config->urls->templates?>js/rem.min.js"></script> <![endif]--> EMO 1.2.2 inserted its own code inside the conditional comment which resulted in it not working properly (in browsers other than old IE, of course): <!--[if lt IE 9]> <script> var emo = emo || {}; emo.key = 'PDHeN7ZbGViB1m0ATUpc5rC3tY_8fgEqkl6dw2nMKQSLxWouahI.4vJFyOXzs9Rj'; </script> <script src="/site/templates/js/html5-3.6-respond-1.4.2.min.js"></script> <script src="/site/templates/js/rem.min.js"></script> <![endif]--> I don't know the exact way EMO determines where to place its code, but it should probably make sure its JS does not end up in any conditional comment. Apart from that, thanks a lot for a very useful module. Michael
  4. Hi all, I'm using the current version of MarkupCookieConsent on PW 3.0.62, but it doesn't seem to work anymore (used to work fine a while ago). No error message whatsoever is displayed, but still no cookie is set (checked it in browser as well as on module's config page). The consent message isn't displayed either. I've already deleted/reinstalled the module two times. Is anyone else experiencing the same problem? Suggestions? Thanks a lot! Michael
  5. $page->editUrl is still lacking from the cheatsheet. (However, it has found its way into the API reference, cf. https://processwire.com/api/ref/page/edit-url/.) Would be nice and helpful if somebody could fix this. The cheatsheet is still being maintained, right?
  6. @adrian I just added my two newbie cents to the Github thread. A slightly cleaner and more "additive" solution would be this, I guess: $repeaterItem->addStatus(Page::statusUnpublished); $repeaterItem->removeStatus(Page::statusOn); However, that's still a rather ugly workaround for PW's confusing behavior.
  7. @adrian Thanks a lot. That was the right track indeed. Yes, I'm experiencing exactly the same strange behavior as described in your bug report. Setting $repeaterItem->status=2048 instead of using addStatus() works for me. For the record, from FieldtypeRepeater.module: @horst Thanks to you, too. Yep, I kept all that in mind.
  8. Hi all! How can I unpublish/hide a repeater item using the API instead of manually toggling its status in the backend? I searched high and low in the forums but did not find much on the topic ... Knowing that repeater items are actually pages, I've tried playing around with $repeaterItem->addStatus(Page::statusUnpublished) and $repeaterItem->addStatus(Page::statusHidden). No luck though. What's the correct way to do this? Could someone please put me on the right track? Thanks!
  9. $_SERVER['REQUEST_URI'] does the trick. Thanks, @blynx and @flydev.
  10. Hi all, I've created a custom template to display 404 errors including a search field etc. When this template is called up, that is, a visitor has requested a page that doesn't exist, I would like to notify the admin that a 404 error occurred by sending a mail using PHP's mail() function. This mail should include the URL that triggered the 404. How can I retrieve that URL in the template? $page->httpUrl just returns "http://mysite/http404", which is of no use. However, the non-existing URL - the one I want - is shown in the browser's address bar. Thanks a lot!
  11. Cool, thank you very much. "Quite easy" indeed. Automatic HTML/CSS generation via $paginatedPageArray->renderPager(); works this way, but if you display the array, it always contains the full set of starting-page items on any of the paginated pages. I guess this has something to do with there being no real selector the array was "built" with (as it would have using $pages->find(), cf. http://cheatsheet.processwire.com/pagearray-wirearray/pagearray-only/a-getselectors/). I added $outputPageArray = new PageArray(); for($i = $start; $i < $start + $limit; $i++) $outputPageArray->add($paginatedPageArray[$i]); after your snippet to create a new output array that contains only a subset of pages (e.g. 1-10, 11-20 etc.). So far, this seems to work fine.
  12. I'd put it at 100 starting-page items max (older items will be removed manually once in a while). I'm definitely not a pro programmer, so writing my own code to display a paginated PageArray seems like a daunting task to me. However, I'm willing to learn. Any hints or links on how to do this the "quite easy" way?
  13. Thanks, LostKobrakai. Hm. Then do you or does anyone have any thoughts on how to solve what I am trying to do without using the Page field type? My scenario (quite simple and common, I guess, however I'm stuck): I want to feature a user-defined set of pages on the starting page of my site. These pages come from different categories all over the site. Users should be able to change the order of items in a simple and user-friendly way in the backend. I don't want copies of the starting-page items, but rather a simple way to link to the original pages and put them together on the starting page. Using a Page field (with PageListSelectMultiple selector) seemed like a good idea, but if I have to write my own code for pagination (which, I assume, isn't something I could whip up in an hour or so), this doesn't work for me. Thanks so much for helping out.
  14. Hi! Is there any way to make PW paginate a PageArray that was not created via e.g. $pages->find()? I'm thinking specifically of the PageArray that is returned when accessing a field of type Page. Thanks a lot!
  • Create New...