Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/05/2017 in all areas

  1. Hej, A module which helps including Photoswipe and brings some modules for rendering gallery markup. Feedback highly appreciated (Also pull requests are appreciated ? - have a new Job now and don't work a lot with ProcessWire anymore, yet, feel free to contact me here or on GitHub, Im'm still "online"!) Modules directory: http://modules.processwire.com/modules/markup-processwire-photoswipe .zip download: https://github.com/blynx/MarkupProcesswirePhotoswipe/archive/master.zip You can add a photoswipe enabled thumbnail gallery / lightbox to your site like this. Just pass an image field to the renderGallery method: <?php $pwpswp = $modules->get('Pwpswp'); echo $pwpswp->renderGallery($page->nicePictures); Options are provided like so: <?php $galleryOptions = [ 'imageResizerOptions' => [ 'size' => '500x500' 'quality' => 70, 'upscaling' => false, 'cropping' => false ], 'loresResizerOptions' => [ 'size' => '500x500' 'quality' => 20, 'upscaling' => false, 'cropping' => false ], 'pswpOptions' => (object) [ 'shareEl' => false, 'indexIndicatorSep' => ' von ', 'closeOnScroll' => false ] ]; echo $pswp->renderGallery($page->images, $galleryOptions); More info about all that is in the readme: https://github.com/blynx/MarkupProcesswirePhotoswipe What do you think? Any ideas, bugs, critique, requests? cheers Steffen
    10 points
  2. FieldtypeColor is on github Fieldtype stores a 32bit integer value reflecting a RGBA value. Input 5 types of Inputfields provided Html5 Inputfield of type='color' (if supported by browser) Inputfield type='text' expecting a 24bit hexcode string (RGB). Input format: '#4496dd'. The background color of the input field shows selected color Inputfield of type='text' expecting 32bit hexcode strings (RGB + alpha channel) Input format: '#fa4496dd' Inputfield with Spectrum Color Picker (Options modifiable) Inputfield type='text' with custom JavaScript and/or CSS (since version 1.0.3) Output Define output format under 'Details' tab in field settings. Select from the following 9 options string 6-digit hex color. Example: '#4496dd' string 8-digit hex color (limited browser support). Example: '#fa4496dd' string CSS color value RGB. Example: 'rgb(68, 100, 221)' string CSS color value RGB. Example: 'rgba(68, 100, 221, 0.98)' string CSS color value RGB. Example: 'hsl(227, 69.2%, 56.7%)' string CSS color value RGB. Example: 'hsla(227, 69.2%, 56.7%, 0.98)' string 32bit raw hex value. Example: 'fa4496dd'(unformatted output value) int 32bit. Example: '4198799069' (storage value) array() array( [0] => 0-255, // opacity [1],['r'] => 0-255, [2],['g'] => 0-255, [3],['b'] => 0-255, ['rx'] => 00-ff, ['gx'] => 00-ff, ['bx'] => 00-ff, ['ox'] => 00-ff, // opacity ['o'] => 0-1 // opacity ) The Fieldtype includes Spectrum Color Picker by Brian Grinstead SCREENSHOTS Input type=text with changing background and font color (for better contrast) Input type=color (in Firefox) Javascript based input (Spectrum Color Picker) Settings Output Settings Input
    5 points
  3. Regarding commercial modules you should definitely ask the author of the module first, this may or may not be an issue for them. My opinion (IANAL) is that you can freely bundle open source, non-commercial modules with the site even though you're selling it "like a theme". Only exception to this would be a module with a license that doesn't permit this, but personally I'm not aware of any (non-commercial) modules like that. The point here is that each module is a separate entity that can (and should) declare a license of it's own. If, for an example, you want to bundle a GPL licensed module with your commercial "theme", that's fine, but you cannot change the license of said module. Basically this just means that whoever buys a theme from you may not redistribute your theme as a whole (unless you permit it) but they *may* still redistribute bundled modules individually.
    5 points
  4. Hi @HarryPhone, Based on what I know now: there are no specific modules you need. I would use pages to store the data. You can read the csv file and use the the API to save the data. See this comment on how to create a bash file. Make sure the the new file is somewhere accessible over the internet of place the csv file in a folder. Then you can create a cronjob and trigger the bash script to periodically execute the script. InputDependencies will work with the forms api as well: $field = $modules->get('InputfieldSelect'); $field->showIf = "something=123";
    3 points
  5. This should work $ctas = $pages->find("id=1|2, id!=$page->parents->append($page), sort=sort"); (Completely untested.)
    3 points
  6. Hello. My name is Alexey, I'm a designer. So it turned out that I got carried away by ProcessWire and made several sites (links below the post). I have a desire to make template sites for sale on various markets (where possible), as well as on my own site. I'm clear understand the difference between ProcessWire and WordPress and it's not about templates, but about simple, ready-made solutions that can been easily customized if necessary. I would like to discuss here the possibility of such activities in particular the rights of modules authors. Consider for example a hypothetical site: A simple corporate site in which (commercial and non-commercial) modules are used: AdminTheme BatchChildEditor ClearCacheAdmin EmailNewUser FieldtypeColorPicker FieldtypeMatrix FieldtypeMultiplier FieldtypeRangeSlider FieldtypeRepeaterMatrix FieldtypeSelect FieldtypeTable FieldtypeTextareas FormBuilder ImportPagesCSV InputfieldCKEditor MarkupSimpleNavigation MarkupSitemapXML PageEditPerUser PageTreeAddNewChildsReverse ProcessCustomUploadNames ProcessDatabaseBackups ProcessExportProfile ProcessTemplateEditor ProcessWireUpgrade TextformatterAutoLinks TextformatterVideoEmbed Obviously the use of commercial modules should be discussed with Cramer (or others) personally but can I use non-commercial ones in the similar projects? In general maybe this has already been discussed? —— Some of my works of PW: http://www.twenty-studio.ru/ http://ekaterinburg.guide/ http://bonus.koriphey.ru/ http://trustural.ru/ bonus.koriphey.ru http://plus.koriphey.ru/
    3 points
  7. We'be been missing you! Hope you've had a great time.
    2 points
  8. Hi @Robin S - just wanted to confirm that you have everything working as expected now when editing Page Tables in a modal window? @tpr - I am a little confused - what styles.css file are you talking about? The one included in TracyDebugger, or something else? How can you use this module in non-PW projects? @hettiger - glad you like it - thanks! PS Hi again everyone - it's been a while
    2 points
  9. Thanks everyone! This solved my issue. K.
    2 points
  10. Thanks for answering! Please don't mind the delay! I do have access to ListerPro but I was looking to export from within the Page edit screen, with an Export button I place on a PageTable Inputfield through a hook (to export the fields data in a CSV file). So I thought "I must use something already done just for the export part!". Actions on ListerPro never crossed my mind!! Ended up coding it, found great comments on other posts dealing the data-to-csv problem. So now I have an ExportPageTableToCSV!
    2 points
  11. I think the textarea fields are configured as MediumText on the database, so you'll have to change that if your needs exceed its maximum length. Check this page for a reference (this is using InnoDB engine, BTW): https://dev.mysql.com/doc/refman/5.7/en/storage-requirements.html#data-types-storage-reqs-strings
    2 points
  12. From PW's point of view, the error message is correct. It shows if you add the hook very early (like in site/init.php). PW, under the hood, calls find() with a numeric id, and that is when the error is triggered. With the numeric id, your selector becomes something like "32, loremipsum_field!=1". This has a comma and thus is a compount selector, so PW parses it into multiple expressions that need to match the form FIELD OPERATOR MATCH. The first expression, by these parsing rules, has an empty (missing) operator. Still, you should be able make the hook work for most cases with a little type checking and conditional logic. <?php wire()->addHookBefore('Pages::find', function(HookEvent $event) { // Get the object the event occurred on, if needed $pages = $event->object; // Get values of arguments sent to hook (and optionally modify them) $selector = $event->arguments(0); $options = $event->arguments(1); $customfilter = ", loremipsum_field!=1"; /* Your code here, perhaps modifying arguments */ if(is_numeric($selector)) { // The selector is a numeric page id $selector = "id=" . $selector . $customfilter; } else if(is_string($selector)) { // Regular selector, FIELD OP MATCH $selector .= $customfilter; } else if(is_array($selector)) { // Array of page ids $selector = "id=" . implode('|', $selector) . $customfilter; } else if($selector instanceof Selectors) { // Already parsed Selectors object $selector->add(new SelectorNotEqual("loremipsum_field", "1")); } else { // Unknown selector argument format! } // Populate back arguments (if you have modified them) $event->arguments(0, $selector); $event->arguments(1, $options); });
    2 points
  13. Adds a Service Worker to your Processwire site which can be customised. The service worker script itself is heavily based on Jeremy Keith’s work – thank you Jeremy! More information: https://github.com/johannesdachsel/processwire-serviceworker
    1 point
  14. Then they are not a company that deserves your money. Time to vote with your wallet and move to a new host.
    1 point
  15. Hi @adrian, everything is working as expected thanks - just took me a moment to connect the dots that no Tracy debug bar = no Tracy methods available (which makes sense). Great to have you back around here!
    1 point
  16. That, and it should be $image->size(), not resize().
    1 point
  17. Hey thanks for your reply @Robin S! Unfortunately that didn't fix it. I ended up just deleting and recreating the page and it fixed it somehow. I'll have to look into it again once I have more time. Thanks again!
    1 point
  18. @eelkenet Hmm, the deletion does take place before the db save and runs on ajax too. It's weird that I get no errors and the time is correct too. Changing if(!$this->localStorage) to if(!$this->localStorage && !$this->isAjax) should fix it.
    1 point
  19. Ok. So you have at least two ways 1. Add custom method to page object via hook 2. Add hook to Page:path Take a look https://processwire.com/api/hooks/#add_new_method
    1 point
  20. Hi @adrian and welcome back Thanks for the fix on the first problem. Now about the 2nd problem, I deleted that cause I wanted to do more testing. So here is the full problem... Problem (1st part): If I add a title on an additional language field eg. "Test" where that exact title "Test" is already on another page's additional language field from the same template when I save the page the title disappears and I'm getting the error: Session: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'test-1018' for key 'name1977_parent_id'. Problem (2nd part): If I add a title on the default language field eg. "Test" where that exact title "Test" is already on another page's default language field from the same template the page saved as /test-1 for all languages which is correct BUT if on that page (/test-1) add the same title "Test" on an additional language field the page name for that language will be saved as /test which is wrong cause now I have 2 pages with the same page names. Solution: Page name for additional language should be checked if already exists and name it properly just like it happens on the default language: Session: Changed page URL name to "test-1" because requested name was already taken.
    1 point
  21. Hi @itsberni - looks like that is a new issue in recent versions of PW. I have committed a fix which seems to take care of things here - can you please test and let me know if it works for you?
    1 point
  22. Hi @PWaddict - thanks for the report and for finding the solution - much appreciated. I have removed the changes from that update (I agree that the Page Name core module should be used to define those replacements). I noticed in the original version of your last post you mentioned a second more critical bug, but you've now deleted that - can you please confirm that everything is in fact OK with that and that nothing needs fixing?
    1 point
  23. Welcome @obesegiraffe, Not sure that this could be the cause of the problem, but the way you are checking if the Options field is populated looks a bit unusual to me. Does it make a difference if you use count() instead? <?php if(count($page->percent_leased)){ ?> <h2><?=$page->percent_leased->title?>% Leased</h2> <?php } ?> The database table looks like what you get if your Options field is set to one of the "Multiple values" inputfields. If you have changed the input type from Multiple to Single at some point then you would need to save each of the pages in admin that had any multiple values saved for it in order to trigger the value to update.
    1 point
  24. Hi @itsberni - sorry for such a delayed response - I am just back from an extended time away from my computer. I have added a new Bcc email field to the module config settings. All emails will be Bcc'd to the entered address automatically. Please let me know how it goes for you.
    1 point
  25. You'd be better off using Jumplinks as it is, as @eelkenet says, less problematic. However, if you really want to use mod_rewrite: # Place under RewriteEngine On RewriteRule ^oldpage.html$ /new-location/? [R=302,L] To make permanent, switch out 302 for 301.
    1 point
  26. Hi @Pretobrazza and @CodeCoffeeCode - I am sorry for the very long delay in responding - I have just returned from an extended time away from my computer. It looks like the issues you were having with textareas fields and the map marker were actually due to PHP 7. The latest version should fix things - I tested with textareas which now work perfectly again - hopefully map marker fields will also work again now. I have also fixed some other issues with adding multiple new child in Edit mode and also taken care of this issue. Please let me know how things work for you now.
    1 point
  27. Well I finally figured out my problem... I set the language on top of my document to German (Deutsch): $languages->setLanguage('deutsch'); and after that changed the names of my languages which is why it threw the errror... consider this topic as fixed/closed. I don't know how to mark the topic as "solved". Cheers
    1 point
  28. Absolutely. Nowadays we build most of the stuff in the back-end with custom Process modules in combined with the forms api. Importing content is also pretty easy. You might ask why not in the front-end? Because the roles and permissions work flawlessly in the backend and the back-end looks pretty good (Reno looks imo the best), but you can create your own based on Uikit. If you want to overwrite the default styling take a look at AdminCustomFiles where you load css and javascript files. Also take a look at MarkupAdminDataTable since most of the stuff you will need is forms and tables. This makes it pretty easy to prototype.
    1 point
  29. I think you just need to make sure you don't return from ___uninstall. Throwing an exception should be sufficient, though I haven't tested it. if(! $this->canWeUninstall()) { throw new WireException("Whoops! Module cant be uninstalled as it appears to be in use."); }
    1 point
  30. Thanks Johannes for the module. I got it running , but checking with the dev tools in Chrome I got no 'OK' in the response column for the requested cache items (see picture). Looking at https://developers.google.com/web/fundamentals/getting-started/codelabs/your-first-pwapp/ they show a 'OK' in that column. So I am not sure whether the caching works correctly or not. (Update: In Firefox Dev edition it shows OK for the responses)
    1 point
  31. See the "https" property of the Template class: https://processwire.com/api/ref/template/ $t = $templates->get("name=admin"); $t->https = 0; $t->save();
    1 point
  32. This week we’ve got a new multi-language email field, a tutorial on how to use file/image files as multi-language fields, plus we introduce a new and unique ProFields module that’s in the works. https://processwire.com/blog/posts/processwire-updates-and-new-field-types/
    1 point
  33. Update: working with this setup for a few months, I had quite a few permission related issues which were frustrating. So I decided to do some more research on existing docker projects that are well maintained and bring the features I need. Finally I found http://laradock.io/. I've been using it for 3 months now and I am really happy with it. Very flexible and well maintained set of docker containers. I'm totally happy and can recommend it to devs who are interested in this topic.
    1 point
  34. Hi, FYI, Adrian is still away for a few weeks, see:
    1 point
  35. Hi adrian, thanks for this module. i´ve installed the module with pw 3.0.56. my problem ist, that i can´t save a mp4 file. i can drag the file but after pushing the "save"-button the mp4-file dissapears. Do you have any suggestions, what i could try to get this to work? Many Tanks!
    1 point
  36. I just wanted to say THANK YOU @adrian Great work!
    1 point
  37. @adrian When you get back online please fix the below issue: Problem: Removing the title from an additional language the page name doesn't switch back to default's language name. Solution: You have to remove this update. You added that cause @videokid had problem with the Greek characters. If someone wants to replace non-latin characters there is a module on PW Core modules called "Page Name". There you can add for example the Greek characters to convert to latin characters. Like this: α=a
    1 point
  38. Unfortunately we need to wait for that for a while, see:
    1 point
  39. Hi @adrian If I remove the title from the additional language the page name doesn't switch back to default's language name. Can you please fix it?
    1 point
  40. Thanks @abdus, that gave me the clue to getting Tracy working in modals. Just uncheck the "Hide Debug Bar in Modals" options in the Tracy config.
    1 point
  41. This was bothering me when I was working on this question about PageTables. It appears that Tracy isn't included when page is called via a modal. Check this out // /site/modules/TracyDebugger/TracyDebugger.module public function init() { // ... // EARLY EXITS // modals if(in_array('regularModal', $this->data['hideDebugBarModals']) && $this->wire('input')->get->modal == '1') return; if(in_array('inlineModal', $this->data['hideDebugBarModals']) && $this->wire('input')->get->modal == 'inline') return; // ... } We need you @adrian, come back!
    1 point
  42. Hi @adrian, just leaving this here now while I remember for when you are back. I'm not able to use Tracy inside a ProcessPageEdit hook when the page being edited is a PageTable page (i.e. in the modal window). In /site/ready.php (or /site/init.php)... $this->addHookBefore('ProcessPageEdit::execute', function($event) { bd('testing'); });
    1 point
  43. Hi tom0360, Welcome to the forums! ProcessWire does not care what you use for your front-end. I have been using Bootstrap for a while. It's setup is just as they explain in their docs. If you are using 3.3.7 then extract the js, fonts, and css folders to your /site/templates folder. The same with 4.0.0 alpha, except they don't use the fonts folder any longer. Again, welcome. Feel free to ask any questions. There are a lot of good people here that will help.
    1 point
  44. the master branch / version from pw module directory wasn't PW 3.x ready. Previously you had to use branch develop. But I just released a new version 1.0.0 which supports ProcessWire 3.x (only). Just update the module to the latest version and everything should work as expected.
    1 point
  45. It seems more complicated than I thought it would be (thanks to my beginner level in php). The following code seems to be working, but not sure about few things (and whether it will work tomorrow): <?php $page->of(false); if (!$user->isSuperuser()) { $datetoday = date('Ymd'); if(!isset($page->dateref)) { $dateref=$datetoday; } else $dateref = $page->dateref; if( $dateref != $datetoday ) { $page->counter = 1; $page->dateref = date('Ymd'); } else { $page->counter += 1; } } $page->save('counter'); $page->save('dateref'); $page->of(true); echo $page->counter; ?> (used 'dateref' field instead of 'date', as that one is already in use) 1. I had to setup the dateref field's output as Ymd in field settings, strtotime doesn't work for me. 2. If I don't put $page->of(false); before the code, it will produce an error "Call $page->setOutputFormatting(false) before getting/setting values that will be modified and saved." Any implications to place it in the beginning? 3. If dateref field is not set, the output will default to 1970... so I had to set that to date('Ymd') in case value does not exist. 4. $page->counter = 1: if set to 0, it won't register first visit. It is working as it is, but not sure how safe/proper the code is. Any insight appreciated.
    1 point
  46. I think this would be pretty straightforward to do. Assuming you are recording a per-page count, then you'd want to add a integer field to the page (called 'pageviews' or something like that). Then at the bottom of your template: <?php $key = "pageview" . $page->id; if(!$session->$key) { $page->pageviews++; $page->save('pageviews'); $session->$key = 1; } You may also need to add a $page->setOutputFormatting(false) above that if PW throws an error. And you might prefer to take it a little further and use an array in your $session var. The only real problem with this method is that a portion of pageviews on any site are going to be from bots, spiders, etc. You can eliminate nearly all of those by setting up a new template/page that does nothing but record pageviews and hit it with javascript. The example assumes you set this up at /tools/pageview.js (a PW page), and you would paste this somewhere in your template that powers the pages you want to track: <script type='text/javascript'> // write the script statement with JS so that spiders don't attempt to include it document.write('<scr'+'ipt type="text/javascript" src="/tools/pageview.js?id=<?=$page->id?>"></sc'+'ript>'); </script> Then your template running /tools/pageview.js: <?php if(($id = (int) $input->get->id) > 0) { $p = $pages->get($id); if($p->id && $p->fields->has('pageviews')) { // page was found and it has a 'pageviews' field $key = "pageview" . $page->id; if($session->$key) { // pageview already recorded for this page, so skip it } else { // pageview not yet recorded for this page for this user session $p->pageviews++; $p->save('pageviews'); $session->$key = 1; } } } echo "// this JS file intentionally blank"; I assume you meant thousands not hundreds. But regardless of the number (or even if it has a couple extra zeros), it should not be a problem. You won't notice a difference in performance. And given that you are just saving one field 'pageviews', rather than the entire page, it'll be especially fast (at least in 2.1).
    1 point
×
×
  • Create New...