Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/25/2019 in all areas

  1. Hey @Steve_Stifler, since you are new and asking lots of "is there a module for..." questions in the last days I think you might not have a solid understanding of what PW is and how PW works so far. I mean, asking is perfectly fine, but working with PW means working with HTML/CSS/JS in the first place and not - as you might know it from other systems - installing plugin X and plugin Y and plugin Z. PW is something more developer orientated. Something that someone might call "Framework" or "Headless CMS". PW makes it easy for you (and your users/clients) to have a solid, secure and flexible place to store various types of content and manage it. It also makes it easy for you to DISPLAY this content on the frontend. BUT - different to many other cms'es - does not dictate how you do that. You could output your data as HTML page (of course), but you could also output it as JSON, PDF, RSS, chart etc... That's why there are only very few modules that are related to the frontend of your site (the cookie banner module comes to my mind). It's totally up to you how you present your content and what frameworks you choose (CSS/JS). If you are looking for a system that has (=needs) a plugin for everything, PW might not be the best fit. If you are willing to learn and take the next step from using plugins for everything to writing your own code snippets you'll get lots of help here.
    6 points
  2. Hi everyone, Just released v4.18 this morning which comes with the new Tracy core v2.6 I have managed to retain PHP 5.4.4+ support for now. If you are running PHP 7.1+ you will get the new Tracy core, otherwise you'll be using the old 2.5 branch. I decided not to ditch < 7.1 just yet because Debian stable still ships with 7.0. Here's the list of changes: 1) New multiple AJAX debug bars This allows you to see more than one consecutive AJAX call. There is a new module setting that controls the number of AJAX bars (default 3). Adjust this if you need, but keep in mind that you don't want lots of bars stacking up as you navigate around the PW admin where opening menu items / pages are all AJAX calls. This new feature also means that the AJAX dumps panel no longer needs to store consecutive dumps, but if you still want that, then the Dumps Recorder panel will do that. 2) BarDump (bd) and barDumpBig (bdb) calls now use LIVE This feature was always not quite right in the Tracy core, but it has been rebuilt and is now the default for these calls. This makes the dumping of large / multiple objects 10x faster. It also means that we can probably increase the default maxDepth setting and increase the value for the barDumpBig even further. I haven't made these changes yet, but I am going to start testing here and see how it goes. This means that there is no longer a need for the barDumpLive (bdl) method, so this has been removed. 3) Lots of other minor/rare bug fixes and improvements Nothing worth mentioning specifically, but definitely worth having ? There will likely be more improvements to these new core features coming pretty soon, so I'll make sure we stay up to date with those also. Let me know if you notice any problems. Cheers!
    4 points
  3. Have you tried sorting by -image.count?
    4 points
  4. Hi @Peter Knight Change uk-width-expand to uk-width-1-1 IE11 has some strange bugs with flex - I believe the issue is with flex: 1 and max-width, it's respecting both but it's treating it like space-between. For whatever reason, I don't know. As you have a max-width defined in this instance uk-width-1-1 will work fine.
    3 points
  5. I think it is best to add a photo to the head element as below: ( I've added a simple if statement that will check in which template to display the pictures ) <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <title><?php echo $page->title; ?></title> <meta name="description" content="<?php echo $page->summary; ?>" /> <link href='//fonts.googleapis.com/css?family=Lusitana:400,700|Quattrocento:400,700' rel='stylesheet' type='text/css' /> <link rel="stylesheet" type="text/css" href="<?php echo $config->urls->templates?>styles/main.css" /> <?php // Get Images ( https://processwire.com/docs/fields/images/ ) $image = $page->images; // Show only in these templates $check_templates = ['home', 'basic-page']; if ( in_array($page->template->name, $check_templates) ): ?> <style> /* https://css-tricks.com/perfect-full-page-background-image/ */ body { /* background: url(<?php // if($image) echo $image->first()->url;?>) no-repeat center center fixed; */ background: linear-gradient( rgba(0, 0, 0, 0.91), rgba(2, 35, 50, 0.82) ), url("<?php if($image) echo $image->first()->url;?>") no-repeat center center fixed; background-size: cover; height: 100%; } p, h1, h2, h3 { color: aliceblue; } a { color: tomato; } .summary { color: aliceblue; } </style> <?php endif; ?> </head> <body> <main id='main'> Remember to download images correctly if you use the images field, for example: https://processwire.com/docs/fields/images/ <?php $image = $page->images; if($image) echo $image->first()->url; ?> You can also check the selected page where you want to display the picture: <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <title><?php echo $page->title; ?></title> <meta name="description" content="<?php echo $page->summary; ?>" /> <link href='//fonts.googleapis.com/css?family=Lusitana:400,700|Quattrocento:400,700' rel='stylesheet' type='text/css' /> <link rel="stylesheet" type="text/css" href="<?php echo $config->urls->templates?>styles/main.css" /> <?php // Get Images ( https://processwire.com/docs/fields/images/ ) $image = $page->images; // Show only in these pages $check_page_name = ['home', 'about']; if ( in_array($page->name, $check_page_name) ): ?> <style> /* https://css-tricks.com/perfect-full-page-background-image/ */ body { /* background: url(<?php // if($image) echo $image->first()->url;?>) no-repeat center center fixed; */ background: linear-gradient( rgba(0, 0, 0, 0.91), rgba(2, 35, 50, 0.82) ), url("<?php if($image) echo $image->first()->url;?>") no-repeat center center fixed; background-size: cover; height: 100%; } p, h1, h2, h3 { color: aliceblue; } a { color: tomato; } .summary { color: aliceblue; } </style> <?php endif; ?> </head> <body> <main id='main'> If you use a REGULAR profile wchich using new template file strategy, it's very simple to add styles in the selected template like home <?php namespace ProcessWire; /* home.php */ // get most recent blog post $blog = pages()->get('/blog/'); $blogPost = $blog->child(); // Get Images ( https://processwire.com/docs/fields/images/ ) $image = $page->images; ?> <head id='html-head' pw-append> <style> /* https://css-tricks.com/perfect-full-page-background-image/ */ body { /* background: url(<?php // if($image) echo $image->first()->url;?>) no-repeat center center fixed; */ background: linear-gradient( rgba(0, 0, 0, 0.91), rgba(2, 35, 50, 0.82) ), url("<?php if($image) echo $image->first()->url;?>") no-repeat center center fixed; background-size: cover; height: 100%; } p, h1, h2, h3 { color: aliceblue; } a { color: tomato; } .summary { color: aliceblue; } .uk-card h3 { color: black; } .uk-card p { color: black; } </style> </head> <h1 id='content-head'> <?=page()->headline?> </h1> <div class='uk-margin-top' id='content-body'> <?=page()->body?> <hr> <p class='uk-margin-small'> <a class='uk-button uk-button-link uk-link-muted' href='<?=$blog->url?>'> In the blog </a> </p> <?=ukBlogPost($blogPost)?> <p class='uk-margin-small'> <a href='<?=$blog->url?>'>More blog posts <?=ukIcon('arrow-right')?></a> </p> </div> <aside id='sidebar'> <?=ukNav(pages()->get('/categories/')->children)?> <div class='uk-card uk-card-default uk-card-hover uk-card-body uk-margin-medium-top'> <?=page()->sidebar?> </div> </aside>
    3 points
  6. There's no 'escape clause' in your code so it will be triggered on every page view, eg: wire()->addHookMethod('Page::ipapiGetUserLocation', function($event) use($ipapiHttp, $ipapiAPIKey) { $page = $event->object; if ($page->template != 'templatename') return; // your code here ... }
    2 points
  7. How does your PW site-structure look like? Does the parent / child structure match your desired URL structure? And I agree with @wbmnfktr - this kind of structure belongs to a dusty museum, and not a site built in 2019... Why do you need .html suffixes at all? Is it for legacy reasons? It feels wrong and cumbersome for so many reasons...
    2 points
  8. Regarding symlinks... you should check that htaccess and mod_rewrite play nice together. 1. htaccess # ----------------------------------------------------------------------------------------------- # 1. Don't show directory indexes, but do follow symbolic links # 500 NOTE: Some cloud hosting companies don't allow +FollowSymLinks. # Uncomment +SymLinksifOwnerMatch and comment +FollowSymLinks if you have 500 errors. # If that doesn't resolve the error, then set it back to +FollowSymLinks. # ----------------------------------------------------------------------------------------------- Options -Indexes Options +FollowSymLinks # Options +SymLinksifOwnerMatch 2. Apache / mod_rewrite conf In some cases each document root needs individual configuration settings. Especially in vServer/root server environments.
    2 points
  9. @Melvin Suter - I use a symlink for this purpose and it works great.
    2 points
  10. Excellent! It would be good to know what changed exactly...to help the next guy and all that ?.
    2 points
  11. @Steve_Stifler It would help much if you post the complete code of your home.php or even provide an URL where the error can be seen. Then people can help you better. Your errors seems to come from a not encoded entity. The failing character is the apostrophe ' Some chars in PHP have to be encoded to work. But without seeing your actual code, we can not provide much help.
    2 points
  12. A couple more things: Does asm work on other page fields? Does asm work on other templates? Does switching to another inputfield (e.g. autocomplete) work? What about switching back to asm? Clearing cache? I'm out of ideas save for having a quick look at it if that's possible.
    2 points
  13. In addition to what @bernhard wrote, this forum section is for module developers to support their own modules and not for general – module related – discussions. This topic belongs to the Getting Started section, so any moderators reading this: you might want to move it.
    2 points
  14. For me removing the uk-width-expand from the inner div (the one with class=' uk-width-1-1@s uk-width-1-2@m uk-width-4-6@l uk-width-expand pk-col-bod') seems to fix it (not verified other aspects of the layout). But I won't consider a width of 1700 pixels to be a quite big resolution nowadays.
    2 points
  15. @gottberg @flydev I created a small helper class for dealing with responsive images: <?php namespace ProcessWire; class Image { public static function get ($image, $widths = [400, 800, 1200]) { $response = new \StdClass(); $response->focus = ["x" => $image->focus['left'], "y" => $image->focus['top']]; $response->urls = []; $response->description = $image->description; $response->name = $image->basename; $response->width = $image->width; $response->height = $image->height; foreach ($widths as $width) { $croppedImage = $image->width($width); $url = new \StdClass(); $url->url = $croppedImage->httpUrl; $url->width = $croppedImage->width; $url->height = $croppedImage->height; $url->ratio = $croppedImage->height / $croppedImage->width; array_push($response->urls, $url); } return $response; } } Usage: // $image is your ProcessWire PageImage return Image::get($image, [400, 800, 1200, 2000, 2500]);
    2 points
  16. I think Ben's "specification" is just somewhat vague so that is the source of our confusion. Anyway, Members Messaging can be either for frontend or PW's backend or even for both but in the latter case it would probably be practical to split the code among "submodules".
    2 points
  17. You mean something like UiKit's Scrollspy, Transition or Animation? That's regular CSS which you generate in your output and depends on your css framework (UiKit, Bootstrap, Bulma etc.), no special module required.
    2 points
  18. @Steve_Stifler No, there is no module for such things. It's just about HTML and CSS https://www.w3schools.com/howto/howto_css_full_page.asp
    2 points
  19. AdminOnSteroids Various admin tweaks to enhance ProcessWire admin. http://modules.processwire.com/modules/admin-on-steroids/ https://github.com/rolandtoth/AdminOnSteroids
    1 point
  20. Hello All, I've been working on a new Fieldtype + Inputfield combination that handles street addresses. I've been using it now for about 3 months on my latest administration system for a charity and, so far, it seems to be working really well for them. It's based on the meta-data from Google's LibAddressInput project and uses the data feeds from that to build a cache of address formats used by various countries. My initial testing was aided by @Macrura and @adrian - and they were later joined by @mel47 and @BFD Calendar - so a big thank-you to them all. You can access the repository on GitHub and the Module Repository. Here's a few images from the project. First up: config screen. Here's an early version... ...and a more recent update... Here's a UK-based address. The module can integrate with my tag parser, if installed. Note that the output is formatted according to the output meta-data from the feed - which should match the preferred postal preferences of the destination country. Which subfields are required, and their regex expressions (if any) are also pulled from the feed and used as validation rules on the input side. Here's an address in the Netherlands - inputfield layout is currently adjusted on save - if you've configured it to adjust based on the destination country. Hopefully this will eventually be ajax driven. Use of the address preview is configurable and the HTML output can include micro-format data. Address sub-fields can also be used in selectors... Back with inputs, if you prefer a table-based input - you can have it... Format hints (unfortunately, I've found that many users need these)... Let me know if you find any issues or if you have any feature requests. So far, I have this from the previous testers... Allow multi-lingual address input for countries that support a multi-lingual postal system (like Canada.)
    1 point
  21. Hello @all, I am using UIKit now for over a year and I am totally satisfied. Ryan has created a site profile with UIKit 3 (https://processwire.com/blog/posts/introducing-a-new-processwire-site-profile/) where he uses a lot of markup functions to simplify content creation. Here is the function file of Ryan: https://github.com/ryancramerdesign/regular/blob/master/site-regular/templates/_uikit.php I want to start this topic for all users, who are also using UIKit 3 and want to share additional markup functions to extend Ryans function file. So everyone who use the new UIKit 3 framework can benefit from it. I want to start with functions to render different types of buttons: Render UIKit buttons Render UIKit buttons corresponding to https://getuikit.com/docs/button /** * Render a uikit button * * @param string $text Text for the button * @param string $style Specify one of: default, primary, secondary, danger, text, link. * @param array $options Optionally specify different options to the button. * @return string * */ function ukButton($text, $style = '', $options = array()) { if(!$text) return; $defaultoptions = array( 'tag' => 'button', //button or a tag 'type' => '', //optional button type attribute fe submit 'name' => '', //optional name attribute fe if button is inside form 'disabled' => false, //optional true or false 'href' => '', //optional href attribute; works with button and a tag, but recommended only with a tag 'rel' => '', //optional rel attribute fe nofollow 'icon' => '', //optional icon fe user, unlock 'class' => '', //optional additional class attribute fe uk-width-1-1, uk-button-small or uk-margin-small-bottom 'id' => '', //optional id attribute 'wrapper' => false, //optional add a wrapper div arround the button 'wrapperclass' => '' //optional add a class to the wrapper div fe alignment or margin ); $options = _ukMergeOptions($defaultoptions, $options); $out = ''; if($options['wrapper'] == true){ $out .= (!empty($options['wrapperclass'])) ? '<div class="'.$options['wrapperclass'].'">' : '<div>'; } $out .= ($options['tag']) ? '<'.$options['tag'].' class="uk-button' : '<button class="uk-button'; $out .= (!empty($style)) ? ' '.$style : ' uk-button-default'; $out .= (!empty($options['class'])) ? ' '.$options['class'].'"' : '"'; if(!empty($options['id'])) $out .= ' id="'.$options['id'].'"'; if($options['disabled'] == true) $out .= ' disabled'; if(!empty($options['name'])) $out .= ' name="'.$options['name'].'"'; if($options['tag'] == 'a'){ if(!empty($options['href'])) $out.= ' href="'.$options['href'].'"'; } else { $out .= ' onclick="window.location.href=\''.$options['href'].'\'"'; } if((!empty($options['href'])) && (!empty($options['rel']))) $out .= ' rel="'.$options['rel'].'"'; if(!empty($options['type'])) $out .= ' type="'.$options['type'].'"'; $out .= '>'; if(!empty($options['icon'])) $out .= ukIcon($options['icon']) . ' '; $out .= $text; $out .= ($options['tag']) ? '</'.$options['tag'].'>' : '</button>'; if($options['wrapper'] == true) $out .= '</div>'; return $out; } /** * Render a primary button; * * @param string $text * @param array $options * @return string * */ function ukButtonPrimary($text, $options = array()) { return ukButton($text, 'uk-button-primary', $options); } /** * Render a secondary button; * * @param string $text * @param array $options * @return string * */ function ukButtonSecondary($text, $options = array()) { return ukButton($text, 'uk-button-secondary', $options); } /** * Render a danger button; * * @param string $text * @param array $options * @return string * */ function ukButtonDanger($text, $options = array()) { return ukButton($text, 'uk-button-danger', $options); } /** * Render a text button; * * @param string $text * @param array $options * @return string * */ function ukButtonText($text, $options = array()) { return ukButton($text, 'uk-button-text', $options); } /** * Render a link button; * * @param string $text * @param array $options * @return string * */ function ukButtonLink($text, $options = array()) { return ukButton($text, 'uk-button-link', $options); } This code snippet uses functions from Ryans code (ukIcon() and _ukMergeOptions()), so please be sure that this functions are included in your function file as well. It would be great if other users can also post their UIKit markup functions (if you have created ones) to extend the collection. Best regards
    1 point
  22. There have been several threads regarding rewriting page URLs but most of them went towards different directions. You could probably hook into several things and rewrite URLs. I don't have a proper solution for this right now but I'm quite curious about the WHY. Why do you want a URL structure like that? It feels kind of outdated or Contao-like nowadays. If it's because of OLD vs. NEW setup and URLs you could go different ways and redirect the old structure to the new structure.
    1 point
  23. How helpful of them ? ?. Typical reply of hosting providers when they happen to screw up something and they just do not want to advertise it.
    1 point
  24. Something cool I just noticed: I can create a folder in my /opt/ with all my personal modules I use on every site and just symlink that folder into the "cores" module folder. BAM. I've got all my modules everywhere ready to install ? I just love processwire
    1 point
  25. 1 point
  26. I've upgrade to 3.0.126 and it works now. Thanks anyway.
    1 point
  27. @adrian his screenshots look like he's already using symlinks, that's why I asked for more details ?
    1 point
  28. They didn't specify, just that they'd "run an update".
    1 point
  29. Well, it turned out to have been a server error. They "ran an update" and now everything is back to functioning as it did before.
    1 point
  30. We're trying to install Tracy but getting hit with 500 errors, so Tracy bar not loading. It could be nginx related, we think. Thoughts, anyone? Ta!
    1 point
  31. Moderator Comment: Topic moved from Modules/Plugins to Getting Started
    1 point
  32. As we await @JoshoB's response, I can report that asm is not working site-wide, not even in /setup/template/ (list of fields in template in Basics Tab). I'm baffled by this one.
    1 point
  33. I'd say it's time for a fresh pair of eyes to have a look. If you could grant one of us a temporary access if possible...??
    1 point
  34. Agreed. I just need to add some custom widths to the pk-col-bod to make it mimic the previous layout etc.
    1 point
  35. Thanks Tom. That largely works ok. I've yet to test it fully. The tricky part here is that the layouts across the site are using bespoke widths and stepping outside the normal UIKit columns widths etc. But that's a huge help and seems promising enough to start testing from.
    1 point
  36. Blind shot: Could the PHP version had been changed on that site (hard to believe this could cause such an issue, though)?
    1 point
  37. I would have placed my bet on JavaScript as well. A couple of things to consider: Check for JavaScript errors and missing JavaScript files Did the page reference field settings change? (just fishing with this one :-)) TracyDebugger: install and debug with this great tool Any errors if config->debug is true?
    1 point
  38. Is there anything showing in the Inspect console?
    1 point
  39. @eelkenet I'm sorry, somehow I missed your post. Do you think there is any way I can support ProCache with the module itself? I could also use a page in the pagetree to deliver the endpoint instead of doing it with a Hook
    1 point
  40. I have worked out how to image map. Thanks everyone who contributed. I ended up going to Adobe Fireworks, creating a map in there, and exporting the coordinates.
    1 point
  41. Apparently not, my snippet fails when I exclude ProcessWire from it. Are you referring to the #5 example here? To my understanding it's the "variable being tested", and not the class name (after the "instanceof"): http://php.net/manual/en/language.operators.type.php Edit: I see, when using the constant with the instanceof directly it generates an error. He is already doing that ? @Gadgetto Could you post the whole file? Probably we could find what's happening.
    1 point
  42. @Steve_Stifler That depends on your output strategy. The CSS code belongs to, well your css file (or in the head of your template file). Then you would insert a HTML element with the class "bg" (according to the example @Zeka mentioned) in one of your template files, where you would like to use the fullscreen image. Template files are residing in the site/templates folder. Maybe you use a home.php template file? Then insert the element there.
    1 point
  43. This thread is really exciting. I'm looking forward to offering webp easily. =D Thanks @horst for your hard work.
    1 point
  44. Not wanting to go OT here, if this is the case, I'm wondering if this is better off as a separate/standalone module (so, new topic ?) from what is described in the first post of this thread? Edit: Hmm..Or maybe what you describe falls within the remit of what the module in this thread is about? I think am just confusing myself now. Anyway, let me know...
    1 point
  45. This looks very nice @Noel Boss, is there a way to support repeater fields? EDIT: Sorry for my silly question, found it in your docs. This works for me: $query = ['repeater' => function($page){ return array_column($page->get('repeater')->each(['key', 'body']), 'body', 'key');
    1 point
  46. @Noel Boss Wow, thank you! I'll let you know how it goes!
    1 point
×
×
  • Create New...