Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/20/2013 in all areas

  1. You need to load the route module additionally to angular.js http://code.angularjs.org/1.2.0rc1/ <script src="http://code.angularjs.org/1.2.0rc1/angular.js"></script> <script src="http://code.angularjs.org/1.2.0rc1/angular-route.js"></script> <script src="js/app.js"></script> app.js angular.module('phonecat', ['ngRoute']). config(['$routeProvider', function($routeProvider) { $routeProvider. when('/phones', {templateUrl: 'partials/phone-list.html', controller: PhoneListCtrl}). when('/phones/:phoneId', {templateUrl: 'partials/phone-detail.html', controller: PhoneDetailCtrl}). otherwise({redirectTo: '/phones'}); }]); where partials/phone-list.html could also be a PW page url with a partials template with url segments enabled create a page: /partials/ then the route configured like: /partials/phone-list and in the template file if($input->urlSegment1 == "phone-list"){ echo "<div>your partial template ... </div>"; }
    3 points
  2. Install db session module and you'll have a setup page with users. (not installed in core)
    3 points
  3. Diego, try Diogo's code above. It works like a charm. Like I said, there are some very clever people in the forums. He's one of them . You could make it more specific by using template or parent, etc in the selector or using a "get", like so: $x = $pages->get(2064)->children("single_page_field.count=0")->import($pages->get(2064)->children("single_page_field=1234"));
    2 points
  4. field_page=0 will return also all the pages that don't even have this field i their template. The correct way to return pages with an empty page field is field_page.count=0. Unfortunately there is no way of combining field_page.count=0 and field_page=123 in one selector, so you would have to create two different arrays, and merge them. You can do this with $a->import $myPages = $pages->find("field_page.count=0")->import($pages->find("field_page=123")); After this you will have an array with all the desired results and you can even sort it as you would in a selector: $myPages->sort("created"); Edit: Pete, i just saw your answer. I don't think that it works for page fields...
    2 points
  5. @flyerdave - having recently converted a very complex wordpress theme into something that could be used for processwire, i think i might be able to help you simplify the process; first thing is you'll need to have a working install of the actual wordpress theme running on wordpress; then the next step is to look at the generated markup; from there you'll be able to figure out how to structure the pages, including the head and foot (depending on how you do that - for example if you are using the default profile, you would place the header code in the head.inc file and the footer code in the foot.inc files). it was so much easier than i thought it would be once i stopped looking at the wordpress theme files; i did look through all of the WP files for the theme i was converting, to see how they were handling certain output, and was able to sort of convert that thinking into a processwire model. my version actually runs way faster and has way more flexibility that the original wordpress version and can do a lot of tricks that WP people would be scratching their heads over... i'll be posting it in the showcase soon;
    2 points
  6. I'd like to see this module get some love, so if someone wants to help Antti, I can donate a couple of hundred euros.
    2 points
  7. I'm not saying that this is a bad idea, but it won't fit all needs -- and thus it might not make sense to complicate the built-in login system with it. When it comes to login systems, "friendlier" could also be considered "less secure" -- but that isn't really such a huge issue here, brute force attacks being already pretty unlikely with Session Login Throttle enabled by default etc. Anyway, you can always roll your own custom login if you prefer something more specific: see this post by Ryan for an example.
    2 points
  8. The user is actually a page. This makes him/her unique by default. (no need for scripting) You could log-in users with their email address, but email address is not unique by default. (it needs some scripting) I could be: "martijn (role editor) martijn@domain.nl", but also "admin (role superuser) martijn@domain.nl" Search the forum for login with email and you will find good answers. (use google)
    2 points
  9. Hi flyerdave, Welcome to PW and the forums. PW "template files" are nothing more than HTML interspersed with some PHP to output the dynamic content. There are various ways to convert that theme for use in PW. One way is just to copy the output HTML by viewing source in your browser. Then, you would strip that of all dynamic content and remain with the skeleton HTML. Maybe you could also do this directly from the WP theme PHP files but am not sure. It has been a while since I looked at WP themes. All I remember is that they are a nightmare! I highly doubt you will need all those 25 PHP files in PW! After this, you will have to decide how to output those dynamic content of your site. Those would either be whole pages or fields of certain pages. I would say converting the theme for use in PW should be the least of your worries. You should instead concentrate, in my humble opinion, on learning the basics of PW. In order to make best use of the system, you will have to know some very basic PHP. Have a look at the following topics in the docs: http://processwire.com/api/variables/ http://processwire.com/api/selectors/ http://processwire.com/api/templates/ This will require some work and willingness to learn on your part beyond the point and click common in other CMS. On the other side, great rewards and total freedom await you if you are willing to overcome this initial hurdle
    2 points
  10. I just pushed ProcessWire v2.3.1 to the dev branch. This is a fairly major change in that it switches the DB driver from mysqli to PDO. It meant changes to a large percentage of core files. ProcessWire still supports mysqli, but doesn't attempt to use it unless a module or a template asks for it via the $db API variable. The new API variable (for the PDO driver) is $database. More about PDO at php.net If you are using the dev branch, be careful and test thoroughly with this latest commit to it. Before upgrading, you may want to double check that your PHP supports PDO by looking at your phpinfo (CMD-F or CTRL-F for "PDO"), especially if you are running PHP 5.2.x (where PDO wasn't compiled in by default). Though if you are running PHP 5.2 (vs 5.3.8+) then you may want to just stick with ProcessWire 2.3.0 and upgrade your PHP version when possible. If you are using any modules that use the procedural version of mysqli functions (vs. the $this->db object oriented versions), or type-hint mysqli in methods, then those modules will no longer work. If you come across any modules that don't work with 2.3.1, please let me know here so that I can assist the author in updating them. Note that FormBuilder is one of the modules that does not work with 2.3.1, but I have posted an update in the FormBuilder board that corrects it–so be sure to download that version if you are tracking the dev branch of ProcessWire and using FormBuilder. What this new version adds: 1. New API variable $database that refers to the PDO database. The old $db API variable is still there and refers to mysqli for any modules that continue to use it. 2. New API variable $log that lets you easily log messages or errors to the system logs. Usage: $log->message("This saves this line to messages.txt"); $log->error("This saves this line to to errors.txt"); $log->save("my-log", "This saves this line to my-log.txt"); // Get an array of the last few entries saved to the messages log $entries = $log->get('messages'); // Get an array of the last 50 entries saved to my-log $entries = $log->get('my-log', 50); Note that as always, log files are located in /site/assets/logs/. 3. Conditional autoload modules. In PHP 5.3+, modules may now specify an anonymous function OR a selector string, rather than a boolean for the 'autoload' property returned by getModuleInfo(). PW runs the anonymous function after determining the current $page, so your module can make autoload decisions based on the $page (or any other factor you'd like), if desired. Lets say that we have a module that we only want to autoload when the template is 'admin': public static function getModuleInfo() { return array( 'title' => 'Module Title', 'summary' => 'Summary text...', 'version' => 1, 'autoload' => function() { if(wire('page')->template == 'admin') return true; else return false; }); } And the same example but using a selector for autoload: public static function getModuleInfo() { return array( 'title' => 'Module Title', 'summary' => 'Summary text...', 'version' => 1, 'autoload' => 'template=admin' ); } 4. Addition of $pages->add() method. Actually $pages->add($template, $parent, [string $name], [array $values]); This function adds a new page to the database and returns it. This is for syntax convenience, but using the old method is still perfectly fine too. Here's a few examples of usage: // add a new page using template basic-page under /about/ $newpage = $pages->add('basic-page', '/about/'); // same as above, but named 'contact' $newpage = $pages->add('basic-page', '/about/', 'contact'); // same, but populate the title field too $newpage = $pages->add('basic-page', '/about/', 'contact', array('title' => 'Contact Us')); // you can also do this, specifying the values array as 3rd argument: $newpage = $pages->add('basic-page', '/about/', array('title' => 'Contact Us')); $template and $parent are required, but may be objects, IDs, or string identifiers (like name for template, or path for page). When you add a new page and don't specify a 'name', then PW will make one up, guaranteed to be unique. 5. Module files that end in '.module.php' are now supported. So rather than ClassName.module, you may use ClassName.module.php if you prefer it. The purpose here is to support text editors that determine their syntax highlighting based on the file extension. More updates being made almost daily. Please report any issues you experience. Thanks, Ryan
    1 point
  11. I just discovered an awesome app: http://vanamco.com/ghostlab/ It lets you connect your devices (or simulated/emulated devices), then you test on one browser and the other views act synchronised. Debugging is easy too, you pretty much have a chrome dev tools like thing for all the devices on your desktop. Gosh this is front end heaven =)
    1 point
  12. I think you're actually right and I'm probably going exactly that route in the next days. When everything goes well, I'm going to publish it to the modules directory afterwards, for sure.
    1 point
  13. 1 point
  14. The simplest way to make the images added in textarea field show after migration is to preserve the same folder structure and folder names as it was on the previous machine. For example if your image was originally stored in let's say: localhost/project-name/site/assets/files/... don't change that to for example: localhost/changed-project-name/site/assets/files/... Just keep the original folder naming and structure and it should work. On live server you should use the same methodology as with localhosts. If you can't do it for some reasons maybe you should edit htaccess file and try to rewrite the old URL of the folder containing your images to the new, like: RewriteRule ^/olddirectory(.*) /new-directory$1 [R=permanent,L] I didn't check the second way so I'm not sure if it works. All this fuss with images not showing is because the URL of images added in textarea field are stored as they are and when you change the structure or names of the folders the URL is no more valid. The Firebug will show you error 500 (which is unfortunate) but when you change the DocumentRoot in Apache config to folder where you keep the website files the error will be 404 - which means that the image wasn't found due to wrong URL. I hope I made myself understandable
    1 point
  15. Just to clarify, in prev version 1.2 the code you posted works just fine. But it changed in 1.2 and route is a module.
    1 point
  16. Log in in with email address has more overhead so shouldn't be default. Please let the system as it is. ( think ryan won't change it, cause it makes sense ) If your needs for the login with email is that high, write a module for it that hooks in. ( Session authenticate ( not shure about this hook ) ) side note: There are a lot of developers to overcomplicate scripts. (count my self in) Ryan is the gatekeeper of no overhead & simplicity. let it be this way, please
    1 point
  17. actually I have no clue FieldtypePoll module is about only thing I have done with Angular, and I am pretty sure it has all the worst practices..
    1 point
  18. Hi globi, It's not a good idea to have your posts as repeater. Why? Scaling. After a certain number of posts, you'll get problems with repeaters, because Pw has to load them all. Maybe you're already facing this problem? I'd suggest to write a script which loops through your repeater posts and add them as single pages. Cheers
    1 point
  19. template != template file (usually html & CSS) You need one template, call it "babysite". Then load site specific CSS when needed and in some case probably site specific HTML too. This is very straightforward and we are here to help. on mobile atm, would provide code examples otherwise.
    1 point
  20. Mary, I'll see if I can rustle something up. I would stick with Soma's approach for now. I'm still unsure what you mean by differences here. Maybe provide an (visual) example about the differences? What I mean is this, differences in layout can mean either totally different markup or can mean same markup, but with jQuery and CSS wizardry, a different layout is achieved. Another thing, at this point in time, do you have an idea how the baby sites will look like and how many fields they will require? I don't think so, but just asking. In planning such a site, pen and paper and/or a Spread Sheet are my best friends. I'd write down all the fields that will be needed and note those that will be unique or common...But, I am jumping ahead here.
    1 point
  21. Hi everyone, I made a walkthrough of a web app I built using ProcessWire for the Tenova Group mining company. They needed an intranet application to keep track of their daily plant operations. I designed and developed a ProcessWire solution that would allow registered employees at Tenova HYL to record events regularly in an event log. Storing all of the events in this manner would allow registered users to find the events they're looking for using keyword search, date filters as well as filters based on other criteria. Each event also allows the user to upload supporting files for download, such as Word documents and PDFs, as well as upload relevant images to be displayed in a modal window. A high-performing, powerful solution using the ProcessWire CMS. Read about the project here in my portfolio. See the video here: Tina Holly tinaciousdesign.com
    1 point
  22. Hey Nic, Just playing around with multi-language fields for the first time and noticed that if I set the Title field to "PageTitleLanguage", then the titles for all the results in the tree are [object Object] Thanks
    1 point
  23. As mentioned, you can achieve this via re-categorisation of your pages or via URL segments. A similar question was asked last week. See the thread linked below and especially Ryan's response for an alternative method using hooks. http://processwire.com/talk/topic/1973-url-shortener/?p=44211
    1 point
  24. If you enable URL segments on the home page you could get what you want. Or you could create the rootParent catering and do your search there.
    1 point
  25. Edit the line that it's talking about in Page.php and change it from this: if(!$template->hasRole('guest')) return false; to this: if(!$template || !$template->hasRole('guest')) return false; This change is also already present on the dev branch (I ran into the same error a few weeks ago).
    1 point
  26. This is a little off topic, but since it involves headphones, it's probably more in topic here than anywhere else in the forum. If you haven't heard 3D stereoscopic sound (I hadn't), you need to try it, it's really quite cool. To experience it, you need to use stereo headphones. Virtual barber shop (this one works best if you close your eyes): Thunderspace (put headlines on and click play on the video): http://thunderspace.me/ What's cool is also how simple 3d stereoscopic sound is to achieve. You just record the sound with two microphones: one where each ear would be on a person. Your mind apparently does the rest in making it 3d/spacial.
    1 point
  27. @pwired, there isn't any software that keeps compatibility with old versions of modules forever. That's why I think it's great that you don't have to use lots of third party modules with ProcessWire, and everyone should be aware of the risk of making a website completely dependent of them. Anyway, no one is forced to upgrade immediately to a latest version (or even at all), and Ryan shows he is always very concerned about breaking things for people, so I'm pretty sure that when it comes the time when that step really has to be taken, all modules (or a good alternative to them) will be already compatible. One thing I think it's important to keep in mind here is that software has to evolve. And this evolution will always be a balance between backwards compatibility and new and better features. You really don't want to use a software that stopped in time...
    1 point
  28. One of the many things I love about PW is that whenever new features are added they always make sense. Not just Ryan's excellent descriptions, but the additions themselves. In this case I especially like the $pages->add method.
    1 point
  29. If portfolio_categories is a Page field, you can't and don't need to use '*=' or '%=', use '=' instead. In the case of Page fields '=' checks if the value of said Page field contains specified page, not if it's equal to it, so you should use that and a page ID (or Page object) to see if one of selected categories is the one you're looking for: // this should work: $cat = $sanitizer->selectorValue($page->title); $cat_page = $pages->get("template=portfolio_category, name=$cat"); $p = $pages->find("portfolio_categories=$cat_page"); // .. though in this case you should do this: $p = $pages->find("portfolio_categories=$page"); // .. and you could even do this: $p = $pages->find("portfolio_categories={$page->id}";
    1 point
×
×
  • Create New...