Leaderboard
Popular Content
Showing content with the highest reputation on 05/06/2017 in all areas
-
No, doing this would only allow the exact URL segment 'category'. Instead, don't place any restrictions on the segment in the template settings and do your segment validation inside the 'news' template. Rather than rewrite or render anything from a category page you can handle all the output within your 'news' template. Here is an example from a recent project: $limit = 5; $news_selector = "template=news_item, post_date<=today, limit=$limit, sort=sort"; $categories = $pages(1139)->children(); $segment_1 = $sanitizer->pageName($input->urlSegment1, true); // URL segments are already sanitized as page names but not to lowercase if($segment_1) { $current_category = $categories->get("name=$segment_1"); if($current_category) { // the segment is a valid news category $news_selector .= ", news_category=$current_category"; $page_title = "$current_category->title news"; } else { // the segment is invalid so throw 404 throw new Wire404Exception(); } } $news_items = $pages->find($news_selector); $total_pages = ceil($news_items->getTotal() / $limit); The effect of this is that if there is a valid URL segment then only news items from that category are listed, but if there is no URL segment then all news items are listed.5 points
-
This post covers what’s in ProcessWire 3.0.62 and provides an in-depth look at the final spec of markup regions, how they work, and how to use them. https://processwire.com/blog/posts/processwire-3.0.62-and-more-on-markup-regions/5 points
-
$zoho seems to be a js variable but php tries to parse (and fails). Try \$zoho. http://stackoverflow.com/questions/6066315/how-to-escape-javascript-code-that-is-echoed-in-php2 points
-
Hi, I made one with (The) Gimp once but it wasn't responsive. You can find solutions like this one, for example, via Google with the good keywords: http://mattstow.com/experiment/responsive-image-maps/rwd-image-maps.html. Then it should just be a matter of integrating it in a template file.2 points
-
Little admin helper module: Using this module you can view all template cache settings at once. E.g. cache status, cache time (configurable). Furthermore it adds the functionality to clear the entire template cache or just the template cache for a given template. Note that this may cause a temporary delay for one or more requests while pages are re-cached. GitHub: https://github.com/justb3a/processwire-templatecacheoverview1 point
-
I've created a module that spits out a simple link to the most recent track a user has scrobbled on Last.fm. It's available here: https://github.com/ethanbeyer/Processwire_LastfmApi1 point
-
More likely than this, you just have one or more of... wrong database name wrong database username wrong password for that username ...in /site/config.php Your host should have some control panel (cPanel, Plesk, etc) where you can... check the database name check the database username reset the password for that username ...and then update /site/config.php accordingly. Edit: sorry, I spoke too soon. The error message for wrong db user/pass is slightly different. So it must be either wrong database name (hopefully) or no database at all (oh dear ). P.S. I know it's not much help now but as @cstevensjr mentioned these two modules are essentials for every PW installation IMO: http://modules.processwire.com/modules/process-database-backups/ http://modules.processwire.com/modules/cronjob-database-backup/1 point
-
That's it - thanks @tpr I had another small error which is fixed now too. I needed to surround the $item->title in double quotes. Cheers1 point
-
I see you have added additional information. Please check that the database listed has the correct permissions/privileges: https://dev.mysql.com/doc/refman/5.7/en/privileges-provided.html Your web host provider can assist you to tell whether this database still exists and provide guidance on getting things working again. Good Luck.1 point
-
Sorry to hear that. For the future, you may want to look at the following modules for backup: To get a backup that will save a copy of your MySQL database: https://modules.processwire.com/modules/process-database-backups/ To automate that process, the following module is recommended: https://modules.processwire.com/modules/cronjob-database-backup/ Note: There are many other useful backup modules for ProcessWire that will provide some relief in case you have a problem.1 point
-
This is special. Thanks, Robin. I had no idea this was the best approach and makes a lot of sense (categories still exist in their own page tree outside news but can exist within via the URL). Thanks to everyone else for chiming in too!1 point
-
Yes, I have the 2.0.7 version. I found the issue. I'm using 2 fields on "Name format for children": title tour_date All these time I was only posting a title on default language. The only way to get the correct date format is If I post a title on an additional language. Can this be fixed from your module?1 point
-
1 point
-
I'm still not convinced it's easier If there would multiple helper methods in the module I would say it's beneficial. Having a module for such simple things is sooo... wordpress Classes starting with digits are OK in css3 afaik but I also try to avoid them.1 point
-
Well this is embarrassing. Turns out the problem was being caused by CloudFlare's cache. Since I rarely do stuff like this, I never remember to turn that off before I start changing things. All I can say is that I'm glad it's Friday. Thanks for your help, Rick.1 point
-
1 point
-
@ethfun, thanks for the module I suggest you prefix the classes coming from the parent pages with "parents-" (or better "parent-" for the direct parent and "parents-" for grandparents). This is because a page name may start with a digit but CSS selectors don't like that. That is from the CSS2 spec - I can't lay my hands on the CSS3 equivalent right now but I believe it is still advisable to avoid classes starting with digits.1 point
-
Hi @stufru, welcome to the forums. The file is still downloadable, but maybe there is some forum restriction that prevents users with no posts from downloading (?). Now that you have made a post perhaps it works? If not the entire plugin code is in the post above - just copy it into a file named "plugin.js" and put that inside a folder named "keystrokes". Then copy that folder to /site/modules/InputfieldCKEditor/plugins and activate the plugin from your CKEditor field settings under "Extra Plugins".1 point
-
1 point
-
It was far easier than I had first expected, as I started without much external input and CI restraints, so I could stick with UIKit defaults and had no usability expectations to meet. So I stuck with the "keep it simple" philosophy. I'm tentatively planning to make a release bundle out of it (time is as always the factor), but need to strip out a few specifics first and replace them with more generic code. There are also a few things which I simply stuck into site config but would merit a dedicated config page (think addresses, currency, holidays, time constraints and all that).1 point
-
1 point
-
It depends on your server settings. You should play around a bit with LanguageSupport:: _('C') translation strings. In my local environment I am getting the following results in a test template: setlocale(LC_TIME , 'de_DE'); echo $page->mydatetimefield; // getting Mai-27-2017 setlocale(LC_TIME , 'en_EN'); echo $page->mydatetimefield; // getting Mai-27-2017, expecting May-27-2017 setlocale(LC_TIME , 'en_US'); echo $page->mydatetimefield; // getting May-27-2017 As you can see I am not able to solve this via the module. Have also a look here http://stackoverflow.com/questions/10909911/php-setlocale-has-no-effect1 point
-
Just adding to what abdus and Macrura have said: you use URL segments to do this, but you don't need to hook page paths or render any different page. Your category pages can use a template with only a title field and with no corresponding template file - these category pages only exist for the purpose of being selected in a Page Reference field in your news article pages. In your 'news' template (the template of the parent page of the news articles) you check for a URL segment and if there is one you use that in a selector to match only news articles that have that category selected. You can do a kind of sanitizing of the URL segment by first checking if there is any page by that name using your category template or under your category parent - if there isn't then you throw a 404.1 point
-
Thank you for the update. It works great. I'm settng the locale by translating the "C" string on LanguageSupport.module on each language which is the easiest method. The other method would be to add a field for locale inside the system's template "language". I've changed the default's language locale from english to german and the module updates the page name from oct-17-2018 to okt-17-2018. So PW is aware of the datetime's language. Do you think you can get the locale from the "C" string on LanguageSupport.module or from a field under the template "language" so the module can update the additional language page names too?1 point
-
@PWaddict OK. I fixed the issue. For datetimefields the format will be pulled from the field settings including strftime formats. Datetime fields are not true multilanguage fields. The language-specific output of a datetime field can not be influenced by changing the user language. In a template, the output will be language-sensitive only by using setlocale() and if strftime formats for output are set in the datetime field settings. Inside PW datetime fields are not aware of the language. It would actually be desirable to have a field for setting locales in Processwire for each language or an option to set the locale in datetimefields settings. You maybe want to start a topic in the wishlist and roadmap section to point out Ryan.1 point
-
Between a lot of big, not-web-related projects at work, I could squeeze in having a little a fun with ProcessWire too. What was needed was a shop-like solution where employees can order lunch snacks from our local butcher. Previously, this was handled with hand-written lists in each production hall that would be forwarded over fax to the butchers, leading to all kinds of transliteration and pricing errors. Our Central Services department looked at different software packages for that, but none of them did exactly what they needed. ProcessWire to the rescue. In little more than two days, I got a fitting solution up and running: PW 3.0.52 The only two non-standard modules used are @adrian's AdminActions and my own DatetimeAdvanced Role based template access UIKit 3 with modals, flex layout, mobile-ready with hamburger menu on smaller devices Everything is a page Synchronisation of employee accounts from time management software (> 600) into PW (120 lines, runs twice a day) Mixed authentication (Windows Active Directory if user is available there, local password if not) Account balance system with manual deposits and automated checking / detuction / refunding for orders, complete transaction history visible for the user Article categories (page reference), product images (not used yet), simple product variants (1 level, text + price) Ordering contents of a shopping cart for a single day or multiple days ahead of time within (admin configurable) time constraints (order window for following day ends X hours before, holidays excluded, etc.) Delivery locations (buildings) changeable by users themselves Integrated favorites system Management area in frontend for balance bookings, managing articles, previewing orders Daily collected orders for the butchery are printed into PDF through fpdf with a tiny wrapper Product images option with thumbnails (currently not used) Small additions like price validity dates or saving and re-using shopping carts will be added over the next months The shop landing page with all relevant information: Articles are grouped by category and have dropdowns for variations (with optional price addition/discount): Editable shopping cart with option to order same selection for multiple days: Minimallistic product item editor:1 point
-
There is limited (and undocumented) AJAX 'dependent selects' support built into Page Reference fields. You must use the 'Custom find' or 'Selector string' option for defining selectable pages, and reference the source Page Reference field (that exists on the same page) using syntax like this: parent=page.page_reference_field_name Based on testing I have found: It only works for Select, Select Multiple or AsmSelect inputfields It does not work inside a repeater item1 point
-
This sounds to me like it's a permissions/access issue - so not so much about which browser but about the fact that you were probably logged in as superuser when you were first viewing the website, but you're a 'guest' when viewing in those other circumstances. Have you done anything out-of-the-ordinary around access, e.g. removed guest view permission for a template or a field? It looks like you have a single page frontend where you pull sections of content from child pages. Did you maybe do something to try and prevent direct access to those child pages? Just trying to work out why guest access would be limited somehow.1 point
-
Hi Zeka, There seem to be topics about this issue:1 point