Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

107 Excellent

1 Follower

About MilenKo

Contact Methods

  • ICQ
  • Skype

Profile Information

  • Gender
  • Location
    Montreal, Canada
  • Interests
    Web development, coding, Network infrastructures, Linux, BSD, Windows, Cisco, Photography, Cooking

Recent Profile Visitors

1,827 profile views
  1. @tpr Tell me about it πŸ™‚ Just because of the div opening markup I was crushing my head for some time before I "split" the selector in two and then applied the every foreach inside of every div πŸ˜‰ This could all goe to the CSS but hey - different people, different taste πŸ™‚
  2. Well I initially tried with the good old counter approach but things got messed up a bit because of the differences in the markup of large image post and others. Will revise the code and see how to include the opening and closing divs properly. Here is the markup I am working with: Where Large image post shows twice and List Item show 4 times πŸ˜‰
  3. Thanks @dragan will try your approach to see how would that fit, however it is not just styling but the markup is different where the first 2 news are required to have a large image with some intro text, author, date, likes etc. where the next 4 are just title and date of posting. That is why initially I thought to "slice" the array but it did not work properly so with $a->slice it did the trick. I will see how to serve the posts with a single foreach to avoid duplication, however the classes of divs are different, some javas are included in the no-image divs and some data handling. Not sure if I add a variable for the class, one for the javas and one for data- values to include in the div which one would be faster since I am looping once through 2 results and once through 4 others. Maybe I could try using modulus operator or other approach as well ?
  4. Hey @SamC I was looking for a way to style some results of a selector differently than others and found your 'slicing' suggestion fitting perfectly to my scenario. Here is a short example of what I have and would allow any results from to be styled one way and the rest - another: <?php // Check if there are any news added if (count($news->children)) { // Create am array with the latest 5 news $newsposts = $pages->find("template=news-inner, status=published, sort=-date, limit=6"); // Create a slice of 2 posts for the large image style // 0 means the starting record, 2 means the number of records to slice $left = $newsposts->slice(0,2); // Grab the rest of the posts from the list for styling with just a title and a date // 2 means that everything except the first two would be assigned. // The results limit is set initially at the selector $right = $newsposts->slice(2); } ?> Having done that, it allowed me to simply loop through the $left and $right results (using foreach) and apply the proper markup for first appearance and the rest. Using this elegant technique would allow to have as many slices for different styling if a need be. Unfortunately, my markup for the first news was in a row div that was closing before the rest of the posts appear in another row so I had to loop twice with foreach. I am sure there is a better way to include the opening and closing divs to avoid double/tripple etc. looping but as far as the result are not more than 6, I am not that worried about slowing the page down...
  5. @Edison Technically I do not need to show the comments of both languages but am just saying that someone might read the comments in one language but post to another if he is capable of etc. In such scenario you might end up having someone read your page in English but then writing the comment in French since he is more used to it or vice versa. Well in eather way I can live with it if a few comments listed are not with the same language. In theory my goal is not to complicate too much the things but simplify and I think I will be good with your suggested modification πŸ˜‰
  6. @Edison That is what I thought would be the idea behind it. The only issue that may arise is if an user is reading the website in one language but is posting the comment in another one just because he can. Great example would be bilingual countries like Canada and other parts of the world where English & French are official so if I am reading the website in French but post a comment in English, that would still show the comment to the French part. Of course not many cases of users doing that would be out there, just noting a possibility. If a user is logged on, maybe the language can be picked up from their user profile settings, however in cases where the users are allowed to post comments without a need/ability to be logged on, that would be impossible to pick. Not sure if with the power of PHP the language can be obtained from the OS settings by default but that is getting away from the purpose and might be a subject to GDPR and other regulations of privacy. In any way, will test your idea on the default profile and see how the functionality works. It is definitely a huge step forward towards multilanguage comments...
  7. I will test it on the startup language profile to see how it will work and will get back to you. How would PW get the language ID for the user and pick the comments? Here is a scenario I thought of - the default profile language is set to English but there are some other - Russian, French, Italian etc. So I am reading the website in Russian as it is more convenient for me, however I speak several languages and my comment is posted on French or Italian for example? Would the language get recognized, or the language ID would be picked up from the language I am reading the website on?
  8. Oh my God! I am working on a new profile of a multilanguage corporate website and was asked to add an ability to post comments under the website blog section. So I was checking up with Google to see how Wordpress and other CMS/CMF are completting the task and to my surprise, someone ( @EdisonπŸ˜‰ )just posted a solution that should work in a similar way to my understanding of comments logic. Since FieldType Comments is not language oriented (yet πŸ˜‰ ), initially I could have added an option to translate comments etc. however on a huge website this could be an overkil of work. So I thought that logically, if someone is switching the language from default to some other lang, the comments listed should be showing only in the language selected but not in the original/default profile language. Not sure how well your solution would work, but would definitely give it a try as I hope it is a much better solution than having multiple PW installations for every language in order to achieve the comments to be posted in the default profile laguage.
  9. After a few quick tests, I found it pretty straight forward to echo the content of text/textarea. In addition to the present functions of the module, it would be great if we could set the default state of the field (open, closed) as well as to have some logic of fields appearance based on other fields value (like it is with regular fields)
  10. @OLSA Hey man, I just found your amazing module while looking for an easy way to add a bunch of settings to a Profile Configuration page and I am trully impressed. I've seen some other great modules which I initially planned to use but to have a drag&drop functionality would make the development much easier for me (maybe I am too lazy). I am testing it now and will see how will it work. At least I can combine the file upload/image uplad default PW fields with the "custom field" of your module and avoid the need of adding image paths etc. Thank you for this masterpiece!
  11. Hey gents. I've been asking myself this question for quite a while now and even though I've completed some projects purely and entirely out of PW core + free modules, I've been always envy of the simplicity in code and to minimize the database/website load. As it appears, in times when I had to revise some of the profiles code I was finding a better and simpler approach based on some shared recent or good old (but not forgotten) tricks by all the smart persons presenting this amazing ProcessWire community. The more I analyze the code, the more strong need I feel to get the ProFields module for several reasons: a.) All the advice and help that have lead me to my present skills were kindly given absolutely for free with no questions asked and no matter if the answer was helping me generate some revenue. I am 100% convinced that I "owe" back to the community and its major developers the support (my 5 cents back πŸ˜‰ ) b.) Being a bit selfish - I would really like to spend less time on a project while still delivering the same if not much better and simpler solutions. To achieve all this, I would need the tools kindly included in the "ProcessWire toolbox" called ProFields. Initially my plan was to build a few profiles, generate some revenue and then spend some of the finance to purchase the tools needed, however most of the profiles I've built were for personal or close friends/relatives from which I did not generate much out of respect. But I've learned that with the proper tools, even when I am "working for pennies" I can complete the project faster/easier and move on to the next of kind. c.) As it was previously mentioned, everybody is in a need of a stable financial position as otherwise no matter how good is the will, everything seems to be doomed to an end of a failure. By buying the ProFields module, I would not only support the respectful development team, but also the community itself as the new releases, modules, tweaks etc. would keep on going. To me - this seems like a healthy recipe of success. d.) Not sure about others, but at least in Canada I am allowed to claim some work related expenses while working as a self employed, so I have a choice to either give/share my money with the developers team or to give them to the government in the form of taxes. Well, let's just say I got tired of paying taxes πŸ˜‰ e.) The words: "free for life" or "use on as many websites you want" got me by surprise. Most of the platforms I am aware of are selling their licenses per user, per device, per website etc. but I have not seen a single one stating that I can use a bunch of modules to sell websites etc. and that can go on and on to as many users as I can convince of my skills. I have some pre-sale questions, but I am sure that everything is as well covered as it is with all the freebies so I will not pose some, wait for answers and waste more time on this. I am about to start working on a new project where I clearly stated that without the tools I need, I won't be participating so I am very much eager to start "playing" soon with all the masterpieces included in ProFields. I just wish that the price was in Canadian dollars or at least I've bought the license at the time when CAD to US was 1.04 to 1, but hey - it is an economy driven situation so there is no one to blame on this other than myself waiting for so long.
  12. Hello all. I just found about the existence of this module after a few built profiles with a custom settings page and some extra fields added to it to maintain logos, texts etc. I must admit that this seems much more clean to me and would be definitely testing it in my next personal project where I won't care if a user would accidentally add/delete something as I will be the one to administer what I've built. I see that the module has an ability to add a FieldSet Open/close , however would there be an easy way to add FieldSet Tabs? This way we could group specific options and separate them to a tab? Edit: I just read an earlier comment of mine about testing this module or @Macrura fork of it so I must have forgot about it with the time πŸ˜‰
  13. Well you have thought of it all. Great work, keep it up πŸ™‚
  14. I see, but at your admin on the video in Design tab you have over 15 fields not counting Fieldset in tab (open/close) (for the design) and Fieldset (open/close) for Basic, Text align, margin, padding. It is a similar scenario with me and that is why I am trying to reduce the number of fields. I know with ProFields I could reduce them a lot, but not yet there financially.
  15. Nice work joer80. Looks great. I am wondering though, how many fields would you count in your profile as only the Tab_open takes two per section so unless you use some tricks, you might end up with a huge fields list? Btw, after completting my two category blocks with all the bells and wistles I realized that instead of using one tab_category attribute and set its type to asmselect I used 10 fields (tab_category_1, 2, etc.) which caused me some troubles to check the array for empty values, then sort them out etc. I am working on redoing the markup which would simplify a lot the code and would be much easier to "digest" and re-purpose. ProcessWire keeps amazing me every single day with the freedom of code, approaches, functionality OOB etc. It really applies to the saying: Sky is the limit!
  • Create New...