Jump to content

Craig

Members
  • Posts

    373
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Craig

  1. When I'm importing data, I usually add a ProcessWire field called legacy_id. Any import script will set this value to the actual ID from the item in the old dataset. It helps the script easily and accurately find existing imported items, and you can keep this around for a little while after so you can trace it back if you need to.
  2. Hi! You mention that you set the config values to the IDs of existing templates for teachers and students. I think this is where the problem is - if your user templates don't have the necessary fields that the default users do, then that could be an issue. The instructions recommend cloning the user template to start these off, presumably so that your custom users have everything they need before you start customising. What I would try first, is to edit your teacher and student templates and import the fields used on the user template - this should pull in password, email and roles (I think). If that doesn't work, I would rename your existing teacher and member templates to something else (to use as a reference), follow the instructions exactly, and see if that works. If it does, go ahead and configure them the same as the ones you renamed - import fields, change access/family properties etc.
  3. Hi Tony! Welcome to the forum I think one of the fundamental things to consider with projects like these, is to actually look and analyse the existing data - the structure, the format, the quality, and any relationships there may be. It's almost going through the normalisation process but perhaps not as strict. It would be a good idea to take every column in the existing database to decide how that will be represented in the ProcessWire site. Probably, some of these will be simple translations - Varchars will become Text fields, and Ints will still be Integer fields. But what will be more important is the data in these fields - does it vary with just about every single dam? Is it a value representing Yes/No? Are there only a few values for that column that all dams can potentially use? If so, do the values all use the same spelling of words, or are some mixed case or have weird formatting or spacing issues? When you have a set list of values to choose from, this is where you can decide how to store the data in ProcessWire - Page fields, PageTables, Options field, etc. If your source data quality is good, your job will be easier. If it's not, there will be some work involved in preparing it so that it is clean to work with. You may already have a good idea of how your data looks or is structured, but I usually like to do some form of planning on paper or using a spreadsheet to map out the source data to the ProcessWire templates and fields. Doing the important work now will save you hassle later on down the line and will really help you to make the search feature more functional. As an example: In ProcessWire, I imagine there would be a template created called 'dam'. You might add the following fields to this template (just for starters): title description location (FieldtypeMapMarker) height (integer/float) length (integer/float) capacity/volume (integer/float) country (Page field/Options field?) built (date) opened (date) For each dam, a Page would exist somewhere in the page tree, using the 'dam' template. As you've already seen the Skyscraper profile, you can probably look at that for more ideas on how to structure things though
  4. Hi kazu! Like with most thing ProcessWire, there are a couple of approaches to this. One thing I do often is to make a content block template, so they can be stored and edited in the CMS. Use the ProcessWire roles to restrict access if you need to. I then use a little helper function to call these, like so: function getContentBlock($param = '') { if (strpos($param, '/') === FALSE) { // $block is name $param = wire('sanitizer')->selectorValue($param); $block = wire('pages')->get("template=content-block, name=$param"); } else { $param = str_replace("//", "/", "/{$param}/"); $block = wire('pages')->get("/settings/content-blocks{$param}"); } if ($block->id) { return $block->body; } } As long as that function is included, I can do echo getContentBlock('/contact/address/'); // using path to page echo getContentBlock('opening-times'); // using page name If static files are more suitable, then you can do something more like this: echo wireRenderFile('blocks/opening-times'); Where the path to that file is site/templates/blocks/opening-times.php.
  5. Fantastic! Excellent finish all round, and thanks for highlighting a few of the PW methods used
  6. What about Trello instead of or as well as? Some useful links: Going Public! Roadmapping With A Public Trello Board Software Developmentin Usage Examples
  7. Hi, WireMailMandrill author here! Sorry about that - I'll have a look at this to try and find the problem
  8. If all you need is some SCSS/LESS (or JS) processing, there are some helpful GUI tools that take the command line and dependency management hassle away - Prepos as mentioned above, or my favourite, Koala. They can watch your files for changes for you, so no running commands every time you change project or change a single line in one file.
  9. I think you should be asking, why do you want to use Gulp or Grunt? What are you doing (or want to do) in your projects that needs those tools or that workflow? If you don't need them, don't use them
  10. Not a tutorial exactly - but you could perhaps look at the blog profile to see how certain things are achieved?
  11. Thanks for bringing this up! I'll have a look at this shortly If you have changed it to singular: false in your own copy, does that change alone fix the problem you had?
  12. This looks to be supported by WireMail itself, so it should work with WireMailMandrill. Using the example above, try adding this line: $mail->header('Reply-To', 'sender@example.com'); I haven't tested it but please give it a go
  13. Very, very nice! And thanks for talking through your approach to some interesting points
  14. Is there a specific reason you want this to be managed using a button on the field itself? If I was doing this, I'd look at creating a module that just added a hook method (like 'generateSprite()' or something), to the Pageimage class, maybe, which exposes a function to return the generated sprite image URL and CSS content for a given images field. There would be a cache table behind this which saves the generated status and metadata/CSS to prevent processing the images on every request (this would have to be invalidated whenever the images changed). Using this method, there is complete freedom to do all of this from the API. You can still have a configuration page, but the downside of this is that it would be less customisable per field instance in the templates. For example: $sprite = $page->images->generateSprite(); $sprite could be an array of generated CSS and/or path to the image for you to use in the template/code however you like. I think the main consideration in approaching this, is how (and why) you want the sprites to be made.
  15. Hi That's an interesting point! I haven't used that feature before but definitely can see how it's worth doing. In other systems my company has developed, we often keep a log of all messages sent purely for auditing and recording purposes, so there is merit in keeping those purely for that - but if that can also help with things like tracking stuff that's great. The WireMail ___send function is hookable - perhaps another module could be created which just hooks into this and logs all messages, either in its own custom table or as a page.
  16. Want to use Mandrill for sending emails using their HTTP API rather than SMTP? Read on! I've been working on a WireMailMandrill module for a site I'm currently adding some features to. So far, the module has been tested for simple mail sending, with basic options, and attachments. I haven't tested the full range of things that are possible with the official Mandrill PHP library, but I think I've implemented the ability to set most, if not all, of them. This should be considered beta and not entirely relied upon for sites in production. Testing and feedback welcome. I'm sorry about the lack of code comments at the moment as well, I was just throwing this together as I went along so I could move onto the next part of what I was building... This was originally mentioned in a discussion about SendGrid and Mandrill options in a thread in the Form Builder support area. Not everyone has access to that, which is why I'm putting this here WireMailMandrill on GitHub Quick example (taken directly from a site I'm working on): $mail = wireMail(); $mail->from('info@example.com', 'ExampleCOM Enterprises'); $mail->to($toMail, $toName); $mail->subject('Entry confirmation'); $mail->bodyHTML($bodyHTML); $mail->attachment($myPage->files->first()->filename); $count = $mail->send();
  17. I have this working as expected on a site I'm currently building, on 2.5.28 dev. Have you followed each step from the instructions?
  18. horst, have you done a full/hard/forced refresh on the admin? I've had some odd behaviour in the past, which has just turned out to be cached module javascript files.
  19. It does use the wireMail() function call
  20. I'd perhaps use WireCache for something like this, depending on how you need to retrieve these items later on. The most obvious method would be to key it by the user who will receive the notifications - so you would create a simple array structure with the important information for the notifications, and store it using a cache name like "notifications-1142" for user ID 1142. This should make it quick to retrieve. You can then pull this out, show it, update it by modifying the notifications array, and putting it back in the cache. Other than that - a simple module as an interface to a custom simple database table would be more than suitable.
  21. Craig

    Forum Software

    Vanilla Forums?
  22. What about doing the same tasks using incognito mode - does it result in the same behaviour? Do you have any active extensions that are messing with the User Agent string?
  23. Hi teo74, welcome to the forum You are sort of there with InputfieldPageListSelectMultiple - but alone, that is just one method of providing the visual input part of what you need. What you need is the Page fieldtype, which will give you the option of using Page List Select inputs, amongst others, in the backend. The Fieldtype is how the data is stored, formatted and linked internally, and the Inputfield is how this field is presented and manipulated in the backend by a user. Have a look at this video - Using the Page Fieldtype - to get an idea of how it all works. In summary: Create a new field (called 'related', perhaps?) using the Page fieldtype. Configure it for the types of pages you want to select, and how you want the selector to look (which Inputfield to use) Add it to the template where you want to choose related pages. Edit those pages and choose the related pages In those pages, you can get the related ones, and display the links, by doing something like this in the template code: <ul> <?php foreach ($page->related as $relatedPage) { echo "<li><a href='{$relatedPage->url}'>{$relatedPage->title}</a></li>"; } ?> </ul>
  24. This looks amazing! Thanks very much for putting this together I don't have the Open Sans font installed locally. Would you be able to change to a stack that includes fallback to other Sans fonts, or include the webfont? At the moment it's a very unattractive Times
×
×
  • Create New...