Jump to content

louisstephens

Members
  • Posts

    516
  • Joined

  • Last visited

Everything posted by louisstephens

  1. As far as the backend goes, you can rearrange the fields by going to the template and dragging the field to where you want it. This, with the combination of field width, will let you place fields side by side, etc etc. As for the front-end (if you are rendering the fields), that is completely up to your css how they are displayed/what order they are presented in.
  2. Thanks @breezer, I will definitly look into that. I do need to clarify that I am not really making a "login/register" site or really updating actual registered users on the site. Basically, as it stand right now, a registered user will fill out the form with a persons information that they will be able to keep track of certain information. I guess think of this as a glorified rollodex of contacts. I will be adding more fields to the form down the road as this evolves.
  3. So I have a form, once completed, will create new pages. All in all, this is eazy-peezy for me now. I guess I need a bit of guidance on how to actually structure the rest of my code. I thought I could just write a function (_func.php) and pass the fields to the function and let it do its' thing. However, I am kinda hitting a road block when I do it this way. I currently am passing first name, last name, city, state (options field), and making pages based on the first/last names. I guess where I run into some issues is I am trying to check to see if the "page" already exists, and if it does, throw out an error: In the home template: if(isset( $_POST['submit'])) { $firstName =Trim (stripslashes($_POST['firstname'])); $lastName = Trim(stripslashes($_POST['lastname'])); $fullName = $firstName . $lastName; $city = Trim(stripslashes($_POST['city'])); $state = Trim(stripslashes($_POST['state'])); $lowerCaseName = strtolower($fullName); $people = $pages->find("template=person"); foreach ($people as $person) { $checkFirstName = $person->first_name; $checkLastName = $person->last_name; $checkFullName = $checkFirstName . $checkLastName; if ($checkFullName === $lowerCaseName) { echo "<p>" . "This person has already created a page. Please choose a different name." . "</p>"; } else { echo "hey"; processNewPerson(need_to_pass_person_details_to_function); } } // end foreach In _func.php: function processNewPerson($list) { $u = new Page(); $u->template = "person"; $u->parent = wire('pages')->get("/people/"); $u->title = ; $u->first_name = ; $u->last_name = ; $u->state = ; $u->city = ; $u->save(); $u->setOutputFormatting(false); } I am a little unsure of how to actually pass all the information to the template, as well as if this is even the best approach to do this. Would it make more sense to do this in a class, or keep it the way it is?
  4. I have not used this one before, but there is a plugin called codemirror plugin that should accomplish what you need: https://ckeditor.com/cke4/addon/codemirror Drats, dragan just beat me to it..
  5. Hey Noel, I just had a quick question for you regarding pageQueryBoss. I was just trying to get a simple example up and running (using the most up to date version), I got it working by adding in autoload true to to the config. However, I am a bit stumped. I really need a query set up to return something like: Parent Page - Grandchild Page - field - field - Grandchild Page - field - field - Grandchild Page - field - field Though no matter what I try, I can not seem to wrap my ahead around how to return the desired result.
  6. Thanks @Jonathan Lahijani for that tidbit. I had been "struggling" with that for awhile, and this makes life so much easier.
  7. So I tried your groupBy, and I am currently getting the following: "Blowing- etc etc" "Blowing- etc etc" "Blowing- etc etc" "Pest- etc etc" "Pest- etc etc I assume that $letter is just simply finding matches to the whole string in this case and grouping them together? I am sorry, I have not used preg_replace that offten, and couldn't tell you even where to begin in editing it to get the desired result of B Blowing- etc etc Blowing- etc etc P Pest- etc etc Pest- etc etc Pest- etc etc
  8. Thanks BitPoet, I will give it a shot. I guess I should have been more clear. Each service does begin with the letter, Like: "Blowing- etc etc" "Blowing- etc etc" "Pest- etc etc" "Pest- etc etc" "Pest- etc etc"
  9. I have done a bit of searching, but I can not seem to find an actual answer. I have a list of services as child pages under "Services". I can output the services just fine, but I cant wrap my head around how to group them "alphabetically" like: Services A - Service "A" 1 - Service "A" 2 - Service "A" 3 B - Service "B" 1 - Service "B" 2 - Service "B" 3 C - Service "C" 1 - Service "C" 2 - Service "C" 3 Has anyone achieved this type of functionality before?
  10. Just from the bit of reading I was doing, each device has a different HTTP_USER_AGENT and therefore the sessions no longer match (between chrome and the device agent). A solution someone came up with on stackoverflow was to store the user agent in the session and check against it once the switch has been made. Perhaps someone better than I could give a better way to handle it in a PW sense. https://stackoverflow.com/questions/45532678/chrome-toggle-different-devices-view-destroys-the-session
  11. This might help you out in outputting page names in different languages. https://processwire.com/api/multi-language-support/multi-language-urls/#api
  12. I did find this topic: @Robin S provided a hook for site/ready.php $wire->addHookBefore('InputfieldFile::render', function(HookEvent $event) { $inputfield = $event->object; $inputfield->noShortName = true; });
  13. I have not really dun in too much on the integration of uikit on the admin side. I like the updated color pallet much more than past versions, I really just need the layout to be responsive for mobile and for it to look somewhat decent. It could have been built using picnic.css, the current pallet, and some custom mixin styles and I would still love the admin. I for one am moving away from giving access to the admin for users and building my own "admin" on the frontend so users never even see the default admin. It lets me show only what I need to show and define my own actions for them to take. I do not mean to sound like I am knocking on the backend/uikit, but I like to have full control over everything presented/styles. On that last point, I do wish theming was a bit "Easier" for the admin.
  14. My apologies Macrura. I got a bit turned around this morning?
  15. I have not tried this before, but I see that it has been brought up before here: Though perhaps @Macrura might be able to help out on this.
  16. I won't pretend that I know anything about the eu gpdr (well, I have a basic understanding). However, would it still infringe if, upon installation, pw "phoned home" just to increment a counter? I know this doesn't provide much in the way of useful information.
  17. I would just go with the page table field. This way, you can create different templates for the many "content blocks" with the appropriate classes/css. When they are rearranged in the admin, the sorting should take place on the front end as well.
  18. Thanks jmartsch. I tried that earlier but forgot to switch the single ' for the " which is why it didnt work.
  19. I do believe the following will work $session->redirect('/user-profile/' . $user->name);
  20. I do agree with BitPoet on this one. However, in the past, I have had success with using vimeo to host videos for backgrounds. <iframe src="video_url_here?autoplay=1&background=1" width="640" height="178" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> It made it easy as well with adding "background=1".
  21. Well look at that. It was simpler than I thought. Thanks adrian. I'll keep that one in my snippets.
  22. Thanks everyone for the quick responses. Unfortunately when I do: $p2->parent = wire('pages')->get($parentPageName); I get the following: Exception: Unknown Selector operator: '' -- was your selector value properly escaped? (in MAMP/htdocs/development/pw/wire/core/Selectors.php line 378) Im a little baffled as I thought it would work without the quotes as I dont see any glaring errors in Visual Studio Code.
  23. I am wondering, how do you pass a variable into wire('page')->get() inside a function? I have been looking through the forums, but unfortunately I have not found the answer yet. My current set up is: function generateNewPages($parentPageName) { $p = new Page(); $p->template = "parent"; $p->parent = wire('pages')->get('/home/'); $p->name = $parentPageName; $p->title = $parentPageName; $p->of(false); $p->save(); $p2 = new Page(); $p2->template = "child"; $p2->parent = wire('pages')->get('$parentPageName'); $p2->name = "child"; $p2->title = "Child Page"; $p2->of(false); $p2->save(); } When I try to run it by passing in a title like generateNewPages('Demo');, "Demo" is created, but when it gets to the child page I get: Unknown Selector operator: '$' -- was your selector value properly escaped? Is there a way to pass the $parentPageName to "wire('pages')->get('$parentPageName')" ?
  24. Hey josua118, and welcome to the forums! Quick question for you, how are you rendering the field on the frontend?
  25. Hey @j00st, if you go and edit your original post, it will allow you to edit the title and prepend [SOLVED].
×
×
  • Create New...