Jump to content

Soma

Moderators
  • Posts

    6,807
  • Joined

  • Last visited

  • Days Won

    159

Everything posted by Soma

  1. Yes you're right. The file upload doesn't work for the reason you found out in InputfieldFile.js. My code example works also with the change you proposed to get the page edit admin url. What I do is add this code to the form too to render a hidden id field. $form = $modules->get("InputfieldForm"); $form->method = 'post'; $form->action = "./"; $field = $modules->get("InputfieldHidden"); $field->attr("name","id"); $field->value = $editpage->id; $form->add($field); Together with your change it now works. I think that change would be ok to make that it can be used in such cases. I'm not sure if I back then haven't really tried fiel uploads but I thought it was working. Maybe some changes in core or my memory is dusty. Either way and apart from all that, just because you can doesn't mean you should - regarding all the details and security should be first priority when moving backend functionality to front end. It's not planned/meant to be used like this originally but surely possible if you include all files and configs. But I'm thinking depending on how and where and for what reason you implement it you should be careful and only let really trusted users have access anway. Even myself am not aware of what could go wrong, but I'm sure Ryan could speak a word on that subject. I'm not sure what you're building and it seems to me you're rebuilding the backend on front-end. Without knowing any details and I'm sure you got your reasons, why not just use the backend admin? Or what doesn't the backend provide that you want to create editing on front-end? I'm also curious to hear what Ryan thinks about all this.
  2. alan, that link goes to the master and not dev. See my link above. The controller.php is in there, make sure you have put folder templates-admin into site folder and all files are copied.
  3. It's already there in the first example...
  4. Theres a documentation directly in core. Just look at what options a fieldtype has by looking at the code in wire modules.
  5. Sorry OT, do you already use my Teflon 2.0 admin theme?
  6. $f = new Field(); $f->type = $this->modules->get("FieldtypePage"); $f->name = 'mypageselect'; $f->label = 'Select Page'; $f->derefAsPage = FieldtypePage::derefAsPageOrNullPage; $f->inputfield = 'InputfieldPageListSelect'; $f->save(); or $f->derefAsPage = FieldtypePage::derefAsPageArray; $f->inputfield = 'InputfieldAsmSelect'; etc
  7. I'm working on update of this theme to 2.0. There's so many tweaks and changes, little detail fixed that I can't list them all anymore. Mainly it is to remove some noise and make it more clean. Maybe I'm going insane, but after working on it so long and back and forth I'm not even sure anymore this all is really an improvement to the previous (which is still nice). But I just don't know what to do now. - Biggest change is I added new font from google font. - Removed all rounded corners - Changed some colors of buttons - Removed headers and some shadows and some lines - Tweaked file upload button with ui button and input - Added css for fieldset columns that will hide it's header label and give nice content, sidebar columns: You can create them using FieldSetOpen field and use some of those names: fieldset_content fieldset_sidebar or column(n) 1-6 - Tweaked page tree to show actions by hovering the page - Removed page tree icons added by the theme. You now can use the excellent TemplateDecorator module by mindplay.dk to add icons per template. https://github.com/mindplay-dk/TemplateDecorator. It required latest PW dev version and php 5.3. If you need a legacy version, you can ask me as I created one for myself. This version requires latest PW dev. I created a dev branch so you can try and test. So far I only tested Chrome, FF and Safari. So if there's any IE8+ users, maybe there's something not working. Maybe I forgot something, but thats it. Here some screens. Download dev: https://github.com/somatonic/teflon-admin-theme-pw2/tree/dev Thanks.
  8. Maybe this example will help you? http://processwire.com/talk/topic/2089-create-simple-forms-using-api/?p=21226
  9. I think PW has the config js outputed in head where also the admin path is. I created frontend form example which work with all fields also image upload. Will look for it later maybe its something different.
  10. Or you can save a temp value zo the page when saving like $page->skip = 1 and check for that before in the beginning of the hook.
  11. OMG my name is in there!
  12. Soma

    Responsive Images

    Responsive images is what makes them behave inside the layout once the html, css and images are loaded, so all this max-width etc. Adaptive images is serving a resolution before it's loaded to fit screen size or bandwidth or whatever to not load unnecessary big images that wouldn't be needed for mobile for example. Oliver's solution is about adaptive images as far as I understand. Though yes it's arguably that the term can mean the same thing, but I thought it's how we make the difference in case of image delivery. Wilcox's solution doesn't require that much as you say, it's .htaccess with a cache folder, a script in head and you're done, no data-attributes required. I've used it and am quite happy with it. But will take a look at yet another solution if I got time. Thanks for sharing Oliver.
  13. 1. More complex validation can be done without fixing PHP code? (something like only alphabetical text allowed before the dot and only numbers are allowed after the dot) There's html5 input field patterns validation coming in 2.3 or it's already there if you use current dev. Field setup under "input" tab "Pattern". 2. Make the field set as unique so that no duplication values are not allowed? There's a double no in that sentence. So I guess you didn't mean it. There's no support for this by now. But you can easily hook the page save and add your own validation and checks. 3. two or more fields are related to each other and make them as one field? Not sure what that means. But maybe this is what you're looking for. http://modules.processwire.com/modules/fieldtype-concat/ 4. A field can be filled automatically such as 'last logged in time', 'user index number', 'posting numbers', and so on. Again not sure what you mean by automaticly filled. It's all possible through hooks. It also depends a lot what you're trying to do. If you build frontend users, or just for backend. For frontend you would build the user profile and all it's handling yourself anyway so it's all possible and only your imagination and skills is the limit. It's like giving someone a toolbox and ask can you build a wooden box?
  14. Yes they aren't listed. I don't know if that's normal, would have to wait for Ryan.
  15. Soma

    Responsive Images

    You all seem to mix up responsive layout with adaptive images. This is about adaptive images, which is something different.
  16. It's simple but you have to take care of it, and best is when you render them out, mostly in a foreach loop. This is perfectly fine and requires only 1 line at the end. Nerd alert... What I meant was going further and do it literally add a new template var that is always the current page viewed. In a autoload module, take HelloWorld.module as example you do the init() like this. public function init() { // no need to hook in admin area, we only need it on frontend if(strpos( "/" . $this->input->get("it"), $this->config->urls->admin) !== FALSE) return; // hook view process when ready to get current page $this->addHookAfter('ProcessPageView::ready', $this, 'getMother'); } /** * get current page and create a new template variable */ public function getMother($event) { $page = $this->getFuel('page'); $this->setFuel("motherpage", $page); } Now anywhere in your template code you could use $motherpage or wire("motherpage") Nerd alert end. (cool now the forum editor has proper code indentation but instead we get lots of extra lines and mess-ups more than before and takes more works posting code blocks :/ ...)
  17. How do you load the TinyMCE? And Do you use $config->scripts and $config->styles loop to ouput scripts and css of loaded modules?
  18. No there isnt with this approach. But maybe its possible with a hook to page view or render. Too busy atm though.
  19. Theres pregnant repeaters?
  20. Welcome. Well I can't sleep since two years because of PW There's a concencate module by Ryan that would allow to combine fields to a runtime value. You can open title field and make in unglobal and remove it from the template you don't need. PW requires only a "name" which is like an id. Have fun and sleep well!
  21. No I haven't . Give them all a separate login, problem solved. You don't want to have various people with same login in a CMS generally and working simultaneously from same place. Anyway I don't see a simple way to implement this. I'm also not sure if it would work for frontend as you would have to take care of it anyway, but maybe my module helps you getting started.
  22. Ok I think I know what you mean. Current $page isn't available in your function when called from a page you render with $object->render() right? Since it's hard coded into function with wire("page") you could also pass it with an argument. My last 4 function examples showed this. Without reading the whole book here... This has come up once or twice in the forums. Ryan showed an easy solution but can't remember exactly as there's some different cases and ways. Ok here it goes. From the you load the widget pages you di something like this to save the current page temporarely: $item = $pages->get("/item/"); // some widget page $item->calledfrom = $page; // save current page from where widget is rendered echo $item->render(); Now in the template of the item you simply can use calledfrom and give it to the function echo "called from page: ". $page->calledfrom->title; // show the title of the page where this is rendered. echo $page->title; echo $page->body; // call function with current page argument myFunction($page->calledfrom); Guys I'm getting slow... but three times holds longer.
  23. Do you mean in the source of the js or html? Does it appear when inspecting code with console webdeveloper but not when viewing static html source?
  24. I also would hinted at some module that hooks some function. What you mean with Simple Tree Menu Module? Do you mean MarkupSimpleNavigation? Well it's not doing anything like that anyway. Well no module.... you got 11 jquery modules in there I wouldn't be surprized if maybe any of that would produce it? Anyway, start removing things until it's gone.
  25. Great to hear it's working. Sorry I haven't been working on it much lately. But it's working roughly so far. I'm not sure thinking about this two modules working together, I think it doesn't go that well as I thought. I don't see what the benefit of it would be to be honest. My module let's you manage campaigns and choose a page to submit. These pages are normal pages you build under some parent and set the page parent in the module config. I'll have to take a look again at it but currently are busy with other stuff.
×
×
  • Create New...