Jump to content

applab

Members
  • Posts

    36
  • Joined

  • Last visited

Everything posted by applab

  1. I'm a Linux guy end-to-end, but if I had to develop on a Windows machine my go-to solution would be to use https://www.virtualbox.org/ to setup a local Linux dev environment. I've also had a tinker with https://www.docker.com/ which looks like "the right way to go" but I don't it well enough yet.
  2. thanks Teppo, worked great after 1 amendment: on first attempt I got an error: "Error: Exception: Can't save field from page 1028: /blog/posts/test-post/: Call $page->setOutputFormatting(false) before getting/setting values that will be modified and saved." so, I did as the error suggested end ended up with: $comment = new Comment; $comment->text = "my text"; $comment->cite = "my name"; // etc. $p = $pages->get('/about/'); $p->setOutputFormatting(false); // added $p->comments->add($comment); $p->save('comments'); checking the PW cheatsheet for $page->setOutputFormatting() makes it clear why that's needed.
  3. I have a template which includes a "comments" field using the core Comments field type (FieldtypeComments) Is there a way to post a comment to a page which uses this field, programmatically, from a different page?, ie. not the current $page. something along the lines of: $my_comment = array( 'cite' => $comment_cite, 'text' => $comment_text, 'created' => $comment_date ); $p = $pages->get('my-selector'); $p->comments->add($my_comment); // no such method! tia.
  4. Hi All, I've just noticed that the latest stable version has moved on to 2.4, when did that happen?, did I miss an announcement?? I'm too busy to download and take a look right now, is there a changelog anywhere that will inform us what to expect in the new version?, or maybe a forum post that I should check out? cheers, Martin.
  5. Hi Manaus, how about adding page.template to $twigvars before the call, eg. $twigvars = array("page" => $page, "template"=>$page->template->name); then in your twig template having: {% if template == "project" %} disclaimer: i haven't tried this, i'm just thinking out loud.
  6. Having used Bootstrap 2 and Foundation 4 I have a definite preference for Foundation, but that might just be my pathological avoidance of "the popular option". Contrary to your experience Joss, I found Bootstrap to be the *more* clunky of the two. If all you need is a mobile-friendly responsive grid then take a look at http://arnaudleray.github.io/pocketgrid/
  7. Maybe something like the "Amazon Elastic Compute Cloud"? (http://aws.amazon.com/ec2/) According to that page... "... increase or decrease capacity within minutes, not hours or days. " "On-Demand Instances let you pay for compute capacity by the hour with no long-term commitments." I haven't used it so can't comment on what it's like in practice, but it sounds promising in principle.
  8. Hi pogidude, This won't handle dependencies but will allow you to load scripts on per-page basis... In your master template place the following code <?php foreach($config->scripts->unique() as $file) echo "\n\t<script type='text/javascript' src='$file'></script>"; ?> In your partial templates add $config->scripts->append("/path/to/script.js"); You can also do the same with styles: // in master <?php foreach($config->styles->unique() as $file) echo "\n\t<link type='text/css' href='$file' rel='stylesheet' />"; ?> // in sub-template $config->styles->append("/path/to/style.css");
  9. hi apeisa, Thanks for the pointer. I haven't built an admin module yet, is this what you're referring to? https://github.com/ryancramerdesign/ProcessHello cheers, Martin.
  10. Hi Adrian, Thanks for the welcome, and the link. I can certainly see me finding a use for that module but it doesn't cover my requirements in this instance. I need the fields that are shown to be dependent not on the currently logged in user, but the on the type of user being editing. I.e. It will always be 'staff' who are in the back-end editing 'students' & 'agents', but I'd like a different set of fields depending on which it is. My current thinking is along these lines: 1) create 3 roles [staff,agent,student] 2) add all fields for all roles to the user template 3) use a hook to hide some fields depending on the role of the edited user (not the editing user!) If anyone with more experience can see a flaw in my plan or suggest a better method then I'm all ears. thanks, Martin.
  11. Hi All, Another ex-modxer here. After 6 years of Evo I've tried my best to bond with Revo and it's just not happening. I've built one simple site with PW and it was a delight to work with so now I'm hoping it's able to cope with the next two projects I have lined up, both of which are quite involved. If I was doing my next project in Modx it would require several custom db-tables and I'd be coding a number of custom admin screens whereas with PW I get the impression that I could do *everything* using standard features. Anyway, here's my first question... The site I'm working on has three types of users (ok, 4 if you include 'guest'). Only one type ('staff') will have access to the backend. The two front-end user types are 'student' & 'agent'. The fields I need to store for 'student' are different to those for 'agent', which are different to those for 'staff'. So, is it possible to have a different set of fields available for each user type? Any pointers on how I might approach this in PW would be much appreciated. Thanks, Martin.
×
×
  • Create New...