Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

32 Excellent

About strandoo

  • Rank
    Sr. Member
  • Birthday 09/19/1961

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

1,352 profile views
  1. @Zeka No problem, thanks for the suggestion. I'll have a look. 👍
  2. Hi @Zeka Thanks, but I probably haven't explained it correctly. The Category pages are not actual page trees (the products are already organised under as pages under the product type pages; I use sort=sort on those). The Category pages have no children and fetch their related content not as children but with a 'find' selector. The client wishes to reorder pages differently under Categories than their 'natural' order under Product Type.
  3. I've got an existing site where the client wants to add a custom sort order to his products when viewed on the Categories page. Categories are a Page field type and the products are already manually sorted by Product Type. And a product can appear in more than one category. If it were a 1-to-1 relationship, I'd just add an integer field to the product for a custom sort order field. But some products have 1 category, some have 4. Some categories apply to only a dozen or so product; some apply to 300 or 400. (He's supplied a spreadsheet to import). Even if I figure out how to sort these, will the client be able to add new products and alter/insert a sort order? Here's an illustration: Products (Actual page hierarchy in the Admin. These are sorted manually and appear in this order on the front end when viewing a 'Product Type' page) - Bracelets -- Product 1 -- Product 2 -- Product 3 - Earrings -- Product 4 -- Product 5 ... In the front end, when viewing by Category, we'd like to display the products in a custom order per category: - Amber - $pages->find("template=product, category=$page->title, sort ???") -- Product 1 -- Product 4 -- Product 3 - Silver -- Product 2 -- Product 5 -- Product 3 ... When I thought he was only going to sort the first page of results (18 or so), I was going to add a new page field type for each category so the client could select a limited amount of products to display first (I do this for the 'related products' section of the product page). Then I would select these first, then select the unsorted products (minus the first batch) and append them. But since the client wants to sort hundreds of products this way, I don't think this method would be practical. I've seen a similar post where Teppo uses a single field as an array, but I'm not sure if this would work or if I could populate the field from my spreadsheet. I welcome any ideas! Thanks.
  4. First, if you want to wrap the module render code in a div, don't use that class and id (and don't use 2 ids for the same element). Once the form is rendered, you'll see that there is already a div with that class that wraps the field you wish to hide. In the CSS, just target that class: .form__item--scf-website { display: none; }
  5. Thanks all. I ended up making a simple function that used used preg_replace and str_replace to strip the styles then nuke the empty spans and paragraphs. The imported html was pretty consistent, so it was pretty straightforward. But I like the idea of using $sanitizer, so I'll try both of those options to see how they work.
  6. Thanks, @kongondo . And thanks for the links, I’ll dig in and see what I find. 👍
  7. Hi all. I've built a module to create and update pages from an XML feed. It work nicely, except I'm having a problem with imported inline css styles. My Body field gets populated by a field in the XML that usually contains a load of inline CSS styles (like "<span style="font-style:normal;font-weight:normal;background-color:transparent;text-decoration:none;">). I've tried using $sanitize->purify() but that doesn't seem to do anything. Am I using it incorrectly? Is there another method to clean up this cruft from the HTML? Ideally, I'd just be left with <p>, <strong>, <b>, etc. All of the other fields sanitize correctly. Any ideas what I'm doing wrong?
  8. Here's a follow up (see above): I've been able to partly update my existing registered users with the API. I've enabled tfa_type, but can't set their tfa_code_email. That means that when they first log in, they'll see a notice telling them to configure TFA by entering their email address and receiving a code. That's not horrible, but that means they may not set it up if they are lazy. I'd rather already have their email address set so they'll just receive the 'we've sent you a code...' message and do it. So any thoughts about pre-populating this tfa_code_email field (it's a module setting) would be helpful. I've added an admin confirmation system by adding another role (Ryan suggested this in another forum post) and hooked after the 'LoginRegisterPro::createdUser' method to notify the Administrator by email (with options to approve or deny as links that process the user without going into the CMS; this then notifies the User if successful). I've also hooked 'Users::saveReady' to send the same email, in case the Admin approves manually in the CMS. Finally, I've given the registered users a choice of receiving their TFA code via email or SMS text message as mentioned above. ClickSend is affordable and easy to use. I've added radio buttons for 'Email' and 'SMS' to the User template along with a telephone field so users can choose when they edit their profile. 'Email' is the default, but if 'SMS' is selected, that phone number is prepended to the @sms.clicksend.com and replaces the email address via a HookBefore 'TfaEmail::emailCode'. I'm not great with Hooks, but it all made sense eventually and was a learning experience. I've simplified some of the interface on Edit Profile with 'display: none' in css (not ideal). But it all works pretty well. 🙂
  9. I've just been playing around with the TfaEmail module in conjunction with the LoginRegisterPro module. I've got a client who wants to upgrade their simple user registration/login system to use TFA (users request an account and if approved can access proprietary content and downloads). I thought the Email/SMS route would be the simplest and most familiar method. It works fine with just an email address (see below for SMS). The site already has about 60 registered users, all with valid email addresses. I'd like to be able to transparently upgrade all accounts to TFA, so I thought I could copy their email address to the 'Email/SMS two-factor authentication' field. The problem is that if I do that and save the user, a code gets sent out (which would seriously worry/confuse the user!) Is there a way to avoid this? Maybe disable something while I update the email fields? Or should I do this programmatically when a user logs in for the first time after in the front end? Maybe copy the email address 'behind the scenes' along with a notice of some sort? I guess I'm trying to skip the initial confirmation step of the TFA. Once that's solved, I plan to allow the users to decide whether they want to continue using an email address or change to SMS message for authentication. I'll offer the option on their profile page. If they choose SMS, I'll use a service like ClickSend to send (I've had trouble finding free gateway numbers for the UK mobile carriers). In that case, I'd try to hook into the TfaEmail module to append the '@sms.clicksend.com' to the mobile number provided.
  10. Yeah, that's what I thought. While I was building the site, I hit the Stripe form page a lot (testing the layout, shopping cart, etc) then back again. I think I must have generated quite a few incomplete transactions! Once people start using the site, I don't think it will be a big problem. Maybe I'll just disable the intents during development in the future. But I'll probably look into a way to delete them via the API. I'll post my results if I get any. Thanks for the module.
  11. @benbyf Hi Ben. I've been trying out this module and modified the form for use with the Padloper shopping cart. (I was using a different Stripe module but I needed to upgrade to one that uses Intents). All is working well, but I've just realised that I've got a lot of 'incomplete' transactions listed in my Stripe Admin panel. I see the cancelIntent() function in the module, but I'm not sure when/how I should call this. Could I use this to get rid of my backlog of incomplete transaction? Sorry if I'm being thick, but I guess I don't quite understand the Stripe Intents concept. Thanks.
  12. @Robin S Thanks, that's perfect. I can't believe it was that simple; I was definitely over-thinking it, trying things like append and add. Many thanks. - P
  13. Hello ProcessPeople. I'm trying to get an xml file for a store locator-type map page. It works fine, but the client wants the icon colour to change depending on the location categories (which can be multiple categories). I've decide the easiest way to do this based on my existing javascript would be to just get multiple results in my xml file for those locations with multiple categories and let the js display. Like so: 'Location A' has 2 categories 'Residential, Health' 'Location B' has 2 categories 'Health, Education' 'Location C has 1 category 'Residential' I'd like a selector which would produce this xml (sort of like the opposite of 'unique'): <marker title="Location A" category="Residential" ... /> <marker title="Location A" category="Health" ... /> <marker title="Location B" category="Health" ... /> <marker title="Location B" category="Education" ... /> <marker title="Location C" category="Residential" ... /> Note that it doesn't matter if the result is 'category="Residential, Health"', as long as any location with 2 or more categories appears as a duplicate; I don't need to strip out the other categories since I'm using the first word of the category string to determine the colour of the marker. I think I may need only one category returned, if possible. There are only 5 categories in total. Any suggestions? I've tried searching through the forums and cheatsheet, but I don't really know the term for what I'm looking for. Non-unique? Thanks.
  14. @dragan You’re right; given my limited skills that would be easier. I’ve done something like that for a site without the LoginRegister module, but I guess I just wanted to see if I could keep it all in the same package, and learn more about hooks. But whatever gets the job done. Thanks.
  15. Thanks Jo Justo. I don't think this solves my problem though. I need to enable the Registration form routine when the $user->isLoggedin(). You've given me some ideas though, so now I've just got to get my head around this hooking business!
  • Create New...