Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/10/2019 in all areas

  1. Just tag your images. https://processwire.com/blog/posts/processwire-updates-and-new-field-types/
    3 points
  2. looks.ikes u w ant $table->setEncodeEntities(false);
    2 points
  3. Having this same issue and I'm running System Notifications module, shame, as I hoped the module would be really useful but is mostly a desaster.
    2 points
  4. The Page Hit Counter module for ProcessWire implements a simple page view counter in backend. Page views of visitors are automatically tracked on defined templates, with monitoring of multiple page views. This gives you a quick overview of how many visitors have read a news or a blog post, for example, without first having to open complex tools such as Google Analytics. This module quickly provides simple information, e.g. for editors. Or, for example, to sort certain news by most page views. For example for "Trending Topics". Works with ProCache and AdBlockers. With a lightweight tracking code of only ~320 bytes (gzipped). And no code changes necessary! In addition GDPR compliant, since no personal data or IP addresses are stored. Only session cookies are stored without information. In addition, there are some options, for example filtering IP addresses (for CronJobs) and filtering bots, spiders and crawlers. You can also configure the lifetime of the session cookies. Repeated page views are not counted during this period. It is also possible to exclude certain roles from tracking. For example, logged in editors who work on a page are not counted as page views. Sort by hits and access page views (hit value) Each trackable template has an additional field called phits. For example, you want to output all news sorted by the number of page views. // It is assumed that the template, e.g. with the name "news", has been configured for tracking. $news = $pages->find("template=news, sort=-phits"); To output the page views of a tracked page, use: echo $page->phits; Example: Reset counter per API $modules->get("PageHitCounter")->resetPageViews("template=whatever", false); Example: Tracking a page hit via API and jQuery If you want to track a template that does not represent a full page to automatically inject a tracking script, you can define allowed API templates in the module that you can track. Below is an example of how you can track a click on news tag using jQuery. This will allow you to find out which keywords are clicked the most. For example, you can sort and display a tag cloud by the number of hits. Suppose your keywords have the template "news_tag". The template "news_tag" was also configured in the Page Hit Counter Module as a trackable API template. Example PHP output of keywords / tags: // Required: the data attribute "data-pid" with the ID of the template to be tracked. echo $pages->find("template=news_tag, sort=-phits")->each("<a href='{url}' class='news_tag' data-pid='{id}'>{title}</a>"); Example Tracking Script with jQuery: /** * Required: Data attribute "data-pid" with the ID of the news tag template * Required: Send the POST request to the URL "location.pathname.replace(/\/?$/, '/') + 'phcv1'" * Required: The POST parameter "pid" with the ID of the template */ $(function(){ if($('a.news_tag').length > 0) { $('a.news_tag').each(function(){ var tPID = $(this).data("pid"); if(tPID) { $(this).on("click", function(){ $.post(location.pathname.replace(/\/?$/, '/') + 'phcv1', {pid: tPID}); }); } }); } }); So simply every click on a tag is counted. Including all checks as for automatic tracking. Like Bot Filtering, Session Lifetime, etc. Notice: Tracking with URL segments If the option "Allow URL Segments" is activated on a template, the hits are only counted if the base URL of the page is called. If you want the hit to be counted even when a segment is requested, you MUST configure the segments in the template configuration. How to do this can be found here. If you use dynamic segments, configure them as RegEx. There is currently no other option. The problem is that the Page Hit Counter hooked into the PageNotFound process. If URL segments are allowed but not defined, a 404 is never triggered. This means that the Page Hit Counter cannot be called. New since 2.0.0: Ignore URL segments If a template has URL segments configured, each hit on a different segment is counted as a new hit. Enable "Ignore URL segments" so that dynamic segments are not counted individually on the base template / page. New since 2.0.0: Use cookieless tracking (Experimental) Enable this option to not use individual cookies for tracking or if you have many different pages you want to track. The limit for cookies is 50 per domain for all cookies on the page. If the option is enabled, PHP session storage is used. Downside: you can't set the lifetime higher than configured in your PHP.ini and the session will be terminated as soon as the browser is closed. Upgrade note for 2.0.0 from previous versions! Version 2.0.0 requires an update in the database schema, so that additionally the date of the last access / hit on the page can be displayed ($page->lastPageHit). To make this possible, you have to do the update via the upgrade module, upload the ZIP itself and do an update directly via the backend AND DO A MODULE REFRESH DIRECTLY AFTER UPLOAD/UPDATE. If you do not do this, you will get an error that a column is missing in the database table. _______________________________________________________ Background: This module is the result of a customer requirement, where the editors are overwhelmed with analytics or no tracking tools were allowed to be used. However, a way had to be found to at least count page views in a simple form for evaluations. Furthermore, by using ProCache, a way had to be found to count views of a page without clearing the cache. _______________________________________________________ Pros Automatic Page View Tracking Lightweight tracking code, only ~320 bytes (gzipped) No code or frontend changes necessary Works with ProCache! Even if no PHP is executed on the cached page, the tracking works Works with browser AdBlockers No cache triggers (for example, ProCache) are triggered. The cache remains persistent GDPR compliant, session-based cookie only, no personal information Filtering of IPs and bots possible Exclude certain roles from tracking Ability to reset Page Views Works with all admin themes Counter database is created as write-optimized InnoDB API to track events for templates that are not viewable No dependencies on libraries, pure VanillaJS (Automatic tracking script) Works in all modern browsers Pages are sortable by hits Cons Only for ProcessWire version 3.0.80 or higher (Requires wireCount()) Only for PHP version 5.6.x or higher No support for Internet Explorer <= version 9 (Because of XMLHttpRequest()) No historical data, just simple summation (Because of GDPR) Segment URLs can only be counted if the segments are defined Planned Features / ToDos API access to hit values Since version 1.2.1 Possibility to sort the pages by hits (Request by @Zeka) Since version 1.2.0 Don't track logged in users with certain roles (Request by @wbmnfktr) Since version 1.1.0 Possibility to reset the counter for certain pages or templates (Request by @wbmnfktr) Since version 1.1.0 Better bot filter Since version 1.1.0 Disable session lifetime, don't store cookies to track every page view (Request by @matjazp) Since version 1.2.1 Option to hide the counter in the page tree (Request by @matjazp) Since version 1.2.1 Option to hide the counter in the page tree on certain templates Since version 1.2.1 API to track events for templates that are not viewable Since version 1.2.2 Cookieless tracking Since version 2.0.0 Show last hit Since version 2.0.0 Ignore URL segments (Request by @bernhard) Since version 2.0.0 Add hookable method after pageview was tracked (Request by @bernhard) Since version 2.0.0 Changelog 2.0.0 Feature request: Add hookable method after pageview was tracked (___pageViewTracked($pageID)) (Requested by @bernhard) Feature request: Ignore URL segments option (Requested by @bernhard) New: Cookieless tracking New: Show date of last hit Update: Botlist Enhancement: Documentation improvement 1.2.7 Feature request: make buildPageListHitCounter-Function public (Requested by @bernhard) 1.2.6 Bug-Fix: Set the counter of a cloned page to 0 Enhancement: The function for resetting counters is now available in the module as a public function to reset counters via own scripts on the API side (Request by @VeiJari) Enhancement: Documentation improvement API reset 1.2.5 Bug-Fix: When counting 404 hits, cookies are no longer set. The session lifetime is deactivated for the 404 page Enhancement: Documentation improvement regarding URL segments 1.2.4 Bug-Fix: Resetting the counters on system pages (e.g. 404) does not work (Reported by wbmnfktr) Bug-Fix: Tracking endpoint is logged as 404 if module "Jumplinks" is installed (Reported by wbmnfktr) Enhancement: Corrected few typos (Merged from Sergio #6 – THX!) 1.2.3 Bug-Fix: Tracking script triggers 404 if pages are configured without slash (#3) Reported by @maxf5 Enhancement: Reduction of the tracking script size if it's gzipped (~320 bytes) Enhancement: Documentation improvement Enhancement: Corrected few typos 1.2.2 New feature: API to track events for templates that are not viewable Enhancement: Documentation improvement 1.2.1 API access to hit values Use $page->phits Bug-Fix: No tracking on welcomepage (Reported by wbmnfktr; Thx to matjazp) Bug-Fix: Tracking script path on subfolders (Reported by matjazp) Bug-Fix: Tracking on pages with status "hidden" Enhancement: Change database engine to InnoDB for phits field Enhancement: Option to disable session lifetime set session lifetime to 0, no cookies Enhancement: Better installation check Enhancement: AJAX Request asyncron Enhancement: Reduction of the tracking script size by ~20% Enhancement: Option to hide the counter in the page tree You can output the counter with the field name "phits" Enhancement: Option to hide the counter in the page tree on certain templates Enhancement: Option for activate general IP validation Enhancement: Reduction of tracking overhead up to ~30ms Enhancement: Better bot list for detection 1.2.0 New feature: Sort pages by hits – New field phits Migrate old counter data to new field 1.1.0 New feature: Exclude tracking of certain roles New feature: Reset Page Views Better bot filter and detection 1.0.0 Initial release Notes By default, the page views are stored as INT in the database. This allows a maximum counter value of 4.2 billion views (4,294,967,295) per page. If you need more, change the type to BIGINT directly in the database. But I recommend to use Google Analytics or similar tools if you have such a large number of users. _______________________________________________________ Download GitHub: ProcessWire Page Hit Counter (Version 2.0.0) PW Module Directory: ProcessWire Page Hit Counter (Version 2.0.0) Install via ProcessWire (Classname): PageHitCounter _______________________________________________________ Update information If you have used version 1.2.1 from the DEV branch, please replace it completely with the new master version. Old stable version Download GitHub: ProcessWire Page Hit Counter (Version 1.2.7)
    1 point
  5. @ngrmm, you can do this by not defining a parent for selectable pages in the field settings (just define a template) and add the following in /site/ready.php: $wire->addHookBefore('InputfieldPage::renderAddable', null, 'setAddParent'); $wire->addHookBefore('InputfieldPage::processInputAddPages', null, 'setAddParent'); function setAddParent(HookEvent $event) { $inputfield = $event->object; // Only for this one Page Reference field if($inputfield->hasField != 'tags') return; // Only for ProcessPageEdit if($event->wire('process') != 'ProcessPageEdit') return; // Set the ID of the parent page that new pages should be added under $inputfield->parent_id = 1234; }
    1 point
  6. Yeah, these view links are not helpful IMO. Related request: https://github.com/processwire/processwire-requests/issues/274 Edit: just noticed that you already thumbs-upped that. ?
    1 point
  7. It could be my eyes but... ? in your second example I can't spot any difference.
    1 point
  8. This is really just a quick'n'dirty script, but I guess it should keep you going... $userlang = $user->language->name; echo "$userlang <hr>"; $g = $page->gallery->sort('tags'); // all images, sorted by tag (just for debugging) echo "all: <br>"; foreach($g as $pic) { echo "{$pic->tags} {$pic->url}<br>"; } echo "<hr>"; $g = $page->gallery->find("tags=$userlang"); // only images having current user language tag echo "userlang: <br>"; foreach($g as $pic) { echo "{$pic->tags} {$pic->url}<br>"; } $g = $page->gallery->find("tags!=$userlang"); // only images NOT having current user language tag echo "NOT userlang: <br>"; foreach($g as $pic) { echo "{$pic->tags} {$pic->url}<br>"; }
    1 point
  9. I have this option in my site/config.php file: $config->imageSizerOptions = array_merge( $config->imageSizerOptions, // all items from wire/config array( // overwrite specific items 'defaultGamma' => -1, ) ); I think the cause was something similar to what you experience with the colors, but I am not sure. Maybe try this setting.
    1 point
  10. wire( 'sanitizer')->entities( $u->title ) => $url . $u->id, wire( 'sanitizer')->entities( $u->request_type->title ), wire( 'sanitizer' )->entities( $dog_ref->title ) => $url . $dog_ref->id, wire( 'sanitizer' )->entities( $mailer->name ), ... "<a href=''>Schváliť</a>", // u NO.entitties on this.ones
    1 point
  11. Hi Adrian. Thank you for your message. Actually I have no TableCsvImportExport module, so i can not deinstall it. But install and deinstall again. The Problem persists. I checked Profields Table and it is paid module. Thank you in advance ? I deleted the folder in module directory then problem solved. Thnak you very much
    1 point
  12. @yrglx check out the docs: https://processwire.com/docs/security/file-permissions/#securing-your-site-config.php-file
    1 point
  13. You will need to work that situation out with your hosting provider. Under normal circumstances, the application configuration file (config.php) is not accessible to the outside world. Good luck.
    1 point
  14. Hi @MrSnoozles you are right - RockGrid is intended to load all data to the client at once. Doing this via paginated ajax calls would have a lot of side effects and is not planned. For example if you have column statistics showing the sum of all rows, that would not be possible when data was paginated (and not fully loaded into the grid). Also sorting would work totally different. aggrid supports this feature, but it would need a LOT more work to also support this in RockGrid. Not only for development of RockGrid but also for development of every single field/grid. When I have complex queries then I usually display only a subset of the data, for example all entries of year XXXX. You can see some performance tests here:
    1 point
  15. 1 point
  16. Finally, found it ? Just to finish this up: what i wanted was to use a foundation grid on my form to create custom grid solutions. this can be achieved by one pretty simple function (if you know which one ? ) $field = $modules->get("InputfieldEmail"); $field->label = "E-Mail"; $field->attr('id+name','email'); $field->wrapClass = "small-12 medium-6"; $field->required = 1; $form->append($field); // append the field in this example i add "medium-6" to my email field so THE WRAPPER is only 50% wide (using foundation). to achieve the grid stuff i put: $markup = array( 'list' => "<div {attrs}>{out}</div>", 'item' => "<div {attrs}>{out}</div>", 'item_label' => "<label class='InputfieldHeader' for='{for}'>{out}</label>", 'item_label_hidden' => "<label class='InputfieldHeader'><span>{out}</span></label>", 'item_content' => "<div class='InputfieldContent {class}'>{description}{out}{error}{notes}</div>", 'item_error' => "<div class='LoginRegisterError'><small>{out}</small></div>", 'item_description' => "<p class='description'>{out}</p>", 'item_notes' => "<p class='notes'><small>{out}</small></p>", 'success' => "<p class='LoginRegisterMessage'>{out}</p>", 'error' => "<p class='LoginRegisterError'>{out}</p>", 'item_icon' => "", 'item_toggle' => "", 'InputfieldFieldset' => array( 'item' => "<fieldset {attrs}>{out}</fieldset>", 'item_label' => "<legend>{out}</legend>", 'item_label_hidden' => "<legend style='display:none'>{out}</legend>", 'item_content' => "<div class='InputfieldContent'>{out}</div>", 'item_description' => "<p class='description'>{out}</p>", 'item_notes' => "<p class='notes'><small>{out}</small></p>", ) ); $classes = array( 'form' => '', // 'InputfieldFormNoHeights', 'list' => 'grid-x grid-padding-x', 'list_clearfix' => '', 'item' => 'Inputfield_{name} {class} cell', 'item_required' => 'InputfieldStateRequired', 'item_error' => 'InputfieldStateError', 'item_collapsed' => 'InputfieldStateCollapsed', 'item_column_width' => 'InputfieldColumnWidth', 'item_column_width_first' => 'InputfieldColumnWidthFirst', 'InputfieldFieldset' => array( 'item' => 'Inputfield_{name} {class}', ) ); InputfieldWrapper::setMarkup($markup); InputfieldWrapper::setClasses($classes); Important: "List" gets classes grid-x so foundation turns the container into a grid container. then the elements below receive their classes as defined in wrap-class
    1 point
  17. Saturday morning I wrote in the the latest weekly issue this: And here's the view from my front door just now, Tuesday morning: I'm not particularly superstitious, but kinda feels like I dropped the ball on this one. To my defence, on Saturday there was literally zero snow here, and the whole day was sunny and warm and all. Proper shorts and T-shirt weather. I guess the lesson here is that it's always too early to say that the winter is over. Have a great day, folks!
    1 point
  18. Okay, now I finally understood what is MVC about ?
    1 point
  19. I'm only interested in models with a great "view": https://www.google.com/search?q=models&tbm=isch Don't even try to control them, youl'll fail!
    1 point
  20. Hi Robin! Thanks for the module. I don't need it actually, but I was thinking if it's possible to see the page rendered as a logged in user, eg. not a guest, without bothering the user to log in? I had that need years ago when I had to show my editors how the page would look like when he is logged in (he see a full list of "Items") vs guest users. And if I go further, I had a need to let the user edit this page (only specific page not all pages with this template) so he can see what he would have to deal with when the site is ready for production. Of course, I could point him to skyscrapers demo site or I could put my site to demo mode, but then I couldn't develop it... This is just an idea i wanted to share with, not a feature request.
    1 point
  21. What could the controller look like then? ?
    1 point
  22. That $floors is just a variable set from the php file which actually includes the skyscraper-list-item.php. You'll have to modify the php file actually including this one (may be included multiple times). You may start looking in function renderSkyscraperListItem located in _func.php: // send to our view file in includes/skyscraper-list-item.php $out = files()->render('./includes/skyscraper-list-item.php', array( 'skyscraper' => $skyscraper, 'url' => $skyscraper->url, 'img' => $img, 'title' => $skyscraper->title, 'city' => $skyscraper->parent->get("title"), 'height' => $skyscraper->get('height|unknown'), 'floors' => $skyscraper->get('floors|unknown'), 'year' => $skyscraper->get('year|unknown'), 'summary' => summarizeText($skyscraper->get('body'), 500) )); ...and, of course, welcome to the forum!
    1 point
  23. Microsoft Edge arrived in its Chromium-flavour version. For those who want to give it a try already. Right now you can download the DEV (weekly updates) and CANARY (daily updates) versions. https://www.microsoftedgeinsider.com/en-us/download/ Windows 10 needed. Windows 8.1/8/7 and macOS will follow soon.
    1 point
  24. Thanks @horst & @szabesz. I wouldn't want to install Admin on Steroids just for this, I actually use your module @horst https://modules.processwire.com/modules/page-tree-add-new-childs-reverse/ but personally I think this kind of thing should be in core. Why not multi-sort? Or at least a site-wide config flag to change default page tree sort from ascending to descending. This is a hurdle I hit every project, and I remember initially when using ProcessWire it was a roadblock until I discovered the modules to fix. It is more developers that are coming from other CMS that I am thinking of.
    1 point
  25. It can be if you persist hard enough with DB modifications and other trickery, but that module is the devil incarnate for sure ?
    1 point
  26. @Peter Knight Do you have the System Notifications module installed? As far as I know the module cannot be uninstalled so you need to live with this error. I have it too and I also get the message from time to time, however it seems to be "harmless".
    1 point
  27. In version 1.2.1 (Master) it is now possible. Every trackable template has a field called "phits". You can use this field in selectors. Either to sort: template=news, sort=-phits or as a value selector, for example: template=news, phits>=100 For an output in the frontend, simply access the field with: $page->phits This makes it very easy to output "trending topics", for example. Select news with a date field in a certain period and sort by "phits".
    1 point
  28. Such a script could be a nice troubleshooter for beginners if it were included in the backend somewhere - maybe worth a PR? ? It could be a simple InputfieldMarkup where the Locale translation happens.
    1 point
  29. Sorry guys for all those posts... Found the performance-killer: It is the ORDER BY field(`pages`.`id`, 52066,52067,52068,52069,52070 ... ) part. Without retaining the sort order of the pages->findIDs it is a LOT faster (4s without sort compared to 60s with sort and 75 using findMany): 91300 items: rockfinder = 4385.5ms | findmany = 74213.9ms | 5.91% I'll add this as an additional option and switch sort order OFF by default since sorting will be done by RockGrid anyhow No problem at all. I need this stuff for my own work, so any help is welcome but of course not expected PS: again the tests without sort order 11 items: rockfinder = 4ms | findmany = 6.9ms | 57.97% 1000 items: rockfinder = 35.7ms | findmany = 744.2ms | 4.8% 5000 items: rockfinder = 165ms | findmany = 1675.4ms | 9.85% 10002 items: rockfinder = 327ms | findmany = 3359.5ms | 9.73% 35000 items: rockfinder = 1745.2ms | findmany = 28547.7ms | 6.11% 91300 items: rockfinder = 4385.5ms | findmany = 74213.9ms | 5.91% Now that looks a lot better, doesn't it?
    1 point
  30. Another performance test using findMany() So this looks like findMany() is a lot faster, but this is not true because creating the proper array of data takes longer than with RockFinder: $selector = 'parent=/data'; $finder = new RockFinder($selector, ['title', 'headline', 'summary']); t(); $result = $finder->getObjects(); d($rf = t()*1000, 'query time in ms (rockfinder)'); d(count($result), 'items'); d($result[0], 'first item'); t(); $result = $pages->findMany($selector); //$finder->getObjects(); d($fm = t()*1000, 'query time in ms (findmany)'); d($count = count($result), 'items'); d($result[0], 'first item'); t(); $arr = []; foreach($result as $p) { $arr[] = (object)[ 'id' => $p->id, 'title' => $p->title, 'headline' => $p->headline, 'summary' => $p->summary, ]; } d($fm2 = t()*1000, 'create array'); d($arr[0]); d("$count items: rockfinder = " . round($rf,2) . "ms | findmany = " . round($fm+$fm2,2) . "ms | " . round($rf/($fm+$fm2)*100, 2) . "%"); Result: Some other tests: $selector = 'parent=/persons'; // 11 items: rockfinder = 3.8ms | findmany = 7ms | 54.29% $selector = 'parent=/dogs'; // 1000 items: rockfinder = 41ms | findmany = 722.1ms | 5.68% $selector = 'parent=/cats'; // 5000 items: rockfinder = 221.4ms | findmany = 1660.8ms | 13.33% $selector = 'parent=/invoices'; // 10002 items: rockfinder = 526.6ms | findmany = 3385.3ms | 15.56% $selector = 'parent=/data'; // 35000 items: rockfinder = 7161.4ms | findmany = 27722.9ms | 25.83% $selector = 'parent=/data2'; // 91300 items: rockfinder = 59523.6ms | findmany = 76495.8ms | 77.81% What is very interesting (and not good), is that the time needed for RockFinder increases disproportionately when querying > 10.000 pages; 10.000 items = 500ms, but 3x10.000 pages = 7.000ms Maybe any sql experts have an idea?
    1 point
  31. Hi there, A colleague of mine is trying to get our site running on his local Ubuntu LAMP Setup (Ubuntu 17.10, Apache 2.4.27, PW 3.0.62, PHP 7.1.11) When he types in the Homepage URL, he's getting code outputted instead of being executed. Does any one know why? Update : Just Figured it out. Apparently, it's a new PHP7 security feature that disables from code executing if the code module starts with <? instead of <php I'm using MAMP locally so I'm guessing MAMP is somehow circumventing this but LAMP isn't. I'm posting this so people can save themselves hours pulling their hair out.
    1 point
  32. If I'm getting this right, you're talking about short open tags? That's not exactly a new thing, but rather something that users have been discouraged to use for a very long time. Though you can still enable short open tags with the short_open_tag php.ini setting, if you've still got code that relies on short opening tags, you should consider updating it to the regular <?php opening tags That being said, in PHP7 they did remove some utterly obsolete tags: the ASP style tags (<% %>) and the script tags (<script language="php"></script>). My guess is that most users probably didn't even know that those existed.
    1 point
  33. In case anyone else encounters this, I am developing a site and using CodeKit.app. Under some circumstances CodeKit was re-processing files once per 2 seconds when it should do it only when it sees an edit made by me to a .scsss or .js file etc. The answer was to get CodeKit to ignore /site/assets/ As usual the dev for CodeKit was super-fast to make suggestions and one of those lead me to the fix. Thanks Bryan @ CodeKit Edit 2017-09-07 TL;DR; alt-click folder `assets` and choose 'Skip This Folder' (LH pane) not 'Set Output Actions' (RH pane). I was getting this happening again but wasn't able to stop it - it turned out I was attempting to tell CodeKit to ignore files the wrong way(?) or at least in a way that failed. With the `assets` folder selected in CK I was clicking 'Set Output Actions' in the RH column and it appeared to stop the constant refreshing but actually that was a 'red herring'; actually what I needed to do was alt-click the `assets` folder (LH panel) and choose `Skip This Folder'. Solved ?
    1 point
  34. Hi Sérgio and Robin, thanks a lot for helping out. So the Connect Page Fields module seems to be interesting for the page reference approach – I'll check that out later today. For now, I took the repeater approach, and your three bullets were essential in achieving the goal, @Robin S. That's how I do it: 1. I search for date repeaters by treating them as template (by putting "_repeater" before the field name); I can now sort and limit the array to my tasting 2. I set "check_access=0" so that all users can see the results 3. I get field data from the page the repeater is living on by using the getForpage() method. $allEvents = $pages->find("template=repeater_event_repeater_datetime, event_datetime>today, sort=event_datetime, limit=14, check_access=0"); foreach ($allEvents as $event): echo "<h4>$event->event_date</h4>"; echo "<h5>{$event->getForpage()->event_title}</h5>"; echo "<p>{$event->getForpage()->event_desc}</p>"; endforeach; So far, that works great. Since there are some tricks involved I didn't know before, I'll keep checking, if there are any "side effects".
    1 point
  35. You can put emoji in the database (use it in text fields), but you need to use the utf8mb4 charset for your tables, which you can choose on install. You can change it later as well, but I think there's no official upgrade path to do so.
    1 point
  36. The use statement does nothing in you snippet. If you want to use "use", then like this: <?php namespace ProcessWire; use DateTime; $date = new DateTime();
    1 point
  37. I use this: $fg = $fieldgroups->get("basic-page"); $fields->saveFieldgroupContext($fg->getFieldContext("sidebar")->set("label", "aside"), $fg);
    1 point
  38. <?php if ($page->check == 1) // 1 is checked, 0 is unchecked echo "some text"; echo $page->sometextfield; ?>
    1 point
×
×
  • Create New...