Jump to content

louisstephens

Members
  • Posts

    516
  • Joined

  • Last visited

Everything posted by louisstephens

  1. I believe you would still have to foreach through the options like: foreach($page->name_of_select as $option) { echo "<li>$option->title</li>"; }
  2. Thanks Robin! I will definitely thumbs up the issue. Also, thank you for the work around, it works like a charm.
  3. I came across something today which has me a bit puzzled. I have a site structure like: Development - Dev Heading - Dev Parent - Dev Child - Dev Child - Dev Parent - Dev Child - Dev Child - Dev Heading - Dev Parent - Dev Child - Dev Child - Dev Parent - Dev Child - Dev Child If I copy/duplicate a page that has children (like Dev Heading or Dev Parent), I am taken to a screen to change the name/url as well as the url "slug". However, If I try to clone "Dev Child", it simply clones it as "Dev Child 1" and sets the status to unpublished. It is okay, but kind of annoying when the two have separate actions. Is there a setting to change the current behaviour, as I rather like being taken to a screen to directly edit/publish the page. This would be beneficial to me as I have a hook on after page save for certain templates, but currently it saves it everytime I try to copy "Dev Child", and then I have to go in and edit/publish the page.
  4. Basically, a lot of what wbmnfktr says. If the project is a bit more complex, I do schedule a time to sit down and go over the backend to see if they are having any hang-ups, or if they have tried to "force" the system to work in a way it was not developed for. Sadly, this seems to be an ongoing issue, and I spend a lot more time trying to clean up areas of the page tree where they have just dumped pages and claim the system is broken due to their lack of understanding/forgetfulnes. If everything has gone smoothly and any scheduled change(s) are complete, I do send out an email with a url to a survey to gather a bit of information on how the project went and how the processes could have been better tweaked.
  5. Are you trying to hide the contents on the front-end or the back-end? Without being able to actually look at the site in question or the code, I can not really help. I would check your inspector and see what properties are being applied to the content. This will help you out in case you need to add !important (I hate using them) due to the framework.
  6. Ah, thanks robin. The dump in Tracy really helps. I need to use that much more in my set ups for testing. Ill have to play around with the foreach loop, as I tried an if statement (Trying to group sectiona together and section b together),. But hopefully Ill get that worked out.
  7. It works great! I appreciate the help. One thing I noticed (I am sure it is working as expected), I tried wrapping the foreach in a few divs, but the output is a bit strange like so: <?php $people = $pages->find("template=service-a|service-b, sort=parent.name"); $name = ""; foreach ($people as $person) { $out = "<div class=\"user\">"; if($person->parent->name !== $name) { $out .= "<h3>{$person->parent->title}</h3>"; $name = $person->parent->name; } $out .= "<ul>"; $out .= " <li>{$person->title}</li> </ul> </div>"; echo $out; } ?> expected: <div class="user"> <h3>John Doe</h3> <ul> <li>Service 1</li> <li>Service 2</li> <li>Service 3</li> <li>Service 4</li> <li>Service 5</li> <li>Service 6</li> </ul> </div> <div class="user"> <h3>Jane Doe</h3> <ul> <li>Service 1</li> <li>Service 2</li> <li>Service 3</li> <li>Service 4</li> <li>Service 5</li> <li>Service 6</li> </ul> </div> what actually is occurring: <div class="user"> <h3>John Doe</h3> <ul> <li>Service 1</li> </ul> </div> <div class="user"> <ul> <li>Service 2</li> </ul> </div> Did I just miss a tag?
  8. Thanks robin! I will definitely try this out when I am not on mobile. Unfortunately, the system was set up in a bit of a haste and grew beyond what it was originally intended for. I should have had the foresight and set it up differently. I really appreciate all the help and thank you for always commenting on helpful suggestions/fixes. Hopefully I can get this all working together without a complete overhaul, but it might be needed at this point.
  9. So I am making a front-end dashboard for an internal project, and was curious if it is possible to match 2 pages together based on their title and retrieve the data. To make it more clear: I have two pages "Section A" and "Section B" that each has child pages with names (the specific person) with subpages for their services offered. Section A - John Doe (name=john-doe) - Service 1 - Service 2 - Service 3 - Jane Doe (name=jane-doe) - Service 1 - Service 2 - Service 3 Section B - John Doe (name=john-doe) - Service 4 - Service 5 - Service 6 - Jane Doe (name=jane-doe) - Service 4 - Service 5 - Service 6 What I would like to achieve on the front-end (if it is even possibile), is an output like: John Doe - Service 1 - Service 2 - Service 3 - Service 4 - Service 5 - Service 6 Jane Doe - Service 1 - Service 2 - Service 3 - Service 4 - Service 5 - Service 6 Thinking aloud: use a find to get all pages using the template "service user" and then foreaching through their children (and possibly getting a few field values as well) to output in the front end. The service templates used in the sections vary slightly in which fields they use. <?php $findUsers = $pages->find("template=service-a (and or) service-b,(some how match based on names)"); //if no match exists, output what is available ?> <ul> <?php foreach ($findUsers as $groupedUser): ?> <li><?php echo $groupedUser->title; ?></li> <li><?php echo $groupedUser->service_a_location; ?></li> <li><?php echo $groupedUser->service_a_body; ?></li> <li><?php echo $groupedUser->service_b_location; ?></li> <li><?php echo $groupedUser->service_b_phone; ?></li> <?php endforeach; ?> </ul> Sorry, it is just me thinking aloud, but I was not even sure if it is possible to group them together like that. I was going to have a page for each "section" only displaying that data, but I thought it would be nice to display them all together as an overview for the user.
  10. Thanks everyone for the great advice! I am testing the waters right now using the module @adrian mentioned, and thus far everything is going great. My only real hurdle is getting the form submit portion. I am using wireMailSMPT , and I cant figure out really how to change out the $text = "" <?php $firstName = $sanitizer->text($input->post->form_first_name); $lastName = $sanitizer->text($input->post->form_last_name); //needs to be switched out if fullname is selected $email = $sanitizer->email($input->post->email); $phone = $sanitizer->text($input->post->phone); $textBody = " First Name: $firstName Last Name: $lastName //needs to be switched out if fullname is selected and not partials "; $numSent = wireMail($yourEmailaddress, '', $subject, $textBody, $options); ?> variable based on what is selected from the form {made even more complicated as the field select is inside a few matrix repeaters). I guess perhaps I have made it way to difficult as the field inputs are now dynamic, and now my form processing needs to be as well.
  11. Thanks @Gary Austin, this seems very similar to what I was going to do. For your "notes" pages, did you simply create the fields in the backend and assign them to the pages? How did you go about rendering/processing the fields? A simple: $page->field_name ?
  12. I guess my "issue" was having them in the setup tab and leaving their current page. I have tried to make the actions they can perform very straight forward/easy, as some of them are not very "tech savvy". I personally like what Form Builder (have not used it yet, but will be soon) offers, and it will be ideal for when another dev or myself use it. Unfortunately, having a long list of contact forms on a page for them all to see might create some confusion and result in editing the "wrong" form not applicable to them.
  13. Thanks for the reply dragan. Currently, my strategy was to use a select options box, ie: 1=basic-form|Basic Form 2=enhance-form|Form Form etc etc And in my template, use a foreach: <?php if($page->form_select->title === "Basic Form") { echo "{form that I have predefined"; } else if($page->form_select->title === "Enhanced Form") { echo "{form that I have predefined"; } else if(...) {} else {} ?> The current set up works without issue and is pretty straight forward. However, it means I have to spend my time creating new forms due to a user wanting their own custom form and not sticking to a default . Understandably, my basic forms might not be a catch all for their needs. Now, the forms wont get too crazy, but some might need first + last names combined, whereas some need them split (for various reporting needs). I guess I am trying to devise a way to give everyone what they want with a blanket solution, without me having to create 40+ form variants and cause my if statements to be crazy. Aside from the structuring, each form might have to be sent to different email address with different subjects, but I have that under control with a few fields on their pages which directs wiremailsmpt correctly. Just thinking aloud, but maybe the closest to what I want is by using a page selector, and have the "pages" just be placeholders for the form elements, Ie First Name Email Address And in my template --> <?php $field = $modules->get("InputfieldText"); $field->attr('id+name','firstname'); $field->attr('type','text'); $field->attr('placeholder', 'First Name'); $out = $field->render(); echo $out; ?> However, this too will probably end up close enough to my first example/
  14. So I have been creating an internal web app over the last couple months, and am finally on the last piece of the puzzle, customizable forms. I thought I could just create a view basic forms and use a select option to let them select the form, and my template file could just output the form based on their selection. Easy enough. However, I have since ran into a slight head scratcher. Not all the forms are the same and they might vary greatly between each other. Has anyone done something similar to this? In an ideal world, I would use form builder, but I really dont want them to have access to it. They are currently constrained to a few pages in the backend, which is why I was trying to think of a way for them to select a few fields (like from a page select), and then render the selections on the front end based on what was selected.
  15. Yeah, I remember making logos for a tags using: <h1><a href="/">COmpany Name</a></h1> a.logo { width: 350px; height: 75px; text-indent: -9999px; background: url(logo.png) no-repeat left top; } I never used many backgrounds with spans however.
  16. Just a quick question, I have a function in my ready.php file that creates a new js file inside the "scripts" folder (under templates). Everything is working as expected, however, is it possible for the url to look like www.domain.com/scripts/generated.js ? Currently, the only way I can access it is via www.domain.com/site/templates/scripts/generated.js. Or is there a better place I should be putting these scripts ? I I am trying to use the scripts elsewhere (not on the processwire install).
  17. I was attempting to export some fields from my dev branch to move them over to a live site when I got the following error: Has anyone experienced this before? I was thinking I could just write a script using the api to create the fields, but there are about 44 fields (2 are repeater matrix) that are all slightly unique. If anyone has experienced this, what was your work around?
  18. *facepalm* .. Thanks Ryan. I completely forgot about that. It has been a a few since I had set that up.
  19. Thanks Ryan for the assistance. Unfortunately, that has not really solved the issue. I tried selecting either one, and it doesnt appear to be having any effect on the design. Everything is still "the old green" theme.
  20. So I recently upgraded my sandbox environment to the latest master version from .62(?). I logged in and received the following error: "There appear to be multiple copies of module "AdminThemeUikit" on the file system." Unfortunately, in my haste, I removed the theme from site->modules so it doesnt exist anymore, and the theme has defaulted somewhat to the old theme. Is there a way to restore UIkit as the theme for processwire natively, or do I need to completely re-install?
  21. It just so happens that you can bootstrap processwire into scripts. I have used this several times and it is just one of the many awesome features. https://processwire.com/api/include/ Normally, I house specials scripts outside the template folder (like you have done) and just include processwire's index like: <?php include("/path/to/processwire/index.php"); ?>
  22. Not really sure if this is the best place to post this (or if it belongs in the thread for the module itself, but if it needs to be moved please do so. I successfully got graphql set up and love how easy it makes it to query etc. In my endpoint, I have: echo $modules->get('ProcessGraphQL')->executeGraphQL(); And on another page, I was testing with: $.ajax({ type: "POST", url: 'localhost/pw/graphql/', data: "{ modals(s: \"title=Test-Page\") { list { id title body } } }", success: function(data) { console.log(data); } }); However, I seem to be getting an error message returned with: "Must provide an operation.". I do apologize if I have just missed something basic (very new to ajax and how it all functions), but is there something missing from my initial request?
  23. First of all, this is amazing! It makes what I was trying to do look like a pile of trash. Just wondering, if you don't mind divulging a bit of information, just how did you accomplish the "demo grid" ?
  24. Hello and welcome to the forums! I personally get by using 755 on my local dev environments as well live installs. If you have not looked at it already, I would take a look at the following concerning permissions: http://processwire.com/docs/security/file-permissions/ As for the comment "* ProcessWire Bootstrap", this enables ProcessWire's API to be used in other php scripts not already stored inside of ProcessWire's file structure. A good read can be found here: https://processwire.com/api/include/
  25. Thanks kongondo! I will give that shot this morning. Lat night, I did get it working using: $existing_name_check = $pages->find("name=$post_name"); $existing_email_check= $pages->find("submission_email=$email"); if (count($existing_name_check)) { $session->redirect("?alert=existing-submission"); } else if (count($existing_email_check)) { $session->redirect("?alert=existing-submission"); } else { // create page $session->redirect("?alert=form-success"); } I really appreciate everyones' help as well as patience with me!
×
×
  • Create New...