Jump to content

MilenKo

Members
  • Posts

    466
  • Joined

  • Last visited

Everything posted by MilenKo

  1. Hey guys, after updating my profile to 131 I got an error while trying to access the Comments manager from the admin side. Tracy says: Error: Undefined class constant 'statusFeatured' in C:\OSPanel\domains\quebec.pw\wire\modules\Process\ProcessCommentsManager\ProcessCommentsManager.module:102 @ http://quebec.pw/admin/setup/comments/ @@ exception--2019-05-06--06-20--5415a6a44d.html Tried to restore the the ProcessCommentsManager from the 130 core and it all works fine. Here is the tracy info: Cleared the modules cache as well as deleted all ../cache/ content manually and rebuild it but still the same. At first I thought that the issue might be caused of my /site/modules copy of FieldTypeComments, however the report says that it is the ProcessCommentsManager that is having a problem which I do not have in my ../site/modules/ folder.
  2. Oh, @Robin S my bad. I don't know how but I've missed to check the module configuration page and was looking at the tag options again. It works perfectly now and I can increase the size from there as most of my tags would require bigger window. Thank you again for the help.
  3. @Robin S Thank you for your info. Would it be possible to have an option to set the width and height of the dialogue for all Hanna Tags which would make my options visible better or I would have to set the dimensions by editing the module files?
  4. Btw, is it possible to set the width/height of the dialogue box (width/height) as presently I have about 10 drop-down boxes for categories plus some other limiters to show a specific page count on the block so the scrolling is not very convenient? Maybe I can make the dialogue wider through some options or else? I mean if it is possible to have the options per tag, not by default?
  5. @joer80 I've seen your masterpiece in the showcases. It is a cool thing you've built ? With me - I am thinking more simply - where I would try to build a dozen of Hanna Code blocks with all the buzz and fuss in it and then have the "builder" contain some sections of the website where you could insert your HC tags. At least that is what I am experimenting with presently while building a pretty complex content page with several blocks and options to set. I've completed the initial functionality but I still have a few more blocks to build and I will be able to share a little demo of the concept.
  6. @Robin S Thanks for your clarification. I was afraid you would say so, but was just thinking if it would be possible for me to modify the dialogue files and have an extra option added like the other attribute options - something like: attribute__options=Option1|Option2 but with some extra logic: attribute__requirements=required or similar. My idea is that from the dropdown menu, the user is provided a choice of multiple blocks and once one is selected, the dialogue opens up and can intercept an eventual requirement set thorugh the module. Once the user has finished and press OK, if he double clicks on the HC he is still seeing the same code so technically it would be difficult for the user to change the text etc. and is presented a nice "reminder" of an empty attribute or else. On the other thought, the present functionality might be a better option for me as I am allowing a user to choose a news tab category (1 out of 10) so he can leave 1 empty, 2 empty and then add 3, 4 etc. Will see how it would be completted to fit the requirements and avoid any errors as presently I am grouping all the attributes to an array, then have to clean the empty values, then to reorder and then to apply it. But hey, it works and it was super easy for my 8 years old boy I've tested with to add the block, pick categories, limit the number of pages shown etc. GREAT THANK YOU FOR THE EFFORTS AND MODULE!
  7. Hey all, I've asked the question in Hanna Code module, but am a bit confused which one would make more sense to ask, so just to ask here as well. I've tested HC Dialogues and it worked like a charm for a complex new block with tabs, 2 types of posts etc. It is all done now, and I started adding some checks to see how the module would behave if some values are left empty. So my question is - is there any way to add an attribute requirement so that if it is set let's say as *required*, then you just can't leave the attribute with empty value or else. Presently to complete the functionality with no errors, I had to insert a few checks in the markup for empty "categories", empty values etc. If I could set (like I did with the attribute options) some requirements (can't be empty, cant be more than XXX words etc.) than the dialogue would just show some error and let you fill the data before it is pushed to CKEditor. Any ideas how to achieve that or if it already exists, how to apply it?
  8. @teppo no problem. That is usually what I do but maybe I've over drank the coffee and got too much coding that day ? P.S. I kind of completted my task by adding some checks in the code but it would be useful to know if I can add some checks before submitting the values of parameters to Hanna Code. Maybe I should check with @Robin S as he is the developer of HC Dialogues and it seems like the module addition could be easier to manupulate.
  9. Hey all. While playing with Hanna Code module I need to set some attributes to not be allowed to be empty (category name or some page listing counts). I know that in the markup I can check for those, however I would like to know is there any way to set the status of the attributes from the HC admin and eliminate the need of adding extra checks for that? What I am trying to achieve is to have a custom tag inserting a block with page listings from different categories. Then I assign the list of the categories to an array to place them in the markup so I would like to restrict empty values from the attributes options shown in Hanna Dialogues. P.S. In some cases some values defined in the attributes might be needed to be validated before they are submitted to the tag call for further verification (some numbers needing to be null, not null, bigger/smaller than..., required etc.) So far I was able to set the attributes I need, however the question is how can I achieve some initial validation before they values are passed to the module for processing (during submission or during save).
  10. Since I did not see it mentioned, I think this extension might be useful for coders (at least it is for me) where I can easily prettify my code by saving it or using the shortcuts. As per some videos, it works fine with php, java/script etc. and is called Prettier - Code formatter As far as VSCode would by default analyze the file opened and use those settings for tab spaces etc. if you want to change the settings of an existing file, you would need to disable the default behavior and add your preferred options here. Now, if I decide to change the tab indentation from default 4 spaces to anything else, besides aligning the code nicely, prettier would re-adjust the tab spacing as well ?
  11. Thanks @gmclelland You gave me a reading to have fun with. Thank you for the compiled list, I might change the approach - you never know. So far I really liked the HC as it gave me some portability to reuse the tags code from project to project and I am starting to think whether I should add some BS4/UIKIT tags that would allow me to quickly build blocks. I won't rush it yet before reading the file you shared.
  12. Hey all. I was looking this morning at the extensions list for VSCode that I decided to try coming from old NP++ and I stumbled across the OctoberCMS Template Language. I thought to have a quick look for something on PW and since I did not find anything in the editor, googled it and voila... I am very happy that you've already shared some useful extensions to try out. I am having a problem understanding where/how to add @kongondo snippets. So I installed Intelephense and dragged my complete PW project to the explorer but I guess I still have to somehow add the code from processwire_api_visual_studio_code_snippets.json to my editor in order to make it work? P.S. Never mind, I found it. Seems like I did not realize it is a snippet so I can add it to User snippets. For now I've added it to PHP and got no errors, so I would just need to get used to being spoiled now ?
  13. Just to mention for anyone coming across an issue using Hanna code blocks and having a <p>&nbsp;</p> which might mess up with the markup - it is not related to the module in any case but to the configuration of the field. I am not going to go to many details as there are quite a few topics that I've seen discussing it on other matters, so you could just find the best settings by changing the Text formatters, Content type and Beautify Markup Toggles (in my scenario, I removed empty paragraph tags and removed also non-breaking spaces.
  14. Thanks @LostKobrakai I will try both suggestions and see which one would be easier for me, fit better and most important, would be good to read. It might be a bit harder to turn the entire code to pure PHP due to the fact that there will be lots of html code to assign to $out and to align it, however I might not worry about it as I am planning to minify pages anyway. The more I touch HC, the more ways I see to use it where some user intervention is required but no manual file editing is a good idea. P.S. I tested @LostKobrakai suggestion and can confirm that it works 100% with escaping the PHP tag at the beginning and then adding the HTML code. In my scenario there would be lots of interactions with the HC parameters which would be a part of a few selectors so it would make more sense to have them in PHP. At least if anyone is looking for HTML and PHP mix inside a Hanna Code tags, they could use either approach.
  15. Hey @Klenkes I always get lazy which was the reason to search for a way to include only the PHP particles in my HTML. I came to the same conclusion as your suggestion, however, this morning. Thank you for it. I guess that for a big chunk of markup the mix of HTML and PHP would not make it read-friendly so I will bang it with PHP.
  16. Hello there. I am working on a project and decided to try out Hanna Code tags to insert some custom HTML markup. The problem is that the markup includes some PHP variables to be checked and inserted at some spots. If I tell Hanna that the code is HTML, the php is just echoed and not processed. If I set the code as PHP, then my HTML is causing errors (of course). So is it possible/wise to mix HTML and PHP inside of Hanna Code tags and if yes, how can I achieve that? Any examples of how to use HTML & PHP inside a single tag would be great.
  17. After a few tests today with a repeater field, I found that for the proper markup I would need to create quite a few new fields that would hold the necessary variables for the widgets and blocks. On the other hand, if I use Hanna Code module, I would be able to pass to the scripts some variables like (category, page list limit etc.) so that would allow me to easily include the same block listing different categories and so forth by just modifying the parameters of the Hanna Code tag. Besides that, with the help of HannaCodeDialog I might actually add the blocks to the CKEditor, so that could turn to be a game changer ? Let's not forget the fact that I won't need to edit any files manually other than just applying any needed changes straight to module ? To tighten up the security, I would allow the module to be used by Super Users only. P.S. After embracing the HC idea, I realized that once I define the needed blocks of code, I could easily export them and re-purpose them for any other projects needing similar functionality. If anyone knows of some downsides of using HC and suggestions to avoid them, it would be great!
  18. Well, @androbey it seems pretty descriptive to me to be honest, where N:1 is the spot to insert the meta tags for robot indexing, where you have the chance to add: noindex, nofollow, disallow etc. The second option is to add any extra meta tags that your markup or optimization plan would need. It could be anything that by default is not added. If the fields are created by some module (I am sure you would find quite a few really good SEO modules in the modules directory that would help you avoid some manual work ? ) I would try not adding anything to the field and see what comes up in the page source by default. If something is missing, then you know now where it could be added.. In regards to the canonical link, this might help you better understand its purpose.
  19. Hello again all. I've been having fun to change the approach and the repeater works great now. If I have the zones predefined (as it is shown on the image of my earlier post), the repeater allows me to add as many blocks/widgets as I want as well as to order them. However, as far as I've built the markup to have a middle section that would be 100% width of the page, I started thinking how can I allow the middle section to be moved up, down etc. In other words, to be closer to a dynamic builder as it appears with WordPress or else, but with the OOB PW utilities and API. Then I got this crazy idea, that I can add a field in the repeater that would allow me to add some custom markup, where that could be an opening div, closing div etc. So if my logic is OK, I will be able to start building my blocks with some custom markup (opening divs for main section, then select some blocks, then add the closing section etc.) If I decide, I should be able to move up the middle section (100% width) etc. As an idea it sounds great, but I will have to test it to see how would that work and if successful - will share some more details. Oh, and I have one more idea to test which involves the use of Hanna Code module where instead of files I would define all my widgets and blocks in the module and then just call them when needed. I am not sure would that slow down a bit the site loading, but my guess is that if caching kicks in properly, most of the pages would load from the cache, so should not be much impact. On the other side though, I will be able to edit the code straight from the PW Admin and there will be no need of file editing ? But first I will start with the files to test the concept and if that works fine, would move to the next level and see how it goes.
  20. After some playing around, I was able to come with some basic (not fully completed yet) structure of my page builder: To be honest, I could have lived with this approach, however (it turns to a habit for me these days ? ) there is one tiny issue with it - ASMSelect ONLY allows me to add one instance of every block, after which the choice is grayed out. If by any chance the idea is to have only one occurrence of the block and to just drag them to order, than it would need some extra polishing and will be good to go. However I am aiming at allowing multiple occurrences of a block and besides that I would need to pass some options in order to have different pages listed from the same block (category id/name, number of pages in the list etc.). In such case, I might be better of using a repeater and creating some pages for every block and widget. And for the options I will use some conditional fields. Unless, of course, someone has a better idea of an approach that is easier, more elegant and allows once defined blocks to be added through the different sections.
  21. Hey there. I am facing a similar challenge now when building my new profile and reached to a level where I would have the following markup blocks: 3 header types, 7 slider types, over a dozen of content presentation blocks. To come up with a plan, I decided to first draw it on paper and then think of how other platforms are building the admin pages. So it appeared to me, that I could use the core functionality of PW and just setup a few fields that would be holding the choices for Header, Main, Sidebar, Footer etc. To make them appear clearly, I set the header field width 100%, the main to 70% and the sidebar to 30%. The footer is also 100% as per the markup, but the values can be changed). So I added the fields as Select Option type and set the header as single value and all the other as ASM Select (multiple values). Added the files for all my types with a name and number (eg. header-1.php, main-slider-1.php, sidebar-widget-1.php etc.) and then I would include the selected choice using the selected option ID (all the choices are listed in the details tab-selectable options). Because of the ASM Select, all my blocks would be movable and I can change the order, repeat one or remove easily. I've already used a similar structure in another project and it worked like a charm, however I must say that it does not look very good when the header is set to 100% width but the content of it is using only about 30%... I am thinking now that I can even use a more descriptive name of the files like top-news-tabs.php and still call them with a simple case {...} php function just because every option would have an ID assigned to it so it won't matter the file name. However, if I manage to achieve that, it would be much more descriptive partials file is doing what and if I have to revise the project later or hand it over to another user, it would be easier to get straight to the point. I am welcoming any other ideas or tips how to better style the template parts as the only extra way I can think of is to use fieldset open for every part which would make it a bit more eye appealing but would cost me a few extra fields again for open/close ?
  22. Alright fellas, I've completed the styling of both comment forms and moved on with the next feature I decided would be great to have - comment sharing. It all started with enabling the Permalink feature and then following the logic that a comment can be shared by users in social medias. Officially the module would show the permalink together with the reply button which would mean that if a comment is a reply, then the Permalink and Reply button would disappear. To break that logic, I moved the Permalink markup out of the Reply check so now it is permanently showing and only the Reply button disappear once the depth set in the admin is achieved. Once that was solved, I started searching for an easy and nice way to share comments. I thought initially to use tooltip however it causes some inconvenience as it is toggled by default by onMouseOver. Then I decided to try the bootstrap popover and I had great success, however I am unable to force the social sharing window to open in a small popup and it opens as a new page. You can see the sample code I've shared earlier here. Last night I've decided to try to use a modal window which would be triggered by a click on the comment sharing button. It all came out very nice and looked perfectly, however this morning while I was wrapping and cleaning up the things and commenting my code, I've discovered that $permalink inserted in the modal is not listing the actual comment URL of the one that I pressed but shows the ID of the first comment in the page (always). I've tried to clear the cache of the profile and modules as well as any other things I am aware of, however for some bizarre reason the issue still appears. I had no issues when I tested with the popover, however that did not allow the Facebook and Twitter pages to open in a modal as it should. Here is the code I used so far: P.S. The fix of this issue seemed to be quite easy once I gave it a second thought and found out why the modal was ALWAYS showing the same comment ID. As far as every modal from the loop would come with the same ID, the button calling that ID would show the first one in the row. To fix this, I just added the comment ID to the modal ID and the button calling it, so now it all works perfectly fine (the code above is updated with the necessary changes). Now it is only a matter of time to style the modal and use some media queries to show it properly on mobile devices, but that is beyond this topic ?
  23. Gents, as to avoid blurring the topic with issues that are not directly related to the module or its features as well as per the suggestion of @kongondo, I will continue the discussion about the sharing of comments to social medias and other implementations in my FieldType Comments topic I've opened earlier. I've had some progress so feel free to check it or help with some ideas.
  24. Hello @loukote I believe that it would be easy to add any rich text editor like CKEditor where you just have to use their code for HTML pages and then to sanitize the output ($text by default). There are different packages of the editor so you just need to pick one that fits your needs and add it to your comment form. Here is a link with some more info about CKEditor.
  25. I found some javascript code that is opening properly the popup sharing window and even more - it is positioning it to the middle of the screen, however I now need to find a way to implement it in to the php with all the single and double quote escape. Here is the javascript: <a href="#" class="btn btn-social-icon btn-facebook" onclick="window.open( 'https://www.facebook.com/sharer/sharer.php?u='+encodeURIComponent('http://mydomain.com') +'&t=' + encodeURIComponent('Some title #hashtag1 #hashtag2'), 'facebook-share-dialog', 'width=626,height=436,top='+((screen.height - 436) / 2)+',left='+((screen.width - 626)/2 )); return false;"> <span class=\"fa fa-facebook\"></span> </a> and here is the permalink code in CommentList.php where I need to find a way to insert the javascript: $permalink = "\n\t\t\t\t<a tabindex='0' role='button' data-toggle='popover' data-placement='left' data-trigger='focus' data-html='true' data-content=' <a class=\"btn btn-social-icon btn-sm btn-facebook\"><span class=\"fa fa-facebook\"></span></a> '>#{$comment->id}</a>"; So far I've tried to escape all the single/double quotes with a backslash ( \ ), however that causes the javascript to open the sharing window in a regular new window but not in a popup as it works if I insert it in HTML or any other template...
×
×
  • Create New...