Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/18/2012 in all areas

  1. I've put together a Process module skeleton that may be good as a starting point for any Process module. It is well commented and fully functional as a demonstration. It also includes instructions on what to do with it when using it as a starting point for another module: http://modules.proce.../process-hello/ I'm planning to make more skeleton modules to cover all the bases.
    2 points
  2. One other thing about this module that's maybe interesting from a module development standpoint: It installs a page (/service-pages/), and the template for that page loads and runs the ServicePages module when it is viewed. So it installs the means to run itself, and it's not autoload. I might be wrong, but can't think of another module that does this, and maybe it's a good pattern. At least, I thought it was fun when building it. I've been thinking about building a module starter kit that includes skeletons for various types of modules and install/uninstall patterns (ready to build from), and this type of pattern would be one among a few others.
    2 points
  3. Here's a start on creating modules documentation. I still need to write a whole section on hooks, but it's fairly complete in other areas. Please feel free to edit/add to this. http://wiki.processwire.com/index.php/Module_Creation
    2 points
  4. I needed a field that would allow me to select one or more templates, very much like the Page Select. So I created a module that does just that! I based it off of Ryan's FieldtypeModules because the functionality is quite similar. You can also define which templates are selectable by the asmselect field. Hope this helps someone that wants to do the same thing! FieldtypeTemplates.module
    1 point
  5. Awhile back, I made an Ajax API for querying pages in the admin via the ProcessPageSearch module. It is used by [for example] the PageAutocomplete Inputfield. I thought this capability would be useful on the front-end too, so this module brings it to the front-end as a page in your site that you can put wherever you want to. The way you use it is exactly the same as the one in ProcessPageSearch, but this one is a little more strict, given that it's publicly available on the front-end. By "more strict" I mean that you have to define what you want to allow in terms of input and output in the module's configuration. The web service takes it's query from GET variables in the URL and returns results in JSON format. It installs a page called /service-pages/ in your site, and you are welcome to move that page wherever you want. Here is the official page at modules.processwire.com: http://modules.processwire.com/modules/service-pages/ Once installed, you should view the /service-pages/ page that it installs because it outputs detailed instructions and examples on how to use it in your own projects. But here's a few excerpts from what you'll find on that instructions page: Input The /service-pages/ page can be queried with GET variables in the URL to return JSON-format results. The query string should follow a ProcessWire selector format ([field][operator][value]), but modified a bit for use in a URL query string. Here are a few format examples: Specify a single value: ?field=value Specify multiple fields and values to match: ?field1=value1&field2=value2&field3=value3 Specify multiple fields where at least one must match the value. Note use of "," rather than "|", something we had to settle for to make it work as a URL key: ?field1,field2,field3=value Specify one field with multiple possible values (it's fine to use "|" as a separator here): ?field=value1|value2|value3 Note that unlike regular ProcessWire selectors, multiple field=value sets are split with an ampersand "&" rather than a comma ",". Allowed Values The allowed values for field are set with the module configuration. You may also specify the following modifier keyword=value pairs: sort=[field] (Specify field name to sort results by) debug=1 (Enables debug mode producing human readable output) limit=[n] (Specify the max number of pages to return) start=[n] (Specify the result number to start with) include=hidden (Include pages that are 'hidden') Allowed operators The operator demonstrated by the "=" sign in the examples above may be replaced with any of the following operators in the query string: = Equal to != Not equal to < Less than > Greater than <= Less than or equal to >= Greater than or equal to *= Contains the exact word or phrase ~= Contains all the words %= Contains the exact word or phrase (using slower SQL LIKE) ^= Contains the exact word or phrase at the beginning of the field $= Contains the exact word or phrase at the end of the field As an example, this ProcessWire selector: template=property, body*=luxury, bedrooms>5, bathrooms<=3 ...would be specified as a query string to this web service like this: ?template=property&body*=luxury&bedrooms>5&bathrooms<=3 Allowed templates For security, the search will only be performed on pages using templates that are defined in the module's configuration. Output The returned value is a JSON format string in the following format (populated with example values): { selector: "title*=something, template=basic-page, limit=50", total: 2, limit: 50, start: 0, matches: [ { id: 1002, parent_id: 4525, template: "basic-page", path: "/test/hello/", name: "hello" }, { id: 1005, parent_id: 4525, template: "basic-page", path: "/test/contact/", name: "Contact Us" } ] } Each of the 'matches' values will also include all the fields you have specified to appear with the ServicePages module configuration. If an error in the query prevented it from being performed, a JSON string in this format will be returned: { errors: [ "Error message 1", "Error message 2 (if there was one)", "And so on..." ] } The web service honors user view permissions. As a result, if you are accessing this service from a superuser account, you are likely to get pages that others users may not see. Superusers get an "include=all" automatically, unless you override it with an "include=hidden". Returned field values The following field values will be returned for all matched pages: id (integer) parent_id (integer) template (string) path (string) name (string) Any other fields may be included from the module's configuration screen. Pagination To paginate, simplify add a "page[n]" url segment to the request URL, i.e. /service-pages/page2/?template=basic-page&sort=name
    1 point
  6. Hi there, Before Soma jumps all over me, I've searched through the many threads that involve pagination I've set things up as per the main Pagination article. When I click on the Next link, I get the existing page re-rendered. The URL at this stage says: http://localhost:888...re/news/?page=2 I'm not clear whether I should be checking the page number and only processing certain items in the find() or whether the find() internally observes the page number internally. It's worth pointing out the news is the parent page that summarises news items from a collection of child pages. Any ideas what might be going wrong here? Thanks.
    1 point
  7. Strange as the url http://localhost:888...re/news/?page=2 suggest that page numbers aren't enabled on template thus the GET version of it. If it's enabled it should be /page2 ... Edit: I'd guess you already have read the pager documentation ?
    1 point
  8. ROFL! I was hoping that was a ProcessWire logo on the garment.
    1 point
  9. Yeah, it's alright I suppose @ryan - thanks for this as it's perfect timing for a few things I'm intending to do too
    1 point
  10. What a timing, I just started trying to build a module. This community is remarkable !
    1 point
  11. That comment is still the old version before the page was saved. You might need to re-retrieve it from the page in order to get the version with the populated ID. But this may be something you could just drop into your existing code without having to change much else: $email = $this->db->escape_string($comment->email); $status = Comment::statusPending; $result = $this->db->query("SELECT id FROM field_comments WHERE status=$status AND email='$email' ORDER BY created DESC LIMIT 1"); $comment_id = 0; if($result->num_rows) list($comment_id) = $result->fetch_row();
    1 point
  12. Hi Marc, Just to let you know that the following line: extended_valid_elements:img[src|id|class|alt] In the "Additional TinyMCE setting" textbox gives me exactly what I want! Many thanks! --Gary
    1 point
  13. Have been testing a little and so far it works well.
    1 point
  14. I got tired jumping through hoops using WordPress and Joomla and started looking for an easier solution. I searched for about a week, testing CMSes that I've never used before. I first looked at Concrete5, and then someone at Concrete5 forum swore allegiance to ExpressionEngine, so I searched for it and found it was a paid subscriiption, so I turned to MODx as an OpenSource alternative. It was decent, and I thought that it might work, but then I ran into a problem, and while searching for a solution, I read someone bragging about ProcessWire, and how easy it was and how it was the simplest most, most powerful CMS he's ever used, and I thought, hey that's exactly what I want. Within an hour, I had the basic install running on my wamp stack. 5weeks later, I have 2 sites running perfectly, and 3 on the way. I'm never using any other CMS again if I can help it! Thank you Ryan, and thank you ProcessWire community!
    1 point
  15. Helpful? http://www.tinymce.com/wiki.php/Configuration:extended_valid_elements
    1 point
  16. Thanks guys! I started using thomas' suggestion when I read it, and it works great. It's not perfect but at least most of it is properly aligned. I guess I have to let it go and stop worrying about indentation. Although sometimes, I really have to, because I teach part-time and I want the students to be able to read my examples easily. And yes, I'm introducing processwire to my students, instead of joomla and drupal which other schools usually use to teach cms. So there's hope that future web developers would be using processwire more and more! Thanks again!
    1 point
  17. http://www.washedashoredesigns.com/ Dont judge the minimal styling and papyrus font... All original art and craft things speak for themselves + the smallest css ever There is a css bug that occur when I moved my html and css from flat file mockup to process wire templates The border appears and dissappears at will, its almost like the image is a pixel bigger and overlapping it (possible?) Css: #feature img { border-top:thin; border-style:solid; border-color:#000; } Now on the front page image I can only see bottom border. Also can be observed on the gallery pages where bottom border appers to be the only one missing
    1 point
  18. I figured as much. I just thought you guys we're using an easier technique because most sources I've seen around are perfectly indented. Thanks! I'm new to processwire, barely 3weeks, and yet I've already used it for two websites. The only thing I love more than how powerful this CMS is, is how helpful and friendly the community is. I'll be sticking around for sure, and try to help whenever I can!
    1 point
×
×
  • Create New...