AndZyk
Members-
Posts
678 -
Joined
-
Days Won
10
Everything posted by AndZyk
-
Hello, I am currently playing around to build my first module. It will be a simple module for the ImageOptim web service, but I am a little bit stuck on which right hook to use. Currently I use following hook: $this->pages->addHookAfter('saveFieldReady', $this, 'imageOptimSave'); I would like to pass images and its variations to the web service after adding them to the image field. But if I use the saveFieldReady hook only the original image will be optimized, not the API generated image variations, because they will be generated after viewing the page for the first time. Can anybody please help me how to hook into the image variations? I already tried to use my own method, but this one used in the template would be called on every page render. Regards, Andreas
-
Hello @franciccio-ITALIANO, the CKEditor is not poor, you just have to read the instructions. There are plugins available for color and align. In case of the color, in my opinion, I find the default behavior of stripping out inline styles preferable and much cleaner to define your own styles. Regards, Andreas
-
Find page where secondary language is not active
AndZyk replied to asbjorn's topic in Multi-Language Support
Hello @laban, how about this solution: <ul> <?php foreach ($pages->find("template=basic-page") as $child) { if (!$child->viewable($languages->get(1036))) { echo "<li>{$child->title}</li>"; } } ?> </ul> This way you would iterate over all pages with the template basic-page and check if it is not viewable in your secondary language. Regards, Andreas -
Glad that was it. For further development I can recommend you enabling debug mode in your config.php, if you haven't already, and checking out the almighty Tracy Debugger module.
-
Hello @MilenKo, maybe you get the error, because you try to output $results instead of $result, which seems to work. Regards, Andreas
-
Strange behavior of pages in multilang environment
AndZyk replied to backes's topic in Multi-Language Support
Sorry, if I may not understand you correctly. But the way your module works right now, you would check if the 404 page is viewable in another language. Because if you try access a non-active page by default a 404 exception gets thrown and your module would hook into the 404 page. So it would be pointless to throw another 404 exception and log it, because that is the default behaviour. I am not quite sure, what you try to achieve, but if you want to customize your 404 page, you could just create an template and assign it to the 404 page. -
Strange behavior of pages in multilang environment
AndZyk replied to backes's topic in Multi-Language Support
Does your 404 exception event got thrown if you redirect the session before? I tested it locally and for me it doesn't get thrown. In my opinion you should either throw the exception or redirect. Regards, Andreas -
German web design magazine PAGE published in their latest issue (01.2017) an article about WordPress alternatives. One of the four introduced alternatives is ProcessWire, which is praised for its
-
You might want to correct your meta keywords. <meta name="keywords" content="echo $homepage->keywords;">
-
This is a image and animation heavy single page for NexWafe, a spinoff of the Fraunhofer Institute for Solar Energy Systems (ISE) based in Freiburg, Germany. The sections were realized with Flickity carousels to separate the content into slides. The site features various animations, like parallax separators, fixed lines and two large animations to illustrate the process and production. The animations were realized using ScrollMagic in combination with GSAP. Challenging was to keep the site performant by lazy loading almost every image and disable animations for mobile devices. www.nexwafe.com Modules used: ProCache Markup Sitemap XML Email Obfuscation (EMO) Tracy Debugger Regards, Andreas
- 1 reply
-
- 8
-
- single page
- parallax
-
(and 2 more)
Tagged with:
-
@benbyf Just wondering what happened to this beautiful site? Especially as it is featured in the newest weekly issue and people might be confused to see the "Website is coming soon" banner. Regards, Andreas
-
Welcome @MilenKo, great that you want to give ProcessWire a shot. I think you won't regret it. Delayed output would be a better choice for more complex sites, but that is up to you, as PW doesn't dictate you how to structure your templates. I for example started with direct output and just switched to delayed output a few months ago. But for single pages I still use direct output. Whatever is most convenient for the project. You can look at the default site profile included in the PW installation to have a look at delayed output. You can find the complete site profile of the PW skyscraper demo on GitHub. There is also an corresponding blog post. Ryan used in the new skyscraper demo the new region function, which is also explained in the blog post. This is an more advanced site profile, so the default site profile is maybe easier to start with. Best way to learn PW in my opinion is to get your hands on and learn by doing. Happy coding. Regards, Andreas
-
pages->find not returning value other than default language
AndZyk replied to antpre's topic in Multi-Language Support
Hello @antpre, that depends on the selector you are using. If your selector is using non-language specific operators, like for example the template name, it should work as expected: foreach ($pages->find("template=basic-page") as $child) { echo $child->title; } If your selector is using the page path, then it wouldn't work, because this one is language specific. Could you please provide an example of an selector you try use, which doesn't work? Regards, Andreas -
Had some fun yesterday implementing an small easter egg in one of my websites: Let it snow on your website based on if it is actually snowing in your location. I use the Weather Underground API and jQuery Snowfall for this. Previously I used OpenWeatherMap for checking the weather, but they want to charge you for access over SSL. Here is what my easter egg looks like: $.ajax({ // Debug with North Pole // url : "//api.wunderground.com/api/YourAPIKey/conditions/q/AK/North_Pole.json", url : "//api.wunderground.com/api/YourAPIKey/conditions/q/Country/City.json", dataType : "jsonp", success : function(parsed_json) { var weather = parsed_json.current_observation.weather; var flakeCount = 0; if (weather === "Snow") { flakeCount = 100; } else if (weather === "Snow Showers") { flakeCount = 75 } $(document).snowfall({ round: true, minSize: 5, maxSize: 10, flakeCount: flakeCount }); } }); Too bad it isn't currently snowing where I live, but maybe soon. Regards, Andreas
-
You could also build your selector as array: $results = $pages->find([ ['parent', '/posts/'], ['tags|category.title|title', '%=', $search], ['limit', '25'], ['sort', '-created'] ]); That way you don't have to make the array back to an string and it is more readable for complex selectors.
-
Hello @heldercervantes, inside includes the following string translation should work: $this->_('Follow us'); Regards, Andreas
-
UIkit provides a flex, form and button component. And if you are using Sass or Less, you can install UIkit for example with Bower and import only the partials you need. Here is what the import would look like in Sass: @import "../../bower_components/uikit/scss/uikit-mixins.scss"; @import "../../bower_components/uikit/scss/uikit-variables.scss"; @import "../../bower_components/uikit/scss/core/flex.scss"; @import "../../bower_components/uikit/scss/core/form.scss"; @import "../../bower_components/uikit/scss/core/button.scss"; That way you still would have a lightweight framework. Regards, Andreas
-
Hello @Marcel Stäheli, maybe the console of your developer tools will reveal more information about the errors. Also you could turn on debug mode. It is not recommended to delete anything inside the /wire/ directory. Especially if you want to upgrade PW, it would just override any changes you have made. Regards, Andreas
-
Yes, hooks is a little more advanced topic. In fact I never really used them myself until recently. The link on my previous post is the official documentation of hooks, but if you want a more tutorial-like article, this one could be useful: http://www.flamingruby.com/blog/using-hooks-to-alter-default-behavior-of-processwire/ Also have a read, where and when you can put hooks: https://processwire.com/blog/posts/processwire-2.6.7-core-updates-and-more/#new-core-files-for-site-hooks
-
Hello @cb2004, that is an interesting question I asked myself lately. Actually I don't think it is necessary to sanitize the checkbox values, because you are the one who decides which values the checkboxes have and not the user. But you could always sanitize the values, to be sure, that no one tries to manipulate the values with f.e. dev tools in the browser. Checkboxes could be created with plain HTML or if you want to make use of PW, you could create them via the API: Regards, Andreas
-
Is inga3d a subfolder inside your PW installation containing an index.php? If yes, it woud be better to create an dedicated template for this site and add an page in PW for it. However you could try to either add ../ to your relative URL, to target the directory, above or ./ to target the root of this domain. So for example: ./site/templates/
-
Welcome @AmilcarMarques, do you have the absolute urls in your template files? If yes, it is better to embed them using the $config->urls->templates method: <link rel="stylesheet" type="text/css" href="<?=$config->urls->templates?>styles/main.css" /> This generates a relative path to your templates directory, similar to the one in admin side. Regards, Andreas
-
That is right. I mainly used it for CSS3 so far. But maybe it has some other uses.
-
Sorry for being off-topic again, but I just saw that CodeKit also supports the Autoprefixer plugin. No need for compass anymore.
-
In my opinion, three separated fields would be the best solution. If you are not sure, wether your users will enter the right values into an field, you can always point them into the right direction using the description or notes for each field. Even though it might not be the most comfortable way, if used you can do all sorts of sorting and filtering in the front end with this data. Another approach @adrian was pointing to, is using a hook to save the extra fields combined in the map marker field.