Jump to content

szabesz

Members
  • Posts

    3,015
  • Joined

  • Last visited

  • Days Won

    20

Everything posted by szabesz

  1. Hello Roych, First of all, I recommend a few things: Installing @adrian's TracyDebugger module. Makes development a lot easier, you can instantly spot issues like undefined variables and null objects, it also has support for one click online html validating and about a hundred more features to ease the "pain" I mean to help get more fun out of coding. Also, turning on $config->debug = true; in config.php is very helpful during development. Next, after a successful system or module upgrade you might want to delete files/directories beginning with a dot, in your case: /.wire-3.0.36 /.htaccess-3.0.36 /.index-3.0.36.php /site/modules/.MarkupSimpleNavigation I installed @tpr's AdminOnSteroids as it has very useful features to support development: in the Page Tree it can show the ID and templates of a page, it has a one click jump link to open template/field editor pages right from a page editor page (just hover over the lables and links appear in tooltips) so it made it easy to find my way around your template/field setup. Actually, it always makes it easy to find my way around MY OWN setups too! I also uninstalled the FrontendEditing module. Frontend editing is an advanced technique, it has its limitations and quirks, and most importantly since it injects code into your frontend it is best not to use it when learning PW. It just makes issues a little bit harder to track down. Back to your code. Things I could spot: PHP Notice: Undefined variable: title in .../site/templates/_prepend.php:6 which is: <?php echo $title; ?> and should be <?php echo $page->title; ?> First I cleaned up your code to get rid of issues of invalid html. TracyDebugger has a tool to one-click validate your html which helps a lot to pinpoint issues. Your HTML was broken, I found an unnecessary "</div>" and a "<" which were simply syntax errors. With broken HTML it might be impossible to generate a working JS portfolio. You get a collection of "portfolio-detail" templates, but in the page tree the following pages are created based on this template: children of Portfolio Kategorije children of Kategorije Which is not right when your selector is this: $portfolio_details = $pages->find('template=portfolio-detail, sort=-created'); because it collects unrelated pages. You need to add "parent=portfolio, " to get the specific pages: $portfolio_details = $pages->find('template=portfolio-detail, parent=portfolio, sort=-created'); Since your original template setup was problematic, I made changes: Changed template of page Kategorije from "portfolio-detail" to "categories" Changed template of pages Vizitke, Logo and Publications from "portfolio-detail" to "category" (I renamed Kategorije to category.) Note that it is best to stick to English when writing code and setting up names in the admin. You never know when you need to pass your code to someone not speaking your native language Similarly, when testing multilingual fields, if you put Slovenian in the English fields then you make it harder to follow your own setup, so I used English names for each "en input". The more things you do not put in the right pace the harder you find to make sense of your own site, even when "just testing things out". I did not touch the Family settings of categories/category templates but you should set them up like this: https://processwire.com/talk/topic/15842-200200200-field-texturltextarea-into-1-template/?do=findComment&comment=141413 I renamed the field category to categories, as it is a Page Reference field with ASM selects, so using plural is more appropriate. I removed the setting of "Select the template of the pages that are selectable. May be used instead of, or in addition to, the parent above.", because setting the parent to the Categories page is enough. Back to code changes: this loop is not needed: <?php //foreach ($cat_items as $item) : ?> $single->images->description->first was changed to $single->images->first->description normally I use <?= ?> when echoing single values but in that case it is not possible to temporary comment them out, so that is why I switched to <?php echo ?> It helps testing. Using title as a css class or id will not work as is can contain spaces and other special characters, you need to use the name property (Settings tab > Name in the admin): <a href="index.htm#" data-filter=".<?php echo $item->name ?>"> and in the portfolio loop, you need to output the related category name(s): <?php foreach ($portfolio_details as $single) : ?> <div class="portfolio-item <?php echo $single->categories->first->name ?> "> After making all these changes it works for me, I'm going to send my version to you in a PM soon. Note that you still have unrelated owl Carousel erros in your JS. Here is the content part of the code for anybody else who might find it useful as an example: All in all, I recommend using Tracy and AdminOnSteroids (AOS), always look for PHP errors and invalid HTML and fix them before you move forward. And always work by changing things one at a time and then test if the change really does what you want. Tracy is your best bet to do testing the fastest way possibe with ProcessWire
  2. Hehe. The PW forum is a nice snippets manager and knowledge base for free
  3. Well, I am not suggesting you should switch to it, the only thing which is clearly better to have is its MIT license. I just thought you might want to reconsider it just once more but I know its not fun switching libraries "just because" Feel free to ignore my notes.
  4. Yeah, at firts sight ag-grid looks great but have you seen http://tabulator.info/ lately? Namely the new release: http://tabulator.info/news I have also checked out a lot of these JS table libraries and Tabulator seems to be the only one which is completely open source (MIT) and is being actively developed. I have not used it just yet but I am planning a test drive in the near future.
  5. @Roych Can you send me a copy of the site? It would be easier to help by taking a closer look. You can use Duplicator to pack it up easily. I would have time to examine it this weekend. Just PM me if you want to proceed this way.
  6. Hi @renobird I keep getting these since I've been using the module: 2× PHP Notice: Trying to get property of non-object in .../modules/MarkupActivityLog/MarkupActivityLog.module:405 2× PHP Notice: Undefined variable: fieldID in .../modules/MarkupActivityLog/MarkupActivityLog.module:370 And because I use Tracy, they kept popping up in the debug bar but today I though it is just enough of them and applied these: if (!isset($fieldID) || $fieldID == null) continue; https://github.com/Renobird/MarkupActivityLog/blob/9d37de692b74185e6391828806c84b730ab07630/MarkupActivityLog.module#L370 also: $string = is_object($field) ? $field->className : $field; switch($string) { https://github.com/Renobird/MarkupActivityLog/blob/9d37de692b74185e6391828806c84b730ab07630/MarkupActivityLog.module#L404 I don't know if this is enough but the module seems to work as before but without the notices.
  7. Hello Neo, are you in the Matrix already?
  8. Hello @Robin S, I've just noticed your initial post of this thread points to no longer available images, you might want to fix that. Also, I find it a bit strange you use the GitHub link in the module's info instead of this thread's or the module directory's, since in the README.dm there is no link to learn about the other two pages.
  9. Oh yes, it does help a lot! Thanks for fixing it for me! I was just too much concentrating on anything else but creating those image variation which can be performed in the after hook only. And you are right, renaming them is a different matter which can be done in the before hook.
  10. That's strange. I have it installed on all my sites and I do not remember having any issues besides personal taste of its UI which is still far better than the default one pushing the whole page downward "all the time".
  11. Hello @adrian (or anyone else with experience in automatically renaming image uploaded in the admin), You might be able to help me I guess I've dug up this old thread because I'm stuck with my custom implementation of renaming uploaded files (actually images) in the admin. I do not use Custom Upload Names because it might not support what I need, but most importantly besides being able to rename the files, I also want to generate a JPG from the uploaded PNG ( I use imagecow for that). Currently I will be the only one to upload images to the ImageField in question so my code does not have to be bullet proof but there is something that does not work the way I want it to. Here is my code It seems to work but the issue is that after the image has been uploaded, the inputfiled in the admin tries to load the file with the original filename. After refreshing the page, all seems to be ok, but I would like to see the result right away. I tried to look up how you do it in CustomUploadNames but your module is a bit of a complex one There is a screen grab to see what happens:
  12. I was hoping that Anyway, thanks for pointing me in the right direction! I will take a closer look soon.
  13. Maybe this is the issue I tripped over? I just did not bother looking into it as I did not have time to do so. I had reverted back to the hook I posted above and using it ever since.
  14. May I ask how? I use @kongondo's great module, however, the "content" of the field is updated only after the page has been saved. For example, I use it to display the sum of some values of some fields, which works great, but when editing those values only it is the next time when the page has been saved the sum is "updated". So my question is: how can this module be used to display an image (or anything else for that matter) on-the-fly based on what is selected in the page editor?
  15. Generally speaking your proposal could be useful, however, I think it is questionable whether it would work or not in practice. Just because a module works for someone, it does not mean it will work in a different environment. Also, ProcessWire's active online community is just not enough for this. The WordPress plugin directory used to have this feature and even they removed it, even though the WP ecosystem has far more users to utilize it, the low number of feedbacks made them realize it was not useful, I guess. Their new "Issues resolved in last two months" feature is more useful, I think. If the maintainer of the plugin/module is willing to support the users, that is a great sign in the first place.
  16. Hi, I do it this way: in /site/modules/InputfieldCKEditor/styles.js I have: CKEDITOR.stylesSet.add( 'mystyles', [ { name: '1/2 left align', element: 'img', attributes: {'class': 'align_left uk-float-left uk-width-1-2@s site-mar-r-10'} }, { name: '1/2 right align', element: 'img', attributes: {'class': 'align_right uk-float-right uk-width-1-2@s site-mar-l-10'} }, { name: '1/3 left align', element: 'img', attributes: {'class': 'align_left uk-float-left uk-width-1-3 site-mar-r-10'} }, { name: '1/3 right align', element: 'img', attributes: {'class': 'align_right uk-float-right uk-width-1-3 site-mar-l-10'} }, { name: '1/4 left align', element: 'img', attributes: {'class': 'align_left uk-float-left uk-width-1-4 site-mar-r-10'} }, { name: '1/4 right align', element: 'img', attributes: {'class': 'align_right uk-float-right uk-width-1-4 site-mar-l-10'} }, { name: 'center image', element: 'img', attributes: {'class': 'align_center uk-align-center'} }, ]); align_left and similar are for the default I copied over from /wire/modules/Inputfield/InputfieldCKEditor/contents.css uk-float-left and similar are for UIkit 3 This way I do not have to load the whole UIkit 3 css for CKEditor, instead I write my custom rules for the RTE in order the get what will be seen on the frontend. It is some extra work but there are not too many styles needed to be used in the RTE anyway.
  17. Delayed output is not about concatenation but storing rendered html in a variable to be output later on. Eg: <?php $output = wireRenderFile("./partials/partial.php", array('page' => $page)); //lost of other code :) echo $output; Ryan prefers concatenation to wireRenderFile. I prefer wireRenderFile to concatenation, for example.
  18. Yep, lots of us have been waiting for something like this for quite a long time: So this "changelog" feature could be boosted with these new ideas of yours, too. (like "user could check a box to agree to data submission", etc...)
  19. @bernhard and do not forget GDPR, e.g.: https://www.willows-consulting.com/gdpr-for-ecommerce/ Include a GDPR compliance line Specify what information you collect and store from website visitors. ( e.g. ip addresses, device information, access information, cookies, visit duration and tracking, mouse and swipe actions, email, phone, name, address and billing addresses ) Specify who you has access to this personal data. (E.G. you, mailchimp, google, salesforce etc ) Specify the contact details of the assigned Data Protection Officer in your organisation Specify how to lodge a data subject access request. Specify how long you hold personal information. Get their clear consent to process the data. Info on the number of installations seems to be a little bit of a different topic but – as Robin said above – how can the site's superuser decide? I think it is best to treat any data collection in the sense of GDPR as it is all about transparency in the first place.
  20. $page vs $pages reminds me of = vs == in an if clause
  21. More on this: https://processwire.com/blog/posts/processwire-3.x-api-reference/ https://processwire.com/blog/posts/processwire-3.0.16-continues-expanding-documentation-and-more/ https://processwire.com/blog/posts/processwire-3.0.41-and-a-look-at-api-explorer/ Write one then send a pm to Ryan Probably, see: https://processwire.com/blog/posts/processwire-3.0.60-core-updates-and-more/ "...With the API reference now up-to-date, we'll soon be looking at the cheatsheet and hopefully updating that to pull data from the API Explorer module as well." Also search for the word cheatsheet in these: https://processwire.com/blog/posts/processwire-3.x-api-reference/ https://processwire.com/blog/posts/growing-processwire-in-2016/#cheatsheet-and-documentation Same as the tutorials Yes, there is. It's too late here for me to compile a good list but I will try to do it in the following days if others do not provide something faster than me...
  22. $pages->get("selector") is not designed to be a Swiss Army Knife of solving custom routing logic or similar for that matter. I think such a need is to broad to be implemented without knowing the actual logic required for a particular use case, so I cannot see how it could be standardized.
  23. @neosin Hi, maybe this discussion can give you some ideas how to handle "default images":
  24. Great idea! Thanks for sharing! Are you thinking of maintaining and further developing this module into the de facto "form helper for developers"? That would be awesome
  25. @teppo seemed to be working on it recently too, but I'm not aware of him making his changes public. See: https://weekly.pw/issue/170/ "This week we don't have a poll section. This is mainly due to some additional tweaks to the Pollino module that we're making in preparation for next week's poll..."
×
×
  • Create New...