
AndZyk
Members-
Posts
687 -
Joined
-
Days Won
10
Everything posted by AndZyk
-
Thank you for mentioning. I have mentioned earlier in this thread, that Guetzli is in the newest alpha of ImageOptim included, but forgot to spread the news that it is now in the stable version as well. I am using Guetzli with ImageOptim for a while now and yes it is really slow and if you dare to optimize a lot of high quality images, be ready to get your fan heated up. But on the other hand I usually have a optimization rate of about 60%. Compared to the about 20% when Guetzli is disabled, I think it is absolutely worth it.
-
I have tested your JS it is working fine for me. The fact that your input makes an Ajax request (even if it is empty) is also a good sign. With the debug option set to true I also don't get any informations inside the console, probably because it is working. You could try to make an regular Ajax request and echo a static response first to test. Also you could try to exactly copy & paste my example from the tutorial mentioned above. Lastly I hope you didn't have exactly copied & pasted my Ajax example, because the selector in there is just an example and doesn't really work. If you don't get any further, you can PM me more of your code or an link, in case your site is online.
-
Hello @dragan, happy to hear that you find this tutorial useful. At the time of writing this tutorial I didn't knew how easy you can output your own JSON without a module. Currently I don't need the Pages2JSON module anymore, but instead output the JSON inside my search template like this: <?php if ($config->ajax) { $selector = [ "title|and|more|fields%=" => "", "template!=" => ["templates", "to", "exclude"], "has_parent!=" => 2 ]; $matches = $pages->find($selector); $results = array(); foreach ($matches as $match) { $result = array( "title" => htmlspecialchars_decode($match->title), "url" => $match->url ); $results[] = $result; } header("Content-Type: application/json"); echo json_encode($results); return $this->halt(); } else { // Your regular template This way you build your own array with all necessary keys and then encode them as JSON. Regards, Andreas
-
Hello @dragan, here is a tutorial by me about this topic: Regards, Andreas
-
Thank you @ryan for your work on the export/import feature. Besides the great module I am really looking forward to learn how to import JSON trough the API. In my case JSON from a different source other than ProcessWire saved into a JSON file located on the server. Maybe somebody has already played around with the PagesExportImport class and would like to share an example.
-
Hello @ryanC, you can also use the shorter version <?=$urls->templates?> since PW 3.0.50. Regards, Andreas
-
Hello @Peter Knight, as long as you don't mix both versions in your internal links or XML sitemap, I don't think it is bad. Here is what Google writes to this topic: Or could you please explain a little further or provide an link, why it would be "obviously bad"? I am no SEO expert, so that would interest me. I have never changed the default setting for URLs and never experienced an downside from it. Also search engines maybe indexing both versions both show only the version with slash as results. Regards, Andreas Edit: I have missed, that your URLs do not redirect.
-
Ah okey, I should have read more carefully. Do you want for example four random images, even if they are from the same album? You could try to achieve this by an selector: Or if you don't want the case of four random images from the same album to happen, you could use further: <?php foreach ($page->repeater_gallery->getRandom(4) as $item) { $randomImage = $item->album_images->getRandom(); echo "<img src='{$randomImage->url}'>"; }
-
Welcome @jothanne, you could use getRandom for this task: <?php foreach ($page->repeater_gallery->getRandom(4) as $item) { // Your output } Regards, Andreas
-
Yes, I only viewed it on Safari so far.
-
Great site and nice feedback by your client. There is not much to say except, that the usage of responsive images could improve the experience on retina displays. Also could the logo be replaced with an SVG in my opinion. Maybe it is just me, but could it be that the team images are a little bit stretched? I only watched the site on mobile so far. Regards, Andreas
-
Various suggestions for the Comments field
AndZyk replied to GuruMeditation's topic in Wishlist & Roadmap
Thank you, I used your solution and it its working great. -
There is a thread by you, were this was mentioned before.
-
Various suggestions for the Comments field
AndZyk replied to GuruMeditation's topic in Wishlist & Roadmap
I am currently working with comments and wish there would be an API function to quickly get all comments with an selector, like for example: <?php $pages->findComments("sort=-created, limit=5"); That way it would be easy to display for example the newest comments on a page. I have read, that this is currently possible using an SQL query, but I don't have much experience with SQL. -
Hello @MilenKo, first of all I noticed that you search for a pageName value in a title field. When you want to search a pageName I think you should search in the name value: name=$name Second you are talking about the template category-list and searching for categories-list. I hope this is just a typo, but if not you should correct this. I would suggest you to dump everything step by step for example with TracyDebugger to get to the collection of pages you are looking for. Regards, Andreas
- 28 replies
-
- 1
-
-
- urlsegment
- filter
-
(and 1 more)
Tagged with:
-
Hello @valan, maybe this could be helpful for you: New: selectors as associative arrays New: selectors as regular arrays This way you have more freedom, what you want to pass as selector. Regards, Andreas
-
@Christophe Thank you for your solution, it works well. Just a small typo:
-
Really beautiful sites. Congratulations.
-
Language alternate field's "extra label" is missing
AndZyk replied to szabesz's topic in Multi-Language Support
Glad you found the solution, but you are right that it is a little bit confusing. Honestly I have never read the description and always install all languages modules when I am planing to translate a website. -
Language alternate field's "extra label" is missing
AndZyk replied to szabesz's topic in Multi-Language Support
Sorry, please forget the last post. According to the video this is not necessary. I only used language alternate fields so far in combination with translated pages via PageTitleLanguage. I would recommend you to do the same, but in your case it maybe something else. Are you using AdminOnSteroids? I noticed in your screenshot you have the page pathe displayed under the label. -
Language alternate field's "extra label" is missing
AndZyk replied to szabesz's topic in Multi-Language Support
You have at least to change your PageTitle field into PageTitleLanguage or else you are not able to translate your pages. The PageTitleLanguage is necessary for the title and name translation of your pages. -
Language alternate field's "extra label" is missing
AndZyk replied to szabesz's topic in Multi-Language Support
I mean the labels of the languages under Setup => Languages. Those will be displayed under the field label. I have just tested it quick with PW 3.0.63 and AdminThemeUIkit and its working fine. But the version or AdminTheme should not matter. -
Language alternate field's "extra label" is missing
AndZyk replied to szabesz's topic in Multi-Language Support
Hello @szabesz, have you translated the titles of your two languages in both languages? That is the only reason I could think of. Nevermind, you have at least the title for the default language. So this one should at least be displayed. Regards, Andreas -
Ok, so I have this issue only in Safari (10.1.11) so far. I guess it is related to this: .eco_hover_effect img { min-height: 100%; } In general, you should also give your images an width and height attribute. Also I wouldn't give all images an width of 100% (I don't think this rule is from Bootstrap).
-
Ah ok, I can see what you mean now. I have tested one of my websites with Google PageSpeed Insights and when I test http://example.tld/, I also get this warning. But I don't think it is really an issue, because if Google etc. have listed the right version of your website with https://www.example.tld/, those visitors wouldn't be redirected at all. You can always tell which is the right version via the search console. Of course if there is a better solution for this case, I am interested.