Jump to content

szabesz

Members
  • Posts

    3,020
  • Joined

  • Last visited

  • Days Won

    20

Everything posted by szabesz

  1. include_once "creds.php" and similar do work for me. Maybe is it something about your setup?
  2. Hi, I guess you have permission issues. In my cPanel blog post I show my own setup, you might be interested in it.
  3. Hi and welcome to ProcessWire, First of all, I do not think 10k+ sub-pages would be an issue for ProcessWire, but as the database grows optimized queries and caching are a must which is possible with PW, especially if your server is fast enough since you can delegate some logic to PHP as well when that can cut down on SQL queries. What you will not get with ProcessWire out of the box are things like "sales graphs, shipping methods & costs, order status, payment status (for bank transfers for example) etc..." Padloper can help you there but even Padloper is more like a skeleton then an out of the box solution. I've never used it but that is what I have gathered by reading about it. I have experience with WooCommerce and Magento v1, I wouldn't recommend any of them though. Magento is "over engineered" I think (they call it enterprise level, I call it unnecessarily complicated) and WooCommerce is just WordPress, so you know what it means... If you feel confident with Symfony then the alternatives you found sound viable options to me. I am working on a ProcessWire ecommerce site at the moment but I'm free in choosing external tools like Snipcart which is an alternative way to cut down on development. Hope this helps a bit. Others might join in the discussion with more info on the topic.
  4. I should have gone to bed last night instead of... It does work indeed (PW 3.0.62) I was probably on the wrong page of the site to test it but around midnight it is sometimes hard to tell things apart Thanks for your help @thetuningspoon and @Robin S!
  5. You mean this one? https://github.com/processwire/processwire/blob/master/wire/core/WireInput.php#L504 https://processwire.com/api/ref/input/http-url/ Does not seem to work. I get no query string. Not to mention the lack of urlSegmentsStr support, at least I cannot see it or looking at a completely wrong place... I dunno At least your snippet works fine. Thanks once more!
  6. I have turned it into a Page method: /* Returns the complete URL of a Page. * * @param int arguments[0] Pass false to exclude the pageNum of the Paginator * @return string */ $wire->addHookMethod('Page::siteCompleteUrl', function($event) { $withPageNum = isset($event->arguments[0]) ? $event->arguments[0] : true; $full_url = page()->url; if (input()->urlSegmentsStr) { $full_url .= input()->urlSegmentsStr; } if ($withPageNum && input()->pageNum > 1) { $full_url .= "/" . config()->pageNumUrlPrefix . input()->pageNum; } $event->return = $full_url; }); Small changes were applied to it: "/" is added in the second "if" to avoid double slashes on the pages of the paginator first argument can be used to exclude the page number of the paginator, defaults to true
  7. Could be turned into an optional core feature Thanks for sharing anyway!
  8. So maybe it is me who has not spent too much time on it? I see what you mean now. Yep, I guess the label did change but Page == Page Reference, so the latter is more appropriate.
  9. Hi, I guess you just do not spend too much time setting up ProcessWire fields If you need a "Page field" you have to choose "Page Reference", it has always been the case since it stores references to Page objects not the Pages themselves. I guess Notifications is used by the Notifications Module but I've never checked it as it looks obvious. Hope this helps.
  10. Regarding your first issue: and in mystyles.js: CKEDITOR.stylesSet.add( 'mystyles', [ { name: 'Warning Paragraph', element: 'p', attributes: {'class': 'uk-alert-warning', 'data-uk-alert': ''} }, { name: 'Success Paragraph', element: 'p', attributes: {'class': 'uk-alert-success', 'data-uk-alert': ''} } ]); This setup works for me in ProcessWire 3.0.62. Is it what you are looking for? Also, something like this is my config-body.js: I have not yet worked with contents.css/contents-inline.css, it is still on my todo list...
  11. I have just tested @owzim's other great module InputfieldAceExtended which works perfectly if we want to use syntax highlighting for YAML. However, @Robin S's suggestion to fix the error changes the Details Tab, making it impossible to configure the InputField Type as seen in the screenshots below: original: after applying the suggestion:
  12. Aha, yes! Thank you! I keep forgetting that we have unformatted values too. I updated both methods in my original post. Cheers,
  13. Hi @Zeka Sure, however the most convenient way to do it is "just to save" what you've put together in the admin. Besides, site editors could do it too, just like working with Find's Bookmarks or ListerPro's Listers.
  14. Thank you @ryan, pretty impressive so far! Just one question: are we going to be able to save "presets" too? So that predefined export/import settings can be made available when needed.
  15. @owzim Hi, any chance of applying this fix? Thank you in advance.
  16. Hi PW fanatics In this post I share two of my addHookMethods for those interested. As you surely already know (if not, time to take a look at it) the Wire::addHookMethod() and the Wire::addHookProperty() API methods can be used to "breath some extra OOP" into your projects. Using addHookMethods and addHookProperty are alternatives to "Using custom page types in ProcessWire". The methods I want to share: basically the idea here is to get the URL pointing to images uploaded in the admin without writing much code in the template files. With methods like these below, it does not matter what Formatted value is set to the images, because some predefined defaults are used in all circumstances. #1 Example template file code: <?php $img_src = $latest_article->siteFeaturedImage(); ?> <img src="<?= $img_src ?>" alt="<?= $page->title ?>"> addHookMethod goes into /site/init.php <?php /* Returns URL of the original Pageimage of Article. * Image field's value can be either null (default missing image), Pageimage or Pageimages. * * @return string */ $wire->addHookMethod('Page::siteFeaturedImage', function($event) { $page = $event->object; if ($page->template != "article") { throw new WireException("Page::siteFeaturedImage() only works on 'Pages of article template', Page ID=$page is not such!"); } $article_featured = $page->getUnformatted('article_featured'); //always a Pageimages array if (count($article_featured)) { $img_url = $article_featured->first()->url; } else { $img_url = urls()->templates . "assets/img/missing-article_image.jpg"; //we show this when image is not available } $event->return = $img_url; }); ?> #2 Example template file code: <?php $img600_src = $page->siteProductImageMaxSize(600, 600, ['rotate' => 180]); ?> <img src="<?= $img600_src ?>" alt="<?= $page->title ?>"> addHookMethod goes into /site/init.php <?php /* Generates image variations for Product images. Returns URL of Pageimage. * Image field's value can be either null (default missing image), Pageimage or Pageimages. * * @param int arguments[0] Max allowed width * @param int arguments[1] Max allowed height * @param array arguments[2] See `Pageimage::size()` method for options * @return string */ $wire->addHookMethod('Page::siteProductImageMaxSize', function($event) { $page = $event->object; if ($page->template != "product") { throw new WireException("Page::siteProductImageMaxSize() only works on 'Pages of product template', Page ID=$page is not such!"); } $width = isset($event->arguments[0]) ? $event->arguments[0] : 48; //default width $height = isset($event->arguments[1]) ? $event->arguments[1] : 48; //default height $options = isset($event->arguments[2]) ? $event->arguments[2] : $options = array(); //default empty options $product_image = $page->getUnformatted('product_image'); //always a Pageimages array if (count($product_image)) { $img_url = $product_image->first()->maxSize($width, $height, $options)->url; } else { $img_url = urls()->templates . "assets/img/product-missing-image.jpg"; //we show this when image is not available } $event->return = $img_url; }); ?> BTW, you can find more examples here: How can I add a new method via a hook? Working with custom utility hooks Adding array_chunk support to WireArray addHookProperty() versus addHookMethod() Have a nice weekend!
  17. Hello @madknight and welcome to the ProcessWire Forums, Have you already seen this? https://processwire.com/docs/tutorials/ especially: Installing a CSS Framework How to structure your template files also, in the newest versions of ProcessWire we have Markup Regions: https://processwire.com/blog/posts/processwire-3.0.62-and-more-on-markup-regions/ and Field Rendering: https://processwire.com/blog/posts/processwire-3.0.7-expands-field-rendering-page-path-history-and-more/ I use the above two to better structure my template files. In my setup Markup Regions is used for various page layouts where I can also dinamically add additional script and css files to a given page when needed (e.g. only the home page needs a slider JS and its CSS, etc...) I use filed rendering to render the "Main Content div" and also some fields when appropriate. I also use include when rendering fields is not possible (there are no such fields...), eg.: include __DIR__ . '/../../partials/article-lead-home.php' But there are various ways to do it. Some use templating engines for example, such us Twig, Latte, etc... You can find modules which support working with them more easily. In ProcessWire first you need to figure out your own way of setting site profiles up. It takes time, but it is worth it because you can build your "frontend theme" – which we call Site Profiles BTW – the way you want. Hope this helps. Also you can seach the forum for more ideas. Just use Google like this or similar.
  18. Well, I'd better show an example, I guess. Something like this: http://www.theblog.ca/wordpress-post-notes On the WP dashboard there is a "collaboration notes made by others" and underneath there is an AXAJ form to add more notes. It is like a simple message board when used with this simple setup. This WP plugin has more to it than a "global" message board, but I've never tried those features. Most of the time a simple FB like flow of conversation is enough when only a few editors are using a site. Maybe your module is not about such a feature?
  19. I am wild guessing here but do you have "Check for upgrades on superuser login?" turned on? The Upgrades module utilizes loginHook and maybe your other 3rd party module too and there might be some conflict there.
  20. Maybe related: https://github.com/processwire/processwire-issues/issues/319 There seems to be some mayor issue with setAndSave().
  21. Hi Csaba and welcome to ProcessWire, Can you please provide more info about the issue you are having trouble with? We need to see your actual code you are trying to use to display those links/pages so that we can help you out. Also, maybe you are modifying some existing site profile? If so, which one?
  22. Hi @benbyf What is "Memebers"? Jokes aside, I would love to see "shared message boards", seen by defined group members (roles), so that site editors/administrators can send/discuss important messages in order to better collaborate, say on a dashboard which loads first when logging into admin. Does your module support something like that? I cannot seem to decipher this from your description above. Thanks in advance, BTW, sounds like a nice module anyway.
  23. One might also find it helpful for batch changing pages and more. @adrian's great helper tool, the Admin Actions module:
  24. Currently I have no issues with Upgrades module connecting to GitHub either. In the past once I had issues with it too, but at that time GitHub was brought down by DoS attack or something like that.
×
×
  • Create New...