Jump to content

kongondo

PW-Moderators
  • Posts

    7,479
  • Joined

  • Last visited

  • Days Won

    146

Everything posted by kongondo

  1. Thanks for the info. The above is just a prototype - no styling has been applied yet . To clarify, I don't need an inputfield - just some temporary inputs in a table to send additional data for each selected page in the AsmSelect. The data will be saved elsewhere..In addition, I will not need the items to be draggable nor sortable - so I will remove those capabilities.
  2. I'm not double posting . I have been having a conversation with @netcarver about this but thought to expand the discussion. In relation to the module I am working on MenuBuilder and this comment, I need to modify the output of AsmSelect. Its ___render() method is hookable but the method does not have arguments so wondering whether in such a case, the best way is to use a Hook that replaces the whole method? Specifically, what I need to replace in the method is only one line - the one that loads the jquery.asmselect.js. $this->config->scripts->add($this->config->urls->$class . "asmselect/jquery.asmselect.js?v=$ver"); AsmSelect shows selected pages in a <span>Item Label</span>. So, instead of this: I want to have something like this (still rough around the edges!): In order to do that, I have needed to modify the jquery.asmselect.js plus modify the CSS a bit. Alternatively, I tried to remove the file using config->scripts->remove() and adding my modified one but that didn't work. The original jsquery.asmselect.js script was still loaded. I tried this in my Process modules execute() method and executeEdit() and just in case init(). I appreciate any thoughts on this, including alternatives, e.g. just manipulating the dynamically created DOM (the <span>Item Label</span> is dynamically created by jquery.asmselect.js) using jQuery. Also, I think extending the module in this case is an overkill - just to replace one line! Thanks! Edit: Clarification based on comment below. I am not after an inputfield per se. The data in the extra inputs I want will be stored elsewhere
  3. Almost done; mainly waiting for an answer about this: https://processwire.com/talk/topic/7870-asmselect-pagefield-modify-selected-options-order-in-select-dropdown/?p=88609
  4. Hi Steve, Would you be able to share some code how you went about this? Thanks. I am trying to add extra html inputs to the <span></span> that wrap selected asmSelect values. However, not sure this would work in an asmSelect that is called as an input in a Process Module? Have never really understood Hooks comprehensively... Edit Or maybe I should just extend the InputfieldAsmSelectmodule and use my modified jquery.asmselect.js...Any other ideas welcome, thanks.. Edit 2: No, I think hooking into the Class is better/cleaner in this instance..
  5. OK, we are on. I have resumed work on this and taken a newish approach. Hope to post something by end of play tomorrow...
  6. @Mats, Thanks for this. Please consider submitting your module to the modules directory as well as creating a new (support) thread for it
  7. @ridgedale, Welcome to PW and the forums. Multiple Blogs: This issue has been raised a couple of times but I haven't yet resolved how to best implement such a feature: https://processwire.com/talk/topic/7403-module-blog/?p=63775 https://processwire.com/talk/topic/7403-module-blog/?p=63878 https://processwire.com/talk/topic/7403-module-blog/?p=66524 https://processwire.com/talk/topic/7403-module-blog/?p=66528 At the moment it is not possible to have such a split. I am wondering whether this can be achieved by simply adding some field on a post's template to assign it to a particular field...hmm... $post-date-time Change your date's input/output format in the field 'blog_date' $post-summary You can have a post summary by using renderPosts($posts, true) - see the Blog documentation. Alternatively, you can create your own summary field and use that. Blog Styles Purely user preferences...
  8. The following works for me. You first have to enable 'Do you want to manage view and edit access.....' in the Access tab when editing that template. //$t = $page->template;//if on this page $t = $templates->get("skyscraper"); //echo $t->name . '<br>';//confirm we are looking at the right template $tRoles = $t->getRoles(); foreach ($tRoles as $r) { echo $r->name . '<br>'; } getRoles() seem only to work if 'view pages' permission is enabled on that template for a role.
  9. If only Qurus could tell us 'what is not working'....For all we know, this could be a javascript issue. What Diogo said - the next/prev in those demos are all being controlled client-side....from what I can tell...
  10. Yes...as long as $image has been defined somewhere....otherwise it will throw an error (undefined variable $image), no?
  11. You said you were having issues...what issues are those?
  12. It seems different? This is what Qurus has...but of course, I don't know if anything before that has changed <?php echo $page->images->getPrev($image)->url; ?>
  13. As it states in the methods' docs that Diogo linked to: You items need to be in a WireArray first...
  14. These look very nice, thanks for sharing and the write-up! Please add some links to the sites in your post, thanks.
  15. Maybe document how you made this + solved your issue to help the next guy
  16. Yep, this is what I do. Make sure to tell it to generate docs from .module files as well, not just .php
  17. /wire/modules/Fieldtype/ /wire/modules/Inputfield/
  18. No, sorry...I haven't. I didn't really think there would be interest....Hmm...I'll make a decision this week. If I take it up again I would have to change a few things now that I am a little bit wiser...We'll see.
  19. Don't know much about this but it seems there's one or two issues to consider here. First, the issue about making data entry as easy as possible for the client. They don't want to be 'typing' all those aliases with every page edit. Secondly, there's the main issue - how to create those aliases. In respect of the latter issue, the 'master name' will have to be related to its aliases in one way or another. A common way of relating things in ProcessWire (and you probably know this) is to use page fields. These are related to the first issue in that depending on the level of complexity, page field input such as auto-complete or asmSelect (plus the new tag select) can be quite handy. Is there a reason why you can't use such a system? Will the aliases be manually entered or imported into your (or maybe read from a custom) database? For some really powerful searching, there is also the module Elastic Search. Maybe that could help? See this for instance. I haven't use the module (nor the tool it implements) so can't comment much further. Anyway, these are just initial thoughts...
  20. You cannot upload images directly like that...See the message in the 'green' info bar. Add an image field to the template that page is using then add an image to it to be able to select it in the RTE. Alternatively, see the text below the 'green' info bar about uploading images from other pages...
  21. Nope..you can call it anything you want (as long as it is a valid PHP variable name) - $b, $myBlog, $thoughts, $blahBlah.... RE comments, maybe paste your template code in pastebin and I'll have a look if I can find some time....
  22. @Pierre - I am moving this to Off Topic dev...
  23. The 'keyword' to search for is PHP Object Oriented Programming (OOP). Find a good tutorial about OOP Classes, Objects, Methods (functions) and Properties (variables). A ProcessWire $page is an 'instance', i.e. and Object of the Class Page (see /wire/core/Page.php). In OOP, you can call/access the members of a Class (Methods and Properties) by 'creating' an instance/Object of that Class. When you use the variable $page, behind the scenes you are actually creating an instance of the class, i.e. $p = new Page(); You can create as many Objects of that Class as you want. The key here is that they will all be tracked differently by PHP - they are independent Objects of the same Class. So, in your case although your wire('pages')->get($pageid) were, from a database point of view, all grabbing the same page, from a OOP point of view, they were all different Objects, tracked differently, i.e. you were doing $x = new Page(), $y = new Page(), etc. Also, this should not work wire('pages')->get($pageid)->of(false); - since you need to get the page first (I could be wrong here) - and even if it did, it was a 'different' Object to the $page in the next line wire('pages')->get($pageid)->$pagefield->deleteAll(); So, in order to tell PHP that you were talking about a specific/single Object, we assign the $page we are after to the variable $p (behind the scenes $p = new Page(); - but not just any Page, but one with the id $p->id=1234 (from the wire('pages')->get(1234). Written late, I could have missed something but hope this makes sense....
×
×
  • Create New...