Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/18/2012 in Posts

  1. Hi all, I just launched a new portfolio site for talented Melbourne-based illustrator Mitch Vane: http://mitchvane.com/ Mitch isn't a seasoned CMS user and she had some very positive things to say about ProcessWire after having used it for only a few days. Regards Marty
    4 points
  2. Try this count($entry->comment) or maybe this will work too $entry->comment->count(); $entry->comment.count definately doesn't, and returns the toString method of the object which is the id's comma separated I would guess.
    2 points
  3. Hi, I just noticed that if you put float values in an integer field it will completely ignore the decimal point. e.g. I put in 244.5 > it will save 2445 Most of the times the enduser doesn't realize it should be an integer and just copy pastes values in there. Am I seeing this the wrong way or should the integer field automatically round off the values before it saves?
    1 point
  4. You can put a page field in the properties template and select the page "users" as the parent of selectable pages. Then, you call the user for each property, from the property page, like this: foreach($page->pagefield as $myuser){ echo $myuser->name; } and to all properties from a user: $theuser = $pages->get("user selector"); $properties = $pages->find("template=property, pagefield=$theuser"); (both not tested) edit: I didn't take this in consideration in my answer, but there must be a way of constraining the selectable pages to this. edit2: Ok, besides limiting the field by parent, you can place on the field's "Custom PHP code to find selectable pages", this snippet of code: $investor = $pages->get("name=investor"); return $pages->find("roles=$investor"); This will limit the selection to users with the role "investor" edit: I changed the variable $user to $myuser where I was using it, so it won't override the existing $user from the API
    1 point
  5. Hvala, Nikola! This has been my favourite admin theme for a while and I've done some very minor tweaking to suit my own preferences. Increased the width of the main nav items by 20px. Reduced the heavy search box. Made the animations much faster -- so menus pop open almost instantly and the scrolling panel on the right is now almost sticky. Added the 'back to top' link to the scrolling panel (helpful in long pages.) If anyone is interested in trying this out, you can find the 'futura-delta' theme on github.
    1 point
  6. ryan - MediaWiki does have a lot of initial settings to tweak and there are quite a few recommended addon modules to install to prevent it becoming a spammer's paradise so I'm happy to set this all up. I'm not sure about the bridge requirements, but it should be fine with being on an isolated subdomain as the database host will still be at the same IP address (depending on servers sometimes using "localhost" in the DB connection on a subdomain doesn't necessarily give you access to the parent domain, which would be required for the bridge to work of course). If all else fails it could go under processwire.com/wiki (or guide or whichever name we're going with) instead, but I'm pretty sure we can make it work fine on a subdomain.
    1 point
  7. So here we go: http://siebennull.com/PWfileReference/ I hope it gets clearer ;-)
    1 point
  8. Regarding workflow: the default profile is pretty much always my starting point. It's rare that I don't end up repurposing the fields and templates that are already there to start building things out. Likewise, I usually end up just renaming (as necessary) and repopulating the pages that are already in the default profile. Then I will start adding new fields, followed by templates, specific to the needs of the site. While I try to determine most of the templates/fields that I'll need ahead of time, I will continue adding fields and templates throughout the entire development process as necessary to make the site do what I want it to. Most larger PW sites are pretty relational and make good use of Page references. But this is also the part that I think is most important to outline when it comes to workflow. This part is quite a bit different from other systems, but has major advantages. I try to make my selectable Page references part of the site's structure, if at all possible. For example, on tripsite.com, every bike tour has a "country" page reference field, and those countries are useful in the site's overall structure (Netherlands in this case): http://www.tripsite.com/countries/netherlands/ In other cases, page references might not fit as part of the site's general structure, so I'll have a /tools/ section in the site where they live. Though it's easy enough to make them function as pages, so I figure why not. Here are a few examples (they are all using the same template): Multi-page reference field "months" (April in this case): http://www.tripsite.com/tools/months/april/ Multi-page reference field "tour_types" (Guided in this case): http://www.tripsite.com/tools/tour-types/guided/ Page reference field "difficulty" (Difficult in this case): http://www.tripsite.com/tools/difficulty/difficult/ The template used on those pages is not much more than this: $tours = $pages->find("template=tour, {$page->parent->name}=$page, limit=10"); foreach($tours as $tour) { // output the tour } Admittedly, most of my projects are rebuilding existing sites, so I usually have some (or a lot) of data to migrate to the new site. This becomes a major component of the development workflow, so I figured I should mention it here. After I've setup the necessary fields and templates (and usually before front-end development), I'll work on bringing in the new data. If it's a relatively simple conversion job, I might use the ImportPagesCSV module. But most jobs require some markup replacement, character set conversion or other things, so I'll build my own import script. This is where I like to bootstrap PW from a command line PHP script. Here's a simple example: /import-airports.php #!/usr/bin/php <?php require("./index.php"); // bootstrap PW $fp = fopen("./airports.csv", "r"); while(false !== ($data = fgetcsv($fp))) { $page = new Page(); $page->template = 'airport'; $page->parent = '/building-types/airports/'; $page->title = $data[0]; $page->location = $data[1]; $page->year = $data[2]; $architectName = wire('sanitizer')->pageName($data[3], true); $architect = wire('pages')->get("/architects/$architectName/"); if(!$architect->id) { $architect = new Page(); $architect->template = 'architect'; $architect->parent = '/architects/'; $architect->title = $data[3]; $architect->name = $architectName; $architect->save(); } $page->architect = $architect; $page->save(); echo "\nCreated page: {$page->url}"; } Once I've got a lot of data to work with in the system, I'll start doing front-end development: creating the template files, markup, css and anything else necessary to handle the output for the site. The files from the basic profile either get used as a starting point, or replaced completely at this point. These are my main workflow components I can think of, but let me know if there are any specific areas you'd like more detail on or can think of anything I've missed.
    1 point
  9. You can do it like this: $num = count($comments); $options = array('headline' => "<h3>$num Comments</h3>"); echo $comments->render($options); See here: You could edit the module and remove it, but I don't recommend doing so. The email field is not displayed to anyone, it is just used as a way to recognize when a comment is made by someone that already has an approved comment (so they don't have to wait in a moderation queue). If you were certain you didn't want it, you could always pre-populated it with some fictional address and hide it with CSS.
    1 point
×
×
  • Create New...