Jump to content

Soma

Moderators
  • Posts

    6,798
  • Joined

  • Last visited

  • Days Won

    158

Everything posted by Soma

  1. Thanks but I am very happy with sublime text 2.
  2. If you call it in template with $modules->get(..) ? It will get installed (if it's listed but not installed yet) . Would be very surprized if not. Edit: I removed the part in the documentation as it is a general note about ProcessWire modules I think only could be confusing. I tried to rewrite it to mention more details and I screwed
  3. Dont need to turn of slash trailing. Just add the slash to the return url.
  4. Yes those are just properties I've set to change the two fields and templates more quickly. It could be done differently. Also there could be some configuration with 2 dimenstional array to map many fields and templates and the mapping part could also be a little more abstract, but it's nothing too serious and just a quick straight forward proof of concept that for now works. I'm not sure how mapping could be done better scaleable and reusable, but sure this would take some good implementation rethinking. A dedicated field approach extending page field, that may even adds another table to do it. All just hot air for now. Edit: You use set(key,value) So it would be $this->set("tpl_team","team"); // template $this->set("users_select","team_mitglied"); // its page field $this->set("tpl_user","mitglied");//template $this->set("teams_select","mitglied_team");// its page field and this may also work if you peferer $this->tpl_team = "team"; // template $this->users_select = "team_mitglied"; // its page field $this->tpl_user = "mitglied"; //template $this->teams_select = "mitglied_team";// its page field
  5. Yeah I tested code and found some issues. I create a code that works. Study how it's done and the changes. $page needs to be retrieved different, and it had some logik faults, it needs to add or remove $page, not $s_team... Biggest issue with save hooks is that when you save a page in the module it will get called endless recursive. To prevent this we save a skipme to the pages saved on runtime to it does skip them. Also added some additional checks for if there's no pages selected at all, to remove all references. Here a new working proof of concept module: https://gist.github.com/4335296
  6. arjen is right. You would load a module with $modules->get("name") in templates when needed and have it ready. You could also have another Wire module that provides template variables and use the Process module only for backend interface. Then load the Wire module if you need it in there aswell. Either way, I think it's best to make process module not autoload and load module when needed in front-end, but it's up to you.
  7. Protip: Leave the ending php tag out and it wont happen again.
  8. I get shiver seeing this code, no offence onjegolders, but code like this maybe better put on gist or any other code snippet site. But it's an nice example. However if you want to dive more into pressing the jus out of PW you might look at some examples building simple forms with API in the front end. I built some front-end tools like this and enjoy it. http://processwire.c...orms-using-api/ Also wanted to mention you'd better of searching with google on processwire.com "site:processwire.com keyword" Also here's some thread about user generated content I posted an example of front-end image upload. http://processwire.c...ges/#entry20835 And there's actually many ways to archive the thing, so might want to first play around and dive around a little.
  9. if($field != "InputfieldTextarea") return; I'm not completely getting it about derivates. But of course I wasn't thinking about all consequences and what would be best way to go. But Ryan think makes some valid points here. Extending InputfieldText or Textarea and just create a field for having counters versus a module only with options to chose which text field has the counter might work, but would need to also be able to make counter settings for each individual. Damn so many options it's hard to see through
  10. ProcessWire core is a framework. And on top of that built a CMS I think it goes this far /wire/core - is the framework /wire/modules /wire/admin-templates - is the admin/cms built on top of the core /site/ - your site with possibilities to extend admin and cms functionality You could start now and build your own CMS basing on core.
  11. Not sure what to think about showing a page that in fact isnt on this url and what would be the right setup and header so no problems with seo occurs. Is there any other cms doing this?
  12. Autoload works with process modules but it will load js script before jquery then at least that i think was my experience.
  13. I see an autoload there. Process modules don't need that as it is an admin page and dont need to be loaded on every request. Remove autoload, reinstall it and it should work.
  14. "exp" in links will break in IP forum do to bad coding.
  15. This error is usually when you script is included before jquery core. Have a look at the source code. However, this should not happen if it's a process module. class MyModue extend Process implements Module { Is it? Then it should not be autoload. Then the init() looks like this? public function init(){ parent::init(); } Or post you whole module, this would be far easier to help sort it out.
  16. If you name you js same as module and add parent:init(); to the init() of the processmodule it loads it automatic. An example would be any Process edit module like ProcessPageEdit which has tabs. There's a ProcessPageEdit.js // instantiate the WireTabs $p.WireTabs({ items: $("#ProcessPageEdit > .Inputfields > .InputfieldWrapper, #ProcessPageEdit > .Inputfields .InputfieldFieldsetTabOpen"), id: 'PageEditTabs', skipRememberTabIDs: ['ProcessPageEditDelete'] });
  17. I can reproduce the ./ but pw doesnt insert such links anyway. But not the others you mention. It replaces only urls on textarealangauge field. No problem here with regular textarea.
  18. Ok the while is over. I just committed an update to 1.1.5 to support alternative markup for specified templates. https://github.com/s...default-options Added 3 new options: "xtemplate" => "folder|placeholder", // specify one or more templates "xitem_tpl" => "<span>{title}</span>", // default markup for page with this template "xitem_current_tpl" => "<span>{title}</span>" echo $nav->render(array( 'max_levels'=>2, 'selector'=>"limit=10", 'xtemplates' => 'placeholder|folder' ));
  19. I thought about this for some time and think having option to have list of templates and the code it would spit out for those pages would be good. "x_templates" => "folder|placeholder" "x_item_tpl" => "<span %s>{title}</span>"; "x_item_current_tpl" => "<span %s>{title}</span>";
  20. Np. Just noticed some major fault. in modules it's not $pages but wire("pages")->find() or simply $this->pages->find(). Will correct again
  21. The admin topnav is simple frontend code in the admin template default.php, that's why you can't make it a hook That's why I could implement such nice dropdown menu and module menu in teflon.
  22. That's very nice thinking of me! Some are waiting for this: Well let me think , by "admin bar", you mean the one on the front-end by apeisa? This already has a add new to the current parent, if the template family setting is set to only a allow one template. Lot's of possibilities and ways to implement such features, that's why I tend to think this is up to the developer to create shortcuts and helpers in the admin from project to project where it fits. But I understand that some "system" in the admin to add such things by clicking rather than coding would be nice to have. Since it's hard to hook into the admin menu other than creating a custom admin page. I think a nice way to add such features is create a custom admin page much like mademyday is doing. Another would be to add a "Tools" admin page with child pages. And create a process module that reads a text field of "url", which is added to the admin template. This process just redirect to the link. So you could use these admin pages to create shortcuts in the admin menu. "/pages/add/?parent_id=1001". Well at least some food. I think it would work well.
×
×
  • Create New...