Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by cjx2240

  1. This must be really simple, I don't know what I'm doing wrong I'm trying to create a simple import for users, but it's not working. I want to check if they exist already, because I'll update their details if they do, and create them if they don't. Can someone tell me why this is returning true for $users->get("username") when the user definitely doesn't exist? I have tried various combos, with or without quotes, using "name=", but that shouldn't matter because it should be returning false either way.... Truthfully I think you're going to point out something really stupid/basic logic I'm missing which I'm blaming on sleep deprivation $users = wire('users'); foreach($newusers as $newuser) { if($users->get("$newuser->userid")) { echo $newuser->userid." already exists<br>"; } else { // create the user } } Edit: Why is it I frequently work these things out minutes after asking on here... The answer is that $users->get(name) returns a PageArray object regardless of whether it matches a user. You have to check if that user has an ID or such instead.
  2. Could someone point me in the right direction of where I might add new buttons alongside the page list when you log into the CMS? As in, near the "Add New" button that appears in the top right by default. I have issues with people not being able to find some links that they need to use regularly. Thanks in advance!
  3. How do I install or update a plugin such as the below? https://ckeditor.com/cke4/addon/pastefromword I have unhappy clients who want to paste a lot of content from Word
  4. Did CKEditor end up being updated in 3.0.107? I can't find it in the notes.
  5. This looks really interesting, thanks for taking the time to write it up, and provide that module! Can anyone give a pointer where someone... you know... lets say a friend... who has maybe fallen way behind in terms of front-end technologies and has never touched vue.js or any of its kin, where they might start learning how to implement this PageQueryBoss module and turn it into a complete front-end?
  6. Is there a colorpicker that allows you to pick from anywhere on your page? Is such a thing even possible?
  7. I couldn't at first til I realised I needed to enable debug on the central site. Maybe I just need right folder permissions on the folder where the js goes? Error: Uncaught exception 'ProcessWire\WireException' with message 'The combined js file can not be written. Check if the script has sufficient permissions.' in /home/othersite/public_html/site/modules/AllInOneMinify/AllInOneMinify.module:483 Stack trace: #0 /home/newsite/public_html/index.php(315): AllInOneMinify::JS('script.js') #1 {main} thrown (line 483 of /home/othersite/public_html/site/modules/AllInOneMinify/AllInOneMinify.module)
  8. Can anyone tell me please, if I load Processwire from another site using require('/home/othersite/public_html/wire/core/ProcessWire.php'); $site = new \ProcessWire\ProcessWire('/home/othersite/public_html/site/'); What do I need to change <script src="<?php echo AIOM::JS('script.js') ?>" type="text/javascript"></script> to, in order to get it to work? At the moment it just causes an error.
  9. What's causing all my tweets to get truncated? $tweet[text] is trimmed at a set length and then outputs a link to the rest. Edit: The reason for this was that you need to request with tweet_mode => extended to get the new character limit from twitter. I was having a few other issues with this seemingly abandoned module and I needed this quickly so I ended up using another twitteroauth script instead and making my own. I assume to edit this into the module you'd add $params['tweed_mode'] = 'extended'; In MarkupTwitterFeed.module before the request on line 143, but I haven't tried it.
  10. Same thing happened on my Invision forum and I was really unhappy with it! I sympathise.
  11. Thanks @abdus that looks great. Actually I was in a rush and I decided I would have to accept having a "/holding-page" and just used $session->redirect() but if I get a chance I will definitely change to this so I can be on "/"
  12. I've made a temporary new page on a new template, I want to redirect all traffic to this for a while, whilst making the url just be "/", what's the cleanest way to do this please?
  13. FieldsetPage seems like the perfect answer to this question I posted a little while ago, is this the kind of situation it was done in aid of? What I had been doing til now (based on chatter in that thread) was making RepeaterMatrixes, creating all the repeater items using a super user, then restricting access to the "move/copy/new" etc controls using CSS.
  14. I have updated mystyles.js to include another row with another style I have saved the file path in my field options I have cleared cache, refreshed, tried different browsers but nothing makes this list change: I also tried giving the file different name, and a different string within the file (still matching the filename, or not) The only way I could get it to work was by deleting the path in the field option and modifying mystyles.js in /wire, but obviously this isn't ideal.
  15. Updating RepeaterMatrix from 0.0.3 to 0.0.4 resolved the issue, thanks.
  16. Unfortunately, this just completely broke the field edit page for me!
  17. Thanks, you helped me find a bug in my own code that resolved my issue
  18. I am using this in a function on two websites. However on the second site, it returns nothing unless I am logged in in the front end. I'm assuming this must be some issue with permissions but I can't seem to track it down, everything looks the same between the two. Guests have only the standard permissions and "view-pages" is ticked - and the template of the page in question (and its parents) has no individual rules set. Anyone have a guess they could point me to?
  19. I tried this and it worked great! Thanks. I put it in admin.php. I targeted RepeaterMatrixes where the name ended in _fixed, as that appears as a class around the item. For anyone else who wants to use this, it's worth noting that it's important to have some if statement, if you just load it on every page you will get js errors when the file is called by ajax (eg image upload) I still think there's a place though for a simple field that contains fields, without allowing you to make as many as you want. It could also have the option to be put into tabs the way fieldgroup start/end currently works.
  20. @Macrura sorry but I think the way that Micro Contexts works is going over my head a little. Maybe a video would be good to explain how that works? I'm not suggesting that for my sake but just to get the idea across for other users! PageTable looks good but just like Table and RepeaterMatrix my problem is that you can make as many as you want, reorder them, delete them etc.. I just need something that is like a parent field, containing other fields. Perhaps using @Robin S's suggestion and hiding all the controls on a repeater matrix might be the answer....
  21. I have used that quite a lot, and it's suitable to this page in some ways, however, it allows the user to make as many of these sections as they want and re-order them, which leads to needing much more development on the front end to account for the items being in any order or missing altogether. Maybe a solution would be something like Limit Table (which I found indispensable for alleviating my original issue) - but for Repeater Matrix....
  22. Just wondering what everyone's approach is to a long page which requires many different pieces of input. For example, imagine your homepage is laid out like this: Banner Title Subtitle Multiple background images Links Second banner Title for area Paragraph of text Background image Bullet points Third text area Image Links List of feature with a title/description for each Call to action/banner Image Text Link News section introduction News section title Final call to action Title Description Link/link text List of partner logos Description List of images/links And most of these fields are not used on other parts of the site. Now, I can start of using a nice repeater matrix for banner images. I can use title, and then I can make a text field. I can make a text_2 and a text_3 and maybe a text_4 and I'm going to be able to reuse those in other templates too. I can make image, image_2 and the same thing applies. When it comes to a list of features, I might go with a ProFields Table. I have read Making efficient use of fields in ProcessWire - I found I was already using the advice within (a good read nonetheless) but still don't feel like my delivery is that efficient. Because a long list of fields like this is going to get incredibly busy and confusing. And is calling a lot of repeaters and a lot of different fields for this template alone going to slow the site down? Also there's a holdup every time you realise you need a new field and you have to go and create it, then save the template so you can select it. Is there a better way? I think I dream of some kind of unlimited "text" field that you can create as many of as you need to... (Not like ProFields Table, where the user can create as many as they want, but where the admin can make them on the fly while setting up the template) We could hardcode some of these small titles etc but in my opinion that will just quickly lead to the user asking "where do I change this line of text?" I could use a wysiwyg for areas of titles and descriptions but in my experience this quickly leads to broken layouts. I know this is very general but I wonder if people have a smart approach to this kind of template setup that I have not considered.
  23. 5 years late but just want to say thanks for this module! I would prefer to use just the CKEditor media button but I had issues installing that.
  24. Hi @tpr, thanks, this would certainly work! However, to clarify, the problem with this is that it would take away control over the width from the user of the CMS (not me). I want the default to be 100%, but I still want someone to be able to set it/edit it later. At the moment I'm essentially doing what you said, by forcibly overriding it on the front-end anyway. But I don't want to do this, I want it to be 100% by default so I don't need to "fix" it with CSS.
  • Create New...