Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by hollyvalero

  1. So this code: $subjects = $pages->find("template=subject, limit=100, sort=title"); foreach($subjects as $subject) { echo "<option value='".$sanitizer->alpha($subject->title, Sanitizer::translate)."'>{$subject->title}</option>"; } Does product the single name dropdown, lower case without the & or spaces. <option value='artandculture'>Art and Culture</option> <option value='mapsampgeo'>Maps &amp; Geo</option> <option value='Science'>Science</option> I thought it was working, but realized I need to include a leading PERIOD in the option value before the name in order for mixitup to work... : <option value='.mapsampgeo'>Maps &amp; Geo</option> <option value='.artandculture'>Art and Culture</option> Is there a way using this sanitize string to add the "." back in or do I need to go back to 2-3 steps to launder stuff out?
  2. It is... just don't know how to code that... I haven't tried this... but something like this? foreach($subjects as $subject) { $submix = $subject->title; $submix = ($sanitizer->alpha('$submix', Sanitizer::translate) ) ; echo "<option value='.$submix'>{$subject->title}</option>" ; }
  3. It will translate to lowercase, but if someone puts in "Frick & Frack" ... what happens to the & and the space?
  4. The sample page name is my working "worst case scenario" but there's no way of guessing what page titles will be. I've got multiple versions of this foreach loop... $submix = $subject->title; (maps & geolocation, math, STEM, and a zillion others) $resmix = $resourcetype->title; (videos, games, magazines, etc.) $audmix = $audience->title; (kids, taxpayers, college bound, whatever) Assuming I might have to convert each title variable back to HTML, then remove "&amp;" or all special characters... Then spaces... and dashes I think caps and lowercase will work fine, however.
  5. Hi! I've got 3 page reference fields (multipage) used to tag database entries by audience, subject area, and resource type. These can be created on the fly, so you can ideally curate a special collection and have processwire generate pages, sorted displays, etc. Using Mixitup to create a nice sift and sort with multiple drop down menus. Mixitup doesn't like spaces, dashes, special characters - just letters. Rather than tell everyone, "don't use special characters!" I'd like to assume the worst and strip them out behind the scenes. The option value and card class are both invisible, so as long as it's just letters it should work whether it's upper or lower case. For the drop down menu I need to generate something like this: <option value='.ResumesJobs'>Résumés & Jobs</option> And then the actual card display below will contain a matching ID: <div class="mix ResumesJobs"> ---etc. </div> I've got the basics working... I can remove extra spaces. I can get rid of special characters. But I keep getting dashes and amp; in the displays. Tried the sanitizer->pageName which didn't get rid of the amp. Sample of my sad code below... gather all pages listed under subjects... create a variable $submix for the title... then try to strip out spaces and characters: foreach($subjects as $subject) { $submix = $subject->title; $submix = str_replace(' ', '', $submix); preg_replace('/[^A-Za-z0-9\-]/', '', $submix); echo "<option value='.$submix'>{$subject->title}</option>" ; } Is there a better single process? Sanitizer seems like overkill since this in internal stuff, not user input. Tried to html encode &amp; back to & and then strip spaces, characters, etc. but bogging down in errors and unable to get rid of dashes. Would appreciate any insights.
  6. Hi, I'm coding a pile of research that ends up being tagged for a variety of issue areas: early childhood, human rights, justice, etc. Using a multiple page array field to make it easy to select an unlimited number of issues. In most cases I want to spit out that whole list when the research blocks come up with titles, links, images, etc. so people can click any issue area listed... like this... foreach($feature->issue as $item) { echo "<li class='iss uk-text-tiny bold caps'><a href='$item->url'>$item->title</a></li>"; } But for the home page, I'd like to restrict the listing of issues to just the first one in the list, as that will be the primary issue area... rather than create a separate field. The total count doesn't matter because I want to use just the first and ignore the rest... foreach($feature->issue as $item) { [select the first issue in the list of supplied issues and then spit that one out linked] echo "<p class='iss uk-text-tiny bold caps'><a href='$item->url'>$item->title</a></p>"; } I'm getting better and bringing back everything but don't know if I should try to put in a counter? Establish a limit? ... appreciate any help.
  7. Oh, that is Nifty!!
  8. Thanks! Gotta check my email settings, my notifications are not showing up from the PW boards.
  9. I like the Reno wrapper for the admin. After looking at UIKit, then switching back to Reno, the back end is all Reno but the basic back end login page /processwire or /whateveryoucallit is displaying the original Default instead of the Reno login. I realize this is a first world problem, but I can't seem to reinstate the Reno login. Tried installing/uninstalling... It's not the same page code and it's not the same style sheets... I can't uninstall the default ...what am I doing wrong?
  10. Yeah, I think you're right. Just need to mimic the final destination... domain or subdomain for those that will be at the root. Or, identical folder name for those that will be in a subdirectory.
  11. ^^ btw, I did come up with an idea that would work... for websites that are either redesigns or brand new, I've designated an unused domain, activated it, and that will allow me to build at a .com address, export the site profile, and import it to another root level address. An addition to export site profile would be ideal, but this will work in the meantime...
  12. Yeah, trying to avoid further obfuscating DNS stuff, since that's the kind of thing that inevitably falls through the cracks later... no one remembers... the site grows big... It's not a huge site and grepping out all the paths will not take more than maybe an hour or two... I think. I'd rather do it now, before it gets bigger... Just wondered if there was a way to establish the root path within processwire. This is also helpful for developing a new site at an existing server... you'd want to build in a separate directory and move it up one while the current site is live and uncompromised. It's an administrative detail that always pops up in redesign. It would be the kind of thing that -- if it was part of Export Site Profile? Well, that would take care of it... if you could say "reset root path to..." with a domain name or domain.com/directory/path ...
  13. I have a website on a shared server that I use to store a few sites. My active domain is at the top. The new website domain hasn't been activated yet, but the path would be something like: myactivedomain.com/newdomain.com/ and once the DNS is flipped, just newdomain.com/ As I am building and adding a load of PDFs, all the links default to /newdomain.com/site/assets/files/etc... This isn't migration, but a DNS activation. Once that is updated, I'm still going to have a bunch of /newdomain.com/ links in there to pages, pdfs, images, etc. Before I resign myself to grepping out page-by-page all the "/newdomain.com/" references I thought I would see if there's a way to update these automatically in processwire but I'm seeing stuff on migration... stuff in the rich editors about correcting links, but I don't see anything that covers this. Is there a way to do this automatically? Via module? I didn't see anything in the config file... but would be grateful to anyone who can shed some light...
  14. I'm don't know how to implement this. Does every input field in the form need to be replace with a $variable . So the username field: <label class='label' for='username'>Username</label> <p class='control'> <span class='help is-info'>Please ensure your username contains <b>no spaces</b>. </span> <input type='text' class='input' name='username' value='{$v}'> </p> Does the entities string go before or after the form entry above? Do I batch all the sanitizer entries first? $v = $sanitizer->entities($input->post->first_name); Further down I am creating a user. Does this: $u->name = $sanitizer->username($input->post->username); Need to be changed to: $u->name = $sanitizer->username($v); If I can figure out the order for one field, I can apply it to all of them.
  15. Yeah, I could probably do that... I'm going to install Front End User at another copy of PW... see how that looks. Save this for my plan B. Thanks!
  16. uh, yeah.. that. Maybe someday. I am still in the beansprout/newbie phase.
  17. I'm running the latest version of PW, but if the only problem is the PW nag? I think I'll export the site profile, load it to a second spot and try front end user... with the added js/css for the field validation and see if it works. If it does, then we're all set. I also looked at the subscribers module ... that too seemed to be in alpha :-D ... I'll try Front End User first.
  18. I read through the multiple parents post. All my users basically enter the same 6 fields. They get assigned one of two roles depending upon whether they are just subscribing to content, or contributing content. I tried creating a user registration form... got it to create (albeit missing data, no follow up page, and ugly) to access > users ... but I'd need it to also notify the admin that a new user is waiting.
  19. I am about to ask a big, stupid question... having gone through 50 pages of user, login, registration stuff. I can easily create a form - or use formbuilder - to create a simple registration form for a couple levels of users (roles = subscribers, contributors) and I can easily send those entries to a page structure like Pages --- Users ------Subscribers -- Bill Smith, etc. ------Contributors -- John Jones, etc. This creates a directory of pages, assigned roles, and page access based on role, but this doesn't put those people into: ACCESS > USERS > My user data lives in Admin > Access > Users -- not in the document tree. If I want to have user accounts, doesn't Bill Smith, in the example above, have to be in both locations? Or, at least Admin > Access > Users? This is a conceptual problem, not a code problem... as a new user of PW, I don't know where my logged in users are supposed to live -- and if I use a form, how to get them there.
  • Create New...