Jump to content

Nelson

Members
  • Posts

    17
  • Joined

  • Last visited

Everything posted by Nelson

  1. The thing is I was trying to use a Process module for setting up a custom page and I can create a template for it but then I'm unable to link my Process module to it because the process field it's not available for new templates.
  2. Is it possible to manipulate the fieldgroup of an template before it's saved? Like so: public function addProcessField(HookEvent $event) { $template = $event->object; $template->fields->add('process'); }
  3. Hi there, I'm trying to create a page like this but I've still not figured how would be the best way to store the data of a custom admin page. For example, a page with only a email field, how you would setup this? Custom table? I'm using your https://github.com/r...gn/ProcessHello module as base for this. Sorry for breaking in your thread diogo.
  4. Thank you Exceptionz, I really appreciate your help! We've decided to keep it this way for now, although, if this proves to be a much of an hassle in the future, maybe then, we'll try to contact them again. Thank you very much!
  5. Hi, thanks for the replies! I've contacted the host support and asked if there's a possibility of adding an exception to the security rules so those requests wouldn't be blocked. They responded that they can disable the protection software, ModSec Rules, to our user account. I know nothing about this software or what are the implications of disabling this protection but don't think it would be worth the risk for just one change in our code base.
  6. Hello everyone, I've run into a issue with the way Processwire renames resized files in our company host provider. Basically, this pattern: myfile.0x120.png, conflicts with their security policy which they tag with the following classification: [severity "CRITICAL"] [tag "WEB_ATTACK/SQL_INJECTION"] So, somehow, when requesting a file with the pattern above, the server mistakes it for a malicious request and throws a 403 Forbidden Access. The quickest solution I've found for this was to dive into the Pageimage::size method and replace the characters used in the resized file name. Instead of using double periods in the name file, I've replaced everything with the '-' (hyphen) character and now looks like this: myfile-0-120.png. $basename .= '-' . $width . '-' . $height . "." . $this->ext(); // i.e. myfile-100-100.jpg It's not the prettiest pattern and I liked the older one better but that's secondary. The main issue here is that this change is basically an hack and feels dirty changing core methods, but it was the quickest solution I've thought of. What are your feelings on this?
  7. Hi Ryan! Thank you for your reply, Sorry for not replying till now, I've been a bit busy trying to work this out and it seems I'm finally getting the hang of this. Basically I'm building a module based in your FormTemplateProcessor but without using the InputfieldPage to store the fields. Instead I'm storing them in array of Inputfield instances. This gives me the ability to use any type of field which solves my first issue, it also validates which is sweet! But I noticed something, after a Form is processed the fields seem to lose their original type somehow. I think this is because I'm not storing the fields inside a Page instance. This was only noticeable inside the sendMail method when checking for a InputfieldEmail instance. It's not really an issue, just something I noticed. Thank you very much for your help!
  8. Thank you for the reply Ryan. Do you think If I fully create the form (template) dynamically with the API instead of using the prebuilt form I have now, will I be able to use the validation provided by the FormTemplateProcessor Module? Only if there was a way to somehow push this field into the template provided to the FormTemplateProcessor module...
  9. Hi there, Here I come again with, yet another tricky question, sorry. I would like to know if it's possible (using a Select output in the Page Inputfield) to display the Pages as optgroup tags and the children as options tags? I'll explain my goal. At our company we offer a range of courses (the pages) and each course has many editions (the children) along the year. At the moment I'm converting to Processwire (with the FormTemplateProcessor Module) a registration form that acts as main gateway for people who want to participate in our courses. The way people select which course/edition they to participate in, is by using a drop down list like this: <select name="Courses" id="Courses"> <optgroup label="Course"> <option value="Course - Edition A">Edition A</option> <option value="Course - Edition B">Edition B</option> </optgroup> </select> I'm asking this because I'd like to use the FormTemplateProcessor Module for validation and sanitization purposes. Thank you very much, Nelson
  10. Thank you Ryan. I made a workaround (hardcoded, it was just one url for a menu) for this but it's good to know for the next time I need it. But I'm curious, why it's restricted this way? It's a security issue?
  11. I'm sorry, maybe I didn't explained myself well enough. What I mean is, inside the backoffice I have a field of the type URL that is there if an alternative url is needed for some specific page. And what I'm trying to do in that field, is to insert urls that may contain GET parameters or url hashes. For example: /somepage/?param=stuff or /somepage/#somehash But when I tried to insert urls like those, the field says that the url inserted is invalid.
  12. Hello everyone, I'm using the URL fieldtype to provide an alternative url for some pages but now I need the ability to use, like the title says, GET parameters or url hashes. It seems that is unsupported right now, so I would like to ask you good fellows if you have been in the same situation and if there's a solution to this? Thank you very much.
  13. Thanks Diogo and Soma for your replies. The reason I want to do this on the fly it's because I don't wanna add another level of navigation in the backend to pages that already have 2 sub-levels inside. It's for the sake of simplicity for the users that are going to manage the site, those pages need to be immediately visible and accessible. Unless there's a way to keep the placeholder always open in the backend. Thank you. Edit: I've done it! It's not the most beautiful code and I think it can be improved but for now does the job. I can share if anyone's interested. Basically I extract the pages I need from the list, store them in array, then inject them back in the list. In the building function I do a check for type and if it's a array it builds another level.
  14. Hello everyone, I'm trying to make a custom menu where I need to create a placeholder (drop down) for specific pages but I would like to make this dynamic, so I wouldn't need to edit the navigation file everytime there's a change. Basically something like this: Home Page A Page B Page C Page D Page E Page F Page G To this: Home Page A Page B Placeholder (not a real page) |----Page C |----Page D |----Page E |----Page F Page G I can acces the specific pages through a hidden field, I check for its existence. I know it's possible to create a new Page dynamically but can you add children to it without saving it? I could go for recursion but then almost every other page has children but I don't need them to show up in the menu. I may be complicating something but I don't know, so any help is welcomed! Thank you.
  15. Hi ryan, Here's the error message of the bugged module: Parse Error syntax error, unexpected T_VARIABLE (line 55 of /opt/lampp/htdocs/cultideias_site/site/modules/TemplateTwig/TemplateTwig.module) This error message was shown because you are logged in as a Superuser. Error has been logged. This error is due to a missing semicolon in the end of line 53 of the TemplateTwig.module. The theme I was using at the time of the error is the Futura theme but the problem maintains with any theme I tried after. Even if I copy the default theme from the wire folder. Here's a screenshot: http://img254.images...ermissionsp.png Thank you, Nelson Edit: Well, I found out what was causing the problem. Today I had been fiddling with the .htaccess file and changed this line RewriteCond %{REQUEST_URI} (^|/)site-default/ to RewriteCond %{REQUEST_URI} (^|/)site/ because, well I thought it was related to the site folder and it really was but I ended making a mess of it. Apache rules still look like italian to me, I can read it but can't make sense of it. Thank you for your help and sorry for the trouble.
  16. Hi there, My first post here on the forums. I'm having some trouble with the admin themes, the styles and scripts files stopped loading all of the sudden and are giving permission (code 403) errors. Everything was doing fine before I tried to install a module. When refreshing the module page in the admin panel, a error message appeared, related to another module, I removed the bugged module but with no change (the error message disappeared tough). I've double checked the permissions but I'm unable to find the cause of this problem. If I remove the templates-admin from the site folder the default theme loads correctly Any help will be much appreciated! Thanks, Nelson
  17. Hi again @GroovesharkHelp! That did the trick! Thank you very much! :D

×
×
  • Create New...