Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by dewwwald

  1. Ill do that, however I am now going to use a fix that works just the same, $form_post_two->required = $input->post->has_post === 'yes' ? 0 : 1;
  2. So I rendered the form now, using the form->render function. However this does not seem to work. That brings me to my selector. Tries -> - "has_post='no'" - "has_post_no=1" - "has_post.value='no'"
  3. Hey LostKobrakai, Thanks for the reply, Yeah I tested the value strait away after I posted the question. I am rendering the markup myself using a full MVC approach. Could this cause the issue? Here is an example of what I am rendering <div class="Inputfield push_-large_-bottom " id="wrap_post_line_one"> <label for="post_line_one"><!-- -->Postal address line 1 </label> <input type="text" name="post_line_one" id="post_line_one" placeholder="" maxlength="2048" value=""> </div> I want post line one to be requiredIf. Is processwire only looking at the field id in input->post? Because then this should work as all of the forms work perfectly. The issue i guess lies in the setup of requiredIf on my side, here is post_line_one's setup, // create an input for a visitor's Postal address $form_post_one = $modules->get("InputfieldText"); $form_post_one->attr('label', "Postal address line 1"); $form_post_one->requiredIf = "has_post.value='no'"; $form_post_one->attr('id+name','post_line_one'); $form_post_one->attr('placeholder',''); $form_post_one->attr('grid','g-1/1'); $this->append($form_post_one); //this is where my mvc starts
  4. Hey Simple From Support, I am looking at having a field requiredIf radio = yes. Must the field be set up as follow $condition_field->attr('id', 'condition_field_id'); $field->requiredIf="condition_field_id='yes'"; I'll be handling the visual stuff on the front end with custon js. But before I do that the back end must work. The back end is basically processing input with the form. Will it catch that this field has now become required? and therefore render it as a required field?
  5. Make CKEditor use absolute paths. Solved: I created a copy of the wire/modules/Inputfield/InputfieldCKEditor/pwlink plugin and named it site/modules/InputfieldCKEditor/pwlink, then I enabled it instead of pwlink. added a function to CKEDITOR inside of newMod/plugin.js : CKEDITOR.absoluteLink = function (href) { var reg = /^https?:\/\//i; if (!reg.test(href)) { var link = document.createElement("a"); link.href = href; if (href.indexOf(link.host) > -1) { //ie subdomain src = link.protocol+"/"+link.pathname+link.search+link.hash; } else { src = link.protocol+"//"+link.host+link.pathname+link.search+link.hash; } return src; } return href; } Then I went ahead and passed the link into the function: var url = CKEDITOR.absoluteLink($("#link_page_url", $i).val());
  6. Hi guys. I am looking for a way to use the multi-site plugin along with this. The issue I encountered is, when I navigate to a sub domain the link, since it is relative points to the subdomain path, even when the page being referenced is on the naked domain. Can I configure the CKEditor to use absolute paths?
  7. BernhardB, I am not sure what wireshell does yet, however looking at it quickly it seem to be an interface to processwire admin through the terminal. I would not sucgest that a node module will ever be replaced by a php shell plugin (even though its my first run in with this), however I would say that the two can rather be used alongside one another. Generator => Create a basic project, generator can use wire shell to run certain commands. Maybe even do the processwire db install and remove those annoying files (install.php and site/assets/install) An example of a command for gulp would be make template, Pseudo - make the file required for the template using gulp-shell - make the processwire template This works nicely for the fixate-pw-generator since one can set the file the template use to their mvc as a default of the gulp task. WireShell => used alongside gulp/ or vanilla WireShell to manage created project (fully aware of its install pw capability, but is it automated?) Again this is only in theory for me thus far, but I doubt the one makes the other obsolete, both are big wins for the PW community.
  8. Revised , the question is this: Should what I am getting, which is what I want and expect, be a concern, because the ignored template is the same as the root template, or is this how things should work?
  9. Hi somma, sorry about the duplicate, I have revised my post. Clarifying the intent of some words and adding structure stuff
  10. Hey Somma, I have not read the thread, sorry if I am duplicating content. I have the Multisite module installed and have the module working perfectly, however I am concerned if my config in MarkupSimple nav might be unexpected behavior. My options for markup simple nav that is relevant: - I am ignoring all templates that have the name home - and show_root=true ie Options are <<--edit: add method get root -->> function getRoot($httpHost) { $root = $this->pages->get('name='.$httpHost); if (!!$root->id) { return $root; } return $this->pages->get('/'); } <<--edit -->> $options = array_merge(array( 'current_class' => 'menu__item_-current', 'parent_class' => 'menu__item_-current-parent', 'outer_tpl' => '<ul class="menu_-primary">||</ul>', 'inner_tpl' => '<ul class="menu menu__sub">||</ul>', 'selector' => 'template!=rss|home', 'show_root' => true, 'list_field_class' => 'menu__item menu__item_-primary', 'item_tpl' => '<a href="{url_nav|url}">{title}</a>', 'item_current_tpl' => '<a href="{url_nav|url}">{title}</a>' ), $options) I also have the rootPage being overwritten in the render function like so <<--edit: add method get root --> $modules->get('MarkupSimpleNavigation')->render($options, null, $this->getRoot($this->config->httpHost)) <<--edit --> , obviously returning a page with template named home. It works as expected. Rendering the page without errors and returning a navigation containing the sub domain as home, meaning the first page and also the root page using template home, and all other sub pages of said sub domain. Even more It ignores all subdomains on the parent domain. Is this what I should expect? ie ProcessWire admin tree: -home -about -bla -subdomain.example.dev -about sub -bla sub on the site the nav will contain if at example.dev home | about | bla or if at subdomain.example.dev subdomain | about sub | bla sub
  11. There is no need for this complexity. If you are already using a vhost that works it might help if you simply add more server aliases to your vhost config ie. : ServerAlias *.domain.dev ServerAlias *.domain.dev.*.xip.io for me resulting in: # project-domain.dev.conf <VirtualHost *:80> DocumentRoot "/home/dirr/to/server/project-name" ServerName project-domain.dev ServerAlias project-domain.dev.*.xip.io ServerAlias *.project-domain.dev ServerAlias *.project-domain.dev.*.xip.io ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined <Directory /home/dirr/to/server/project-name> Options FollowSymLinks Allow from All AllowOverride All </Directory> </VirtualHost> In my case the project-name is a symlink pointing to the root of the project, and project-domain is the domain for the project that you added to hosts file
  12. See, I did not think further than repeater vs tables. But thanks for that insight to other alternatives.
  13. Ryan you said that you are on MAMP, could this make a difference in whether or not processwire deletes the install files? I tried setting the permission to 777 on a Ubuntu 12.04 machine, but did not delete when the installer was supposed to. So I am curious if the machine makes a difference. --edit-- As per a brainwave I tried chown www-data and that did not solve the issue.
  14. I will argue that point, as page table, tough awesome and logical for a developer seems to have some complexity that a user, unfamiliar with processwire, might find complex. Although it can replace a repeater it is not always the most logical way to work. For what if the content is specific to that page or section of the page. It depends on the situation whether repeaters are good to use, other methods might be better for a dev, but look complex for a user. a kind of, "You want to keep your bananas away from your apples, or the apples might go down faster. " situation. After all CMS is supposed to be for a end user when it reaches them not for the dev. So their perspective is primary, especially since our paradigm is that of a super user.
  15. Does not solve the issue, I have a workaround. Clearly this adventure was as a result of a lack of knowledge. As part of the splution I will explain what I have done and what the workaround was. LostKobrakai has stated: This means that you should avoid inputfields in repeaters as far as I can gather. The use case Lets say I have a template that I call resources, this page has some basic content and also a repeater. The repeater Item can either be used for navigation to an internal page or a file that is uploaded and downloaded. So we want the user to lose or gain functionality based on what he or she wants the repeater to do. For instance we want page to show only if file is blank and we also want file to show only if page is blank. So one or the other will be used and not both. The broken solution Adding this here for the sake of completeness. I originally thought I would solve this issue by adding two checkbox fields to the repeater and have page and file hidden if their checkbox is not selected. Even more have the checkbox that shows the other field hide when the first checkbox is selected. I did this by using the 'hide only if' functionality found in processwire on the input tab of each field. There I simply added a condition 'checkbox=0' for the checkboxes and 'checkbox=1' for the field relating to the specific checkbox. Though this is a good solution that looks nice in admin. Its the very same thing that breaks repeaters. I think it might have been the page field having a condition. A work around My solution to this is to simply add the page and file field. Have the file field hide when page is populated (this does not work on page selector fields). Now have my php output the page field markup if it has an item else ill output the file field markup.
  16. Finally! I reproduced it by rebuilding my current projects admin, its something to do with conditional show and checkboxes. Will report asap.
  17. After much attempting to break the repeaters I could not get it to break. I am not sure why as I followed the same steps. I will keep trying and reply to the post when I have had success.
  18. Going to start work on this about now-ish, I will create a github repo, with db exports est, so there will be no chance of the site profile exporter solving the issue, the workflow will therefore be, clone github repo, reference your vhosts (if used) and import the db dump. Good luck . --edit add github repo link-- https://github.com/dewald-laubscher/processwire --edit work in progress-- Structure to do this setup, now to move on to breaking stuff
  19. Okay, I think I am going to try and do something: - Make repeatable steps that wont fail, (for me at least) - Clearly define these steps at every point and turn - As suggested by one of my mentors I will also create a diff of the db dump before it breaks and after it breaks at the point I find it breaking. eta Monday 6th 17h00 GMT+2. For now here is my details of the machine I am working on. - Ubuntu 12.04 (I know I'll update asap...) - Apache version 2.2.22 - php 5.4.39-1+deb.sury.org~precise+2 (cli) - mysql Ver 14.14 Distrib 5.5.41, for debian-linux-gnu (x86_64) using readline 6.2 - PW version 2.5 - as said I did this with a master branch clean install I really would like to get to the bottom of this, helping you guys where I can, I am however swamped at current time, but will try my best to help as much as I can, please understand.
  20. Here is the site profile that broke the repeaters. Steps taken - Install - add repeater item - set up file and page item to work, use max 1 and null if empty, set template | parent page - add page, title and file to repeater - add repeater to a template - add items to repeater - add an image to the repeater, be sure to set up 1 max and null if empty - add module ProcessRedirects - Make changes to repeater by adding another field, I added a checkbox that when checked makes a field available - add module MarkupSitemapXML - Nothing broke yet - fiddle with the repeater template setup - hmmmm add MarkupSimple navigation - add a repeater_2 field - add fields in repeater one - add repeater to same page - broken repeaters - remove MarkupSimpleNavigation - does not fix the issue - add markup simple navigation - make a site export Here we are. site-BreakRepeaters.zip
  21. Modules installed are ProcessRedirects, MarkupSImpleNavigation, MarkupSitemapXml. After extensive testing I reproduced this by adding another repeater to the same page that already has another repeater. Disabling said modules does not fix the issue. I introduced the error after finally installing MarkupSimpleNavigation (the last of the modules) and adding a second repeater with the same fields to the same page. I will make a site profile export, but don't see the need. But here is a headsup on how this was done.
  22. I can upload a new pdf in the place of the old one, but i can not delete the existing one, having an empty field. Field is not required. No js errors. -- edit introduce -- I want to emphasize that please follow the post instructions taking in to account the clarifying description
  23. Hi @LostKobrakai, Thanks for the swift reply. I am getting no errors in admin. I am using the latest version of ProcessWire (free) as found on github master branch. When I delete a file after the repeater update I get this messages at the top, http://snag.gy/CyTUr.jpg Did you follow my instructions carefully? -- Edit introduce spec -- starting point - repeater contains field - repeater is used in a template - repeater has content - lets add a file field with content to be sure introduction of error can be done by - making an update to repeater field by adding new fields Test If error works - delete file field content - save page -- Edit end -- I am using a file field in my live version of this issue, this might be where the problem starts as you said you needed an image to reproduce the issue. I can resolve it, and have in the past by redoing everything in the field with my updates.
  24. If you have a repeater that is already being used, in a template, and containing content, ie $repeater |_ body (this can be any field) |_ image (this can be any field) And you add a filed to said repeater, $repeater |_ body (this can be any field) |_ image (this can be any field) |_ summary (this can be any field) When you want to update existing instances of that repeater item the it does not want to save that repeater field, I cant delete upload or add new items to this repeater. Is this a bug? Do you need more info? Should I make an issue?
  • Create New...