Jump to content

blynx

Members
  • Posts

    174
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by blynx

  1. Ah well - as long as it is not a complex page. But then if you have different kind of images on one page it will make more sense to think about other names. But I guess you will see that then And to the images, uhm hmmm ... uhm ... are you sure every category has a head_image? There are 5 categories (one is empty) in your database but 6 images displayed? I am pretty sure the code should work but I will have a try on one of my sites which has a similar setup now - Your code is from the projects template, right?
  2. Hej, you forgot to select the head_image in your image tag: <img src='{$project->head_image->url}' class='head-image'> This should work? Also it is better to use more specific classnames which describe the element in more detail - for example you would see at once in your css what kind of image that is - and other reasons ...
  3. Hi Troost, try something like this: foreach($page->children as $cat) { // maybe echo category stuff here? foreach ($cat->children as $project) { if ($project->head_image) { // echo project image stuff here } } } This loops through the categories first, and for each category looping through the projects. So it will loop through all projects one category after another. Also you could then echo some category stuff inbetween if you want ... cheers! Steffen
  4. SessionHandlerDB wasn't installed and I set max_allowed_packet to somewhing pretty high compared to it initial value (32M). Still the same behaviour - though, (even before I raised the max_allowed_packet) it kinda works now. I just get the blank page when I change a setting. But after reloading it seems to work. Then I also tested it on a webserver with the latest PW - but unfortunately TracyDebugger didn't work at all there no panel, neither in the frontend nor in the backend ... uhm ... Fresh processwire and fresh TracyDebugger installation. Will have another try on another server some time later - maybe it's the shitty hoster ... Thanks for your help!
  5. @bernhard yep, latest version of the TracyDebugger module, just installed it. But I was using ProcessWire 2.7.2 - Was trying with ProcessWire 3.0.11 now: Same problem but it only occurs once when I log in. After a reload the backened page loads as it should. ... For a couple of times. Now can't log into PW3 either - blank screen. Will have a try on a Webserver later ... Maybe it is something about the MAMP configuration? EDIT: No errors in apache_error.log or php_error.log in Apps/MAMP/logs/...
  6. Hej, I was playing around with Tracy Debugger and when I checked the Page/Template/Fields Object options for the Processwire-Info panel I only get a blank page rendered in the processwire backend. ... !? Using MAMP. Any ideas what is going on? cheers, Steffen
  7. Hej, maybe $page->repeater->eq()? see: https://processwire.com/api/ref/wire-array/ cheers! Steffen
  8. @gar1606 Try the "Check for New Modules" button, or see alternatives here: http://modules.processwire.com/install-uninstall/
  9. Hej, I haven't worked a lot with FormBuilder, yet, so my approach would be to stick with the API. I just dont know enough to have an opinion about FormBuilder. But also since there are not too many fields and things to consider I think it shouldn't be too complex with API forms. I guess you can easily do this on one single page, keeping the state of the transaction in the session to display the correct form. May I give you some ingredients with which I would do this instead of giving a complete solution? Also, maybe you could post your current code so we can have a look at what is going wrong/missing? I think by copying Somas forms completely in the first place and then hacking aroung you should get an idea of how those work. It is not as much as it might seem! My few ingredients: So one thing I would do: Keeping track of the current step of the transaction within the form itself: You could keep track of the transaction steps with a hidden field in the 2 forms that will be presented: $field = $this->modules->get('InputfieldHidden'); $field->attr('name+id', 'step_id'); $field->attr('value', 'whatever-step-id'); $form->append($field); And incrementing the value of that step accordingly. In the template-file for that page I would ask for that step kinda like so - the switch statement should be implemented in somas code where it says "do with the form what you like" if($input->post->submit) { $form->processInput($input->post); // drr drr drr // drr drr drr switch ($input->post->step_id) { case 'step-confirm': $form_output = render_step_confirm_form(); break; case 'step-granted': $form_output = render_download_link(); break; default: $form_output = render_step_zero_form(); break; } } The building of the form could be put in some functions like "render_step_1_form()" so it stays a bit cleaner. mh. And then of course all of your other logic. Does that help? Hope it does - cheers Steffen
  10. From what I understand from your description, I think what you are looking for is $page->child() $page->child("selector") $page->children() $page->children("selector") see: http://processwire.com/api/ref/page/ So you can access the children (links) of / from your directory (basic-page) and even filter them with a selector. Then also iterating over them for whatever output: foreach($page->children() as $link_page) { // do something with $link_page $link_page->that_link_repeater->each(...); } Is it this what you are looking for? and yep, I think it would make sense to have a specific "directory" template when these pages have that specific purpose. I do this too for certain things. cheers, Steffen
  11. Hi and welcome here! What kind of 'script' ist that? Is it a complete application like Piwik? https://piwik.org or a GoogleAnalytics code? Or is it a simple php/js script? Would you share a link so we could have a look how that is supposed to work? cheers! Steffen
  12. Hi, mh, does it also 'not work' without this options module? Maybe there is something wrong with the TextformatterVideoEmbed/Inputfield setup already because the link didn't get transformed in the first place. This module, the TextformatterVideoEmbedOptions only applies the embed options to the embedded object. Also make sure that the VideoEmbedOptions module is run after the VideoEmbed module. (Though it might actually be that it doesn't matter) Is the url transformed into an <a> link?
  13. Oh thats nice! I didn't know about the closest() method, though I was thinking about whether this should traverse the whole parent tree or just stick to the immediate parent. Maybe this could be an option in the module value from immediate parent closest parent Does it make sense? Or is the immediate parent pretty much useless then? @LostKobraKai Nice! Haven't thought about this approach - but I think I will stick to my version for this site since it doesn't "automagically" fill values on the frontend which are "actually holes" on the backend.
  14. Hi Jürgen, I was looking for something like this and built something similar which is more generic I guess - but I haven't tested it with complex fields so far. In my module it is possible to set specific templates which are able to "give" field values and specific fields which are able to receive values. Then, any field of a newly added page adopts those values according to the settings. https://processwire.com/talk/topic/13183-adopt-field-values-as-defaults-from-parents/ Maybe this might also be useful for you. best wishes Steffen
  15. Hi, I just made this module because I needed it. GitHub: https://github.com/blynx/AdoptDefaultsFromParents Module Directory: http://modules.processwire.com/modules/adopt-defaults-from-parents/ What it does: It fills fields of newly added pages with corresponding field-values of their parents. Configurable by setting "giving templates" and "adopting fields". Configuration: You have to set templates which are able to give field values and fields which are able to receive values. Then, this module automatically applies field values to every newly added page from their parents according to those settings. Also you can switch between immediate or closest parent (@LostKobrakai, thanks for the hint!) Why: I am building a little webshop with padloper and made some product categories ("parent page") which have some properties which should be automatically descendable to their children. Yet, the children should be able to have individual values if they want to. Now: So far it works for me - but please test it out and if you think improvements can be made, tell me about it. Also, what do you think about the general idea? Notes: So far I haven't tested it with more complex fields, yet. So far tested and working: Integer Text Page Similar fields should work. The module simply copies the field value. cheers! UPDATES v003 - 10.5.2016 Added option to switch between immediate or closest parent
  16. Hi biber, I had some time to oversee the code again, finally. I made two adjustments: The first was to remove the "echo </li>" from the second function in the visit call and add a </li> to the end of the output of the first function. Thats what I was hinting at before. The second was that I wrapped the nested lists inside another list-item <li> because of the HTML specifications for lists: http://www.w3.org/TR/html5/grouping-content.html#the-ul-element For comparison the working visit call: (with additional <ul> tags around so this can stand for its own) echo "<ul>"; visit( $pages->get('/') , function(Page $page) { echo '<li><a class="men" href="' . $page->url . '">' . $page->title . '</a></li>'; if ($page->numChildren > 0) { echo '<li><ul>'; } } , function(Page $page) { if ($page->numChildren > 0) { echo '</ul></li>'; } } ); echo "</ul>"; best wishes Steffen
  17. Hi! Let me give you a hint: (I am about to leave the house now, so I wont set up a testthingy now, but just stumbled about the error ) One of your double </li>s is just misplaced - there is one </li> missing after the "Rezepte" item. If you recap your code and look what it does I think you will find the solution! Otherwise let me know and I can try to fix it the weekend. Hope that helps! lg Steffen
  18. Hej j00st, I stumbled over the VideoEmbed problem, too. I think it was because indeed Markdown did translate "http://something.com" to an <a href="something"></a> link and VideoEmbed doesnt touch <a> links. I think switched to Textile in that one case - but I guess it should work by changing the order of the textformatters, too. Regarding the other problem, the ImageTags module looks okay on line 20. Could you paste the textinput here? Maybe there is a typo? cheers Steffen
  19. EDIT: Yay, everything is fine ... turns out, as you can see I forgot the ; at the end of the lines ... stylus habit; Hi, I was just trying getting some .less files compiled but something doesn't work with @import. I have an index.less file which shall import several sub-stylessheets - and that index.less is the only one given to the ::CSS() function: @import "variables.less" @import "layout/index.less" @import "boxes/index.less" but that just gives me: #_____LESS_____ERROR_____REPORT_____ {content:"ParseError: Unexpected input in anonymous-file-0.less on line 7, column 1 05| @sth: #ffffff; 06| 07| @import "/dev/site/templates/styles.less/variables" // global variables 08| @import "/dev/site/templates/styles.less/layout/index.less" 09| @import "/dev/site/templates/styles.less/boxes/index.less" 10| "} Am I doing something wrong or is this feature missing in AIOM?
  20. I made something like your original idea: A website with members which are also sorted into groups. Then the url of a members dashboard is like http://website.com/groups/group34/member123 The structure: root |--groups | |--group ... | |--member | |--member |--group | |--member | |--member | |--member ... ... ... But I am not sure if I still like that approach very much ^^
  21. The other bug should also be fixed now!
  22. Arrrgh! ok - hum, so it is just adding it additionally but the url-parameters are ok? Will have a look into this later - I don't know if or how it is possible to control the volume. At least you are able to activate some "JS API" - so I guess it should be possible. You should have a look into it here: https://developers.google.com/youtube/js_api_reference But it seems to be deprecated ... EDIT: Use the iFrame API --> https://developers.google.com/youtube/iframe_api_reference There are some functions: player.mute():Void player.unMute():Void player.setVolume(volume:Number):Void player.getVolume():Number
  23. Ok, I should have fixed that now - it worked for me before, though. May I ask which PHP version you are running? I was using the self::class thing to get the classname and that didn't seem to be working for you.
  24. Ah, that one - It should be fixed now. I made a stupid mistake in the version number
  25. Or a custom Hanna Code approach ... If you are into coding - Things surely need to be changed to fit your needs, I hope one gets the idea. Hanna Code of one contact form: <?php $form = $modules->get("InputfieldForm"); $form->action = "{$page->url}"."#contact-form"; $form->method = "post"; $form->attr("id+name",'contact-form'); // create name field $field = $modules->get("InputfieldText"); $field->label = "Name:"; $field->attr('placeholder', 'Enter name here please'); $field->attr('id+name','cf_name'); $field->required = 1; $form->append($field); // create email field $field = $modules->get("InputfieldEmail"); $field->label = "E-Mail:"; $field->attr('placeholder', 'Enter E-Mail address here please'); $field->attr('id+name','cf_email'); $field->required = 1; $form->append($field); // create HONEYPOT email field $field = $modules->get("InputfieldEmail"); $field->label = "Anti-Spam field! Dear screenreader user. Please leave this field out since it serves as spam detection. Otherwise your message will get lost!"; $field->attr('placeholder', 'Leave this field empty! Spam-protection!'); $field->attr('id+name','email'); $field->required = 0; $form->append($field); // create textarea field $field = $modules->get("InputfieldTextarea"); $field->label = "Your Message:"; $field->attr('placeholder', ''); $field->attr('id+name','cf_text'); $field->required = 1; $form->append($field); // oh a submit button! $submit = $modules->get("InputfieldSubmit"); $submit->attr("value","Senden"); $submit->attr("id+name","cf_submit"); $form->append($submit); if ($input->post->cf_submit) { $form->processInput($input->post); // honeytrap if($form->get("email")->value != "") { echo "spam!spam!spam!"; die(); } if($form->getErrors()){ echo $form->render(); } else { $add_header = 'From: '.$form->get("cf_email")->value."\r\n".'Reply-To:'.$form->get("cf_email")->value."\r\n".'X-Mailer: PHP/'.phpversion(); $mailmessage = "A message from: \n\n"; $mailmessage .= $form->get("cf_name")->value."\n"; $mailmessage .= $form->get("cf_email")->value."\n\n"; $mailmessage .= $form->get("cf_text")->value; $mail_goes_to = "whereitgoes@somewhere.com"; mail($mail_goes_to, "enter subject here", $mailmessage, $add_header); echo "<p id='contact-form'><span style='background:yellow;'>Message successfully sent!</span></p>"; } } else { echo $form->render(); }
×
×
  • Create New...