Jump to content

thetuningspoon

Members
  • Posts

    691
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by thetuningspoon

  1. Hmm, now I seem to be having the issue when not using adminbar as well. It is showing up in the Chrome developer tools as: <exception>: SyntaxError get stack: function () { [native code] } message: "Unexpected token <" set stack: function () { [native code] } __proto__: Error t: "<script type="text/javascript">↵ var preview = false;↵ $("#wrap_preview"). I'm not really sure what that all means...
  2. I am having a similar problem to this, except that it only happens when using the AdminBar overlay. The image uploads but you don't see it and can't add a description until after you reload the page. I am using PW 2.3, so maybe there's an incompatibility there?
  3. I'm using 2.3. It turns out it was a module (not sure which one) that was messing with things. But it's working now, so thanks for the suggestion, teppo!
  4. $my_page->id gives me "1649", which looks like a proper page id to me. $time_field is just a field on the page. (It's not even actually called that in my program). I can't even do $my_page->removeStatus(Page::statusUnpublished); without getting the errors.
  5. I am trying to edit a page through the API. I can echo fields from the page and I can perform the save() function, but if I try to make changes to the page first, it gives me a bunch of illegal offset errors like this: Warning: Illegal offset type in isset or empty in /opt/disk1/www/mywebsite.com/wire/core/Data.php on line 41 Here is my code: $my_page = $pages->get($my_page_id); $my_page->setOutputFormatting(false); $my_page->time_field = time(); $my_page->removeStatus(Page::statusUnpublished); echo "page title: " . $order->title ."\n"; // this works $my_page->save(); // fails Any ideas? Thanks in advance.
  6. Thanks Apeisa, that works well for what I'm doing. This is my first time using the page field. Now I know what it's for On a related note-- what do you guys do for the template for a page that is nothing more than a container for other pages (i.e. the "Background Images" page which has the images as child pages). I created a new template without a file called "none" for this purpose, but wasn't sure if there was a preferred way of doing it.
  7. Hi guys- I'm building a site which has large background images, some of which will be consistent across pages and some which will vary with each page. I would like to be able to allow the client to select the background image for each page. Since these are very large images, I don't want to just provide a standard image field, since this will mean the same image will get uploaded to multiple places/pages. Since I'm trying to provide a good user experience for the end user, I don't want their browser using up bandwidth downloading the same image multiple times. What is a good way to do this? I know that with TinyMCE you can select an image stored on another page, but is there some way to do this without a TinyMCE field? I'm thinking of setting up a page as a central repository of shared images and then providing some way to select between those on each individual page, but I don't know how/if this is possible. Thanks in advance!
  8. I see what you're saying, although the name I'm using is pretty unique, so I'm not overly concerned. I like that it's easier than an ID to see what's happening in the code and doesn't have the drawback that paths have in case I want to move the page to somewhere else in the tree. Is there a performance benefit to using ID or path instead?
  9. Yes, I should have included this caveat. Thanks for extra info, Ryan. Edit: Actually, although I had this working, I was still puzzled by Soma's solution. I realized after some trial and error that it is more complex than I needed. Since I already know the page that the repeater is on, I was able to simplify the code to this: $pages->get("name=mypage")->myrepeater->get("field2=bar")->field1; Which makes it a little clearer and is hopefully more efficient for my needs. I am also using the *= operator ("field2*=bar") to search within the second field, since it is actually a textarea containing a list of items.
  10. Brilliant Soma! Thanks. As a follow up question (this is the last piece of the puzzle), can I use a variable in a selector? If so, how? EDIT: Nevermind, I see that variables in selectors work just fine. It was the particular variable I was feeding it that was causing the problem
  11. Hi guys, I asked a similar question to this a little while back, but this time it's a bit different (and hopefully better worded). I have a page with a repeater on it containing 2 fields. Using the API, I want to find the value of field 1 where field 2 contains a certain specified string. What is the best way of doing this? I suppose this is the same as asking how to find the value of one field on a page given the value of another field on that page, since PW handles repeating fields as pages under the hood. Any help is much appreciated.
  12. Thank you Soma! That was it. I just needed to use $pages instead of $page
  13. It's not a nested repeater-- I'm just showing that it is one repeater with multiple instances on the page, i.e. it has two "items" added to it, with each item consisting of two fields. So I guess the real question I'm asking is, how do I call just one of the instances of a repeater in the wirearray through the api? Should ID work?
  14. I'm stumped. I have a repeater setup like so: Repeater Repeater 1 Repeater 2 Field 1 Field 2 Field 1 Field 2 If I know the ID of Repeater 1, how do I get the value of one of its child fields? I tried $page->get(id)->field_2 to no avail. What I'm trying to do is maybe a bit complex/weird. Basically, I am looping through a repeater to populate a select box in a contact form (non form-builder, just my own php in the template). I need some sort of id to serve as the value attribute on the select option so that I can then use it to identify and pull the data from the other field in the same instance of that repeater when the form gets posted. I hope that sort of makes sense...
  15. I have had several similar responses from our clients when I do the final CMS training with them. Sometimes I will also demo it during a pitch. The drag-and-drop file upload always gets a positive reaction And once I have auto image resizing implemented, the admin bar installed, and the manage pages turned off for the client, it couldn't be much simpler!
  16. Okay, I will give it a shot and have OpenCart as a fallback in case I can't get it working satisfactorily in time. It seems like the Braintree integration would be as simple as adding their form to the checkout template file in PW, leaving the zip code module as the biggest hurdle. Apeisa, do you have any time to work on this / serve as support? Like I said, I do have at least some money that I could throw at it. Send me a PM if you're interested.
  17. My company just started working with a new client who needs an ecommerce solution as part of their website. Being the Processwire advocate that I am, I'm desperately hoping that I can somehow implement the shopping element within Processwire, without having to have a separate app (i.e. OpenCart) for ecommerce and Processwire for the rest. The main reason being that some products featured on the site will not be for sale on the site while others will be, and I don't want to require the client to have to enter product information and images twice-- once by logging into PW and again by logging into OpenCart for the ones they are selling. I'm looking at Braintree to handle all of the payment information and having PW handle all the rest with apeisa's module. If I understand correctly, Braintree's integration method avoids having to worry about PCI compliance issues: https://www.braintreepayments.com/developers The company does all of their own shipping/deliveries, but charges different prices based on zip code. So the only unique requirement would be to calculate a price based on the zip code. I considered FoxyCart initially, but they lack this capability. I know that, at least with ProcessWire, there is surely a way to do it. I can program, but I'm much more of a designer than a coder and I'm not completely sure how best to approach this. Does pursuing this route (PW + Braintree) make sense, and would it be secure? Finally, I am willing to contribute something monetarily to this project if it will help. Thanks!
  18. Ahhh, okay. That makes sense. Thanks!
  19. That's where I expected to see it, but I don't see an option for a default child template. Maybe I'm thinking of an extension that added this capability?
  20. Thank you Ryan!! That fixed the issue. I didn't even realize I could get to the user roles through the page tree. Pretty cool stuff. While I was doing some more work on the site I had another (hopefully much quicker) question: How do I set the default child page template for a given page and/or template? I seem to remember this being a feature that I used in the past but now I can't seem to locate it. I do love the ability to restrict the type of child pages from the template, however. Great feature!
  21. I just did a fresh install of PW elsewhere (no profile) on the server and there's no issue with the roles. I'm thinking there's some sort of database issue. I'll PM you a dump of the database. Thanks so much for your willingness to help, Ryan.
  22. The admin theme is the default. Would it help if provide the login? Thanks for everyone's help. It's looking like I'm going to have to bite the bullet and start from scratch.
  23. Soma, I can't get that far since I just get sent back to the Pages tab when I click on a role or create a new one.
  24. I had some custom modules but I uninstalled. Same issue. Another detail-- I can add new roles but they don't show up as checkbox options when I go to edit a user. I have 5 roles listed as options for each user, but 7 listed on the Roles page.
  25. Hi Ryan, I upgraded to version 2.2.9 by using the profile exporter and creating a new database. Still cannot access the roles. Not sure where to go from here. I've done quite a bit of work in this profile so starting from scratch isn't really a feasible option.
×
×
  • Create New...