Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/10/2014 in all areas

  1. Hi again everyone - I have spent quite a lot of time on this the last few days and it is now much more robust and feature rich. In an effort to encourage some testing from you guys, I have attached an export of Ryan's blog profile that you can install into an existing PW site. Download the attached zip file Grab the latest version of Page Tree Migrator from Github (https://github.com/adrianbj/ProcessPageTreeMigrator) and install. Make sure your templates directory is writable by the server Run the module from the your Setup menu Choose "Import" and continue to Step 2 Choose the Parent Page - choose "Home" which will install the blog as a first level child of your homepage. Make sure "Everything, including all data pages" is selected for Components to Import. From Data Source, choose "Zip File Upload", browse to the blog.zip file. Click "Upload and Create Content" and wait a few seconds. That's it - you should have a fully functioning blog set up at: Home > Blog It comes complete with the same test entries, images, gallery, tags, categories etc that Ryan's original one does, although I did add in one extra photo, embedded into an RTE and resized - the photo comes from Joss' Foundation 5 profile. The one thing you'll notice is that the embedded Youtube link doesn't work, because the Video embedder module isn't installed. Page Tree Migrator will install core modules as needed, but obviously can't install other ones - yet You'll notice that the blog is installed with its CSS and script files in a subdirectory of the templates folder to avoid an overwriting of existing files. Please test and let me know what you think - Thanks! blog.zip
    6 points
  2. Had a couple of quieter days last week and decided to take a deeper look at some new software out there for designing mockups/prototypes. Some of them I was familiar with, others less so. http://www.balasamiq.com http://www.moqups.com http://www.uxpin.com http://www.axure.com/ http://www.wireframe.cc http://www.easel.io The one that I personally find most promising was UX Pin. It seems to be relatively simple to use and yet has a wider array of stencils to use for quick prototyping. Some of these tools have quite a focus on CSS fidelity, others are just tools to sketch with. Some are purposefully low-fidelity (Balsamiq, Moqups) while others you could theoretically use to build out a whole design, complete with animations and interactions. I'm interested how some of you guys are building nowadays? Do you still stick regimentally to the full design in a PS/FW or do you have a more iterative process? Another feature of a lot of these apps is presenting for clients and there are some apps which do just this: http://www.invisionapp.com This can offer a more favourable approach than just emailing a PDF or even pointing at one face-to-face on a screen. Have any of you used any of these and what were your experiences?
    4 points
  3. Or just use $array = wireDecodeJSON($json);
    3 points
  4. I've never had good feedback from any client if I've presented a wireframe. Perhaps it's the kind of clients I have (no offence to them) that can't see past a line-drawing and can only get their heads around what their site would actually look like. In the past I've used Keynote to good effect but I'm now using Sketch (OS X) to flesh out a design more fully before handing it over. And that's because I usually need to plant down a design that I've formed in my head first before I lose it.
    3 points
  5. Recently I got a brand new iMac so I needed to install PHP SQL and configure Apache. I'm using the same web develop environment for years and I'm really happy with it. Raymond is also using this and Arjen did the same recently. I love to share how I setup this environment in a step by step tutorial. Let's setup PHP, MYSQL and activate mail using gmail smtp for OSX 10.6 and up, perfectly suitable for ProcessWire. It doesn't install Apache, it uses the Apache installation, which comes with OS X. The PHP installer package is created by Liip and it is based on entropy's php package. For MYSQL we gonna install the DMG Archive (x86, 64-bit). After we installed PHP, we configure Apache & PHP so that we’re able to run the ProcessWire sites in our own ~/Sites directory. For El Capitan see Arjen's https://processwire.com/talk/topic/5797-setup-a-processwire-environment-on-a-fresh-macos-x-install/?p=103674 Install PHP We gonna use the PHP installer created by Liip. (more information) Go to: /Applications/Utilities/ Open: Terminal.app Type: curl -s http://php-osx.liip.ch/install.sh | bash -s 5.5 Press: RETURN Type: your admin password Press: RETURN ( download starts and continues with a the install ) note: If you want to have an older PHP version, replace 5.5 with 5.4. (PHP 5.5 is the current stable) After the install is completed Apache is restarted and complains about “Could not reliably determine the server's fully qualified domain name, using your-computer-name.local for ServerName”. This notice is not a problem, we only use this Mac for local website development. Setup Apache Open a new finder window. Press: shift + command + g ( Go to folder ) Type: /etc/apache2/ Press: go Open: httpd.conf Find the line: #Include /private/etc/apache2/extra/httpd-vhosts.conf Remove the # infront to enable. Press save and enter your password when asked. Enable the use of ~/Sites folder:Open the folder /etc/apache2/users/ * Duplicate the Guest.conf and name it martijn.conf Open the duplicated file that we created * Change: <Directory "/Users/Guest/Sites/"> to <Directory "/Users/martijn/Sites/"> Change: AllowOverride None, to AllowOverride All Save the file. The file should look like: <Directory "/Users/martijn/Sites/"> Options Indexes MultiViews AllowOverride All Order allow,deny Allow from all </Directory> Configure the vhosts includes Open /etc/apache2/extra/httpd-vhosts.conf Comment out the 2 VirtualHost examples by putting a # in front Be sure that NameVirtualHost *:80 doesn’t start with a # sign. * Add the include: include /Users/martijn/Sites/_vHosts/*.conf at the bottom of the file. Save the file, password will be asked. The file should at least have these two lines: NameVirtualHost *:80 include /Users/martijn/Sites/_vHosts/*.conf * ( Replace martijn with your short admin name ) The ~/Sites folder (Users/martijn/Sites) Goto your user Home folder. Create the Sites folder in your user home ( if not exist ) Create inside the Sites folder a folder called _vHosts Create the folder domains inside the ~/Sites folder Create a folder inside the domains folder called processwire ( processwire will be the domain name ) Inside the processwire folder create 2 directories: 1. htdocs 2. logs ( make this writeable by right click the folder and choose Get info ) Create inside the htdocs folder a file called index.html with some content. The folder structure should look like: ~/Sites |`-- _vHosts | `-- domains | `-- processwire | |-- htdocs | `-- index.html | `-- logs Configure PHP Open the file: /usr/local/php5/php.d/99-liip-developer.ini ( This file is the last ini file that gets loaded, so perfectly suitable for your personal settings ) Make your personal changes here. ( setting xdebug.max_nesting_level=1000 for example if needed ) Save the file ( password will be asked. ) Make an alias the this file by right click and choose: Make Alias Name the alias _settings.ini or what ever you want to name it. Move the alias to your ~/Sites folder Create a vHostIn our ~/Sites folder we created a folder named _vHosts. This folder we gonna use for the vHosts. All files ending with .conf in this folder will be loaded when we (re-)start Apache. Create a new file with your favourite text editor. Type the following in the file: ( Replace martijn with your short admin name ) <VirtualHost *:80> DocumentRoot /Users/martijn/Sites/domains/processwire/htdocs/ ServerName processwire ErrorLog /Users/martijn/Sites/domains/processwire/logs/error.log.txt CustomLog /Users/martijn/Sites/domains/processwire/logs/access.log.txt common </VirtualHost> Save the file with the filename processwire.conf in the folder _vHosts The hosts fileGo to the Finder Press: shift + command + g ( Go to folder ) Type: /etc/hosts & press return Open the hosts file with you favourite editor Type 127.0.0.1 processwire below 127.0.0.1 localhost but above 255.255.255.255 broadcasthost Save the file Right click the file & choose: Make Alias Move the alias that you created to your ~/Sites folder Rename it to _hosts The file should look like: ## # Host Database # # localhost is used to configure the loopback interface # when the system is booting. Do not change this entry. ## 127.0.0.1 localhost 127.0.0.1 processwire 255.255.255.255 broadcasthost ::1 localhost fe80::1%lo0 localhost Test the Apache & PHP setup Go to: /Applications/Utilities/ Open: Terminal.app Type: sudo apachectl restart Press: RETURN Type: your admin password Press: RETURN At this point Apache & PHP will be up and running.Go to a browser and type: processwire/ in the address bar and press enter. MYSQL For managing MySQL databases I use Sequel Pro it's a very handy tool and in this tutorial we set the root user password with it. For the SQL server we gonna use the MySQL DMG Archive (x86, 64-bit) Download the following: MySQL DMG Archive (x86, 64-bit) Sequel Pro Open the mysql-5.6.16-osx10.7-x86_64 image * install mysql-5.6.16-osx10.7-x86_64.pkg, MySQLStartupItem.pkg & install the prefPane * if MACOSX complains about: ( mysql-5.6.16-osx10.7-x86_64.pkg” can’t be opened because it is from an unidentified developer. ) You should open your System Preferences, go to Security & Privacy and Allow apps downloaded from: Anywhere Set the root user password Double click the sequel-pro-1.0.2.dmg. The disc image will mount Drag'n'drop the Sequel Pro.app to your /Applications/ folder. Open Sequel Pro Type by name: 127.0.0.1 Type by host: 127.0.0.1 Type by username: root Login Press command + u Select the root user on the left side Fill in the password Press apply We're Done ----- Todo how to use it after the setup is complete
    2 points
  6. First of all: Thank you for all you support during the last month! It took some time but finally my new website is online: http://www.lange-belichtung.com/ It is my first site running PW and I would like to thank for this real alternative to MODx To understand PW I decided to build my own gallery script for easily managing images. Some facts: - using EXIF data to prefill necessary fields (e.g. title, meta description, alt tag, etc) - keeping an original (non-resized) image and adding a "canonical-link" for every smaller copy to reference the original - some images are availabe as wallpaper in different resolutions + resolution recommendation based on your monitor ... I hope you will like it even it is only in German language.
    2 points
  7. I believe in one of the posts about session files not getting deleted Ryan mentioned that the database session handler also relies on the native PHP garbage collection. On some Ubuntu servers, with default settings php gc does not run. Maybe you're on a ubuntu server as well? http://processwire.com/talk/topic/5787-sessions-thousands-of-them/?fromsearch=1
    2 points
  8. Note that by default, the function json_decode() returns an object. If you try to foreach that you will get an error like "Fatal error: Cannot use object of type stdClass as array in...". So, you need to use the 2nd parameter of the function to return an array..e.g. $array = json_decode($jsonstring, true) http://php.net/manual/en/function.json-decode.php Having said that, your json string above results in a deeply nested array (multi-dimensional) which can be a pain to traverse....unless you know about stuff like these Even Better... http://php.net/manual/en/spl.iterators.php http://stackoverflow.com/questions/5524227/php-foreach-with-arrays-within-arrays/5524267 http://www.phpro.org/tutorials/Introduction-to-SPL.html http://www.sitepoint.com/using-spl-iterators-1/ http://codepad.org/A68lcnLZ [demo]
    2 points
  9. I tend to agree with horst on this, but it can make life a lot easier if you learn some basic implementations of ternary operators, depending on how you want to structure your html and php. This can be easier: echo $page->Departure_AUI ? "<div>Aui: {$page->Departure_AUI}</div>" : ""; In my mind it really comes down to whether that div can be left empty, or if it must not be echo'd at all, which depends on your layout. It can also be easier sometimes to build up sections of content in a variable first. $out = ''; $out .= $page->Departure_AUI ? "<div>Aui:{$page->Departure_AUI}</div>" : ""; $out .= $page->Departure_MAG ? "<div>Mag: {$page->Departure_MAG}</div>" : ""; echo "<div id="block-parent">$out</div>";
    2 points
  10. alternatives: http://processwire.com/talk/topic/5640-shortest-way-to-echo-a-field-only-if-populated/ But if I were new to PHP I would write a few chars more and have better readability. EDIT: damn, Kongondo!
    2 points
  11. follow the topic here: http://processwire.com/talk/topic/5286-switching-fields-to-language-fields-produces-fatal-errors/ discussion closed
    2 points
  12. I think apeisa has all the usual suspects covered. I imported 900+ plant species from a CSV yesterday. Each has 3 repeater fields that have around 8 entries each on average. So roughly 21,600 pages. It took a little bit, but it completed in one batch. This is on a pretty solid University of Florida server, so not sure how it would do on a typical shared host.
    2 points
  13. $user = $users->get("test"); $user->addRole("superuser"); $user->of(false); $user->save(); Or if you want to actually do it through the database, you can go into PHPMyAdmin and find the page ID for the user you want to change (from the pages table) and then go to the field_roles table and change the "data" value for that pages_id to 38
    2 points
  14. Each page that is shown is only a template file with fields rendered on it. So, if the front page of this site, the landing page, is meant to be the users home page, then this is not a problem to use just home.php as default. Once a user logs in, then the page will display information relating to that particular user. You can also decide what to display based on role - if a user has a particular role (like admin) then you can just check if they have that role before displaying that information. On the front end of the site, you can display anything you like in any order you like. You do not have to reflect the page tree element for element - people tend to do that simply because it makes it easier to manage, but it is not vital. So. the ROOT of the site is home. (core has nothing to do with anything here - forget about it). Home is your landing page and you can use it for anything. So, you could use it for an entire dashboard which is only shown if a user is logged in, or you can use it for something else. You could write in php if($user->isLoggedin()){ lots of page stuff }else{ login form } All websites have a landing page and, logically, that page is ALWAYS at the top of a tree. Once they are logged in, you can stay on the home page (and home template file) and show them all the bits they need to see on their landing page. Then you can just build stuff under home: Home --Profile ---- Manage ---- Messages ---- My picture ---- My docs -- Company News -- Club ---- Club venues Whatever you need to do. You can either have a top menu that follows the same logic (but perhaps tell it not to display certain elements unless they are logged in) or you can just have a menu in each section that calls information from any part of the tree you like. THIS IS IMPORTANT - when we create menus that follow the tree, you will notice that they ignore the home page initially then add it back on. This means, as far as the front menu is concerned, Home, Profile, Company News and Club would all be on the same level. Even though Profile, for example, is actually a child of Home. So, for your front end, Home is your landing page, and the others are you toplevel main menu items.
    2 points
  15. I've designed my sites in Illustrator for as long as I can remember — I've always preferred it to Photoshop. I use Photoshop for images and pixel perfect elements (which I don't ever create anymore). The nice thing about working in Illustrator all the way through is that you can quickly take the wireframes and start turning them into real comps.
    2 points
  16. oops, You are right! I added the first image from those pages too. $resized_imageWidth = 120; $resized_imageHeight = 0; $session->history = is_array($session->history) ? array_slice(array_merge(array($page->id), $session->history), 0, 4) : array($page->id); foreach ($session->history as $page_id) { $p = $pages->get($page_id); if ($p->template != "basic-page") continue; echo "<img src='{$p->images->first->url}' width='{$resized_imageWidth}' heigth='{$resized_imageHeight}'>" . "<a href='{$p->url}'>{$p->title}</a><br />"; } Thanks again teppo for all the help!
    2 points
  17. Still somewhat ugly, but I'd probably go with something like this: $session->history = is_array($session->history) ? array_slice(array_merge(array($page->id), $session->history), 0, 4) : array($page->id); After that you can output stored data like this: foreach ($session->history as $page_id) { $p = $pages->get($page_id); echo "<a href='{$p->url}'>{$p->title}</a><br />"; }
    2 points
  18. One...you can easily upgrade your software version (e.g. PHP) without waiting for MAMP to upgrade...But am lazy...so I still use XAMPP Martjin. Thanks for this write-up! Very helpful not only for MAC users, but the ideas are applicable to other environments too.
    1 point
  19. I agree completely. I do everything in FW, conservative I am. I never ever present in something different than in the browser - no .pdf, no .png, no nothing. I export my file as HTML + pics from FW to Google Drive and than use Gdrive as a webserver (https://support.google.com/drive/answer/2881970?hl=de). This way I'm done very quickly. And that's it.
    1 point
  20. I'm not sure what is involved in the importer process when getting only a basename. Does it check the current working directory? If yes is this save? I think no. PHP has a function to get the current working direction: getcwd() but if I remember right it is different if running as CLI or running in WebserverEnvironment. Also I don't know if ./filename.typ works. I always want these things robust - bulletproof and therefor I ever use absolute pathes.
    1 point
  21. you need to use the fullpath. As you have said the images are in the same directory like the importer-script you can use: foreach ($gallery as $filename => $description) { $filename = dirname(__FILE__) . '/' . $filename; $p->main_image->add($filename); echo "\tAdded image $filename\n";
    1 point
  22. Like those shown here... http://processwire.com/talk/topic/5640-shortest-way-to-echo-a-field-only-if-populated/
    1 point
  23. I used to find shouting a lot and copious use of a 12-bore worked quite well - does that still apply? Seriously, I think nothing beats being face to face and making a performance out of the presentation. The software is almost irrelevant. I used to work with a chap who reckoned a creative presentation should go something like: Premise Brief Target Solution Benefits Projection Stripper (male or female depending on the client preference) In a way he was right. (Actually, he was very good at this, so he was absolutely right). For instance, your vocal presence has far more potential than any bit of software or technology and learning how to use it will make more difference than anything else to the presentation. If you are not happy with the sound of your own voice, it is really something worth working on - join a local amateur dramatics society or something. So, if you can make the presentation exciting, if you can really draw the client in and make them trust you, then they will take on board your ideas however you present them. One trick sales people used to tell me was that you should NEVER let your client find their way through anything. As soon as they sit down and pay attention, you take them through everything - none of this "well you will find out more as you explore later" stuff, just take them through all the big important stuff and make it sound as exciting as possible. One of the earliest presentation tools was the overhead projector. When power-point gained popularity, I knew several serious sales people (my brother included) who hated it. With overheads, there was this big theatrical thing of whipping off one cell and replacing it with the other. It meant you had to be on your feet, had to move round and grab for things and really get involved with the technology. It was a really great prop that got replaced with a mouse. Oh, one note - I am a terrible sales person (I scare people I think), but I worked with some brilliant ones who were selling my concepts. So back to web briefs, maybe the trick is to use great big print outs to shout and sing about the product, then end the performance by beaming the website onto everyone's mobile phone at once: "And the best thing about this huge, wonderful, singing and dancing concept, is that the entire thing can be neatly packaged up and enjoyed on a mobile phone." Brrrrrr Crash.
    1 point
  24. This Module works in part as a way to set default values for fields (not in Admin, but using a Module). The Module can set default values for simple fields such as Text and Integers on new Pages. It does not work with Page fields and does not work on existing pages. <?php # /site/modules/FieldDefaultValues.module class FieldDefaultValues extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Field Default Values', 'summary' => 'Set default value for specified fields when creating a new Page.', 'version' => true, 'autoload' => true, ); } public function init() { $this->addHookBefore("Inputfield::render", $this, "setFieldDefaultValueBefore"); #$this->addHookAfter("Inputfield::render", $this, "setFieldDefaultValueAfter"); } // Loads every time a page is loaded (whether new or not) // Works for new items only. public function setFieldDefaultValueBefore(HookEvent $event) { // Default values $defaults = array( "foo" => "3:33", "bar" => "2:33", "baz" => "1:33", ); $obj = $event->object; foreach ($defaults as $fld=>$def) { if($fld == $obj->name) { // Set Default values if a value does not exist $obj->value = ($obj->value) ? $obj->value : $def; } } } // Fails (values are not set) public function setFieldDefaultValueAfter(HookEvent $event) { // Default values $defaults = array( "foo" => "3:33", "bar" => "2:33", "baz" => "1:33", ); $obj = $event->object; foreach ($defaults as $fld=>$def) { if($fld == $obj->name) { // Set Default values if a value does not exist $obj->value = ($obj->value) ? $obj->value : $def; } } } }
    1 point
  25. foreach ($gallery as $filename => $description) { $p->main_image->add($filename); echo "\tAdded image $filename\n"; $p->main_image->last()->description = $description; echo "\t\tAdded description: $description"; $p->save('main_image'); // change this line and try out please echo "\t\tSaved.\n"; } Hi Marc, please try it like shown above, this is working for me.
    1 point
  26. Yes, and that's where javascript (jQuery, plain js or other libraries) comes in. On the home page you use PHP and the PW api to list all of the Left column and all of the Middle column, with some correct markup for javascript to do it's magic (step 1). You then use javascript to hide/show the content of the Middle column based on which anchor link is active in the Left column (step 2). The link i posted shows you an example of how to do such a thing. I can't provide you with a copy paste solution, but it in essence just a php foreach (using a PW selector) and some basic jQuery.
    1 point
  27. Now I get it. I was searching for the wrong keywords maybe. Sorry for posting something that has been posted here already.
    1 point
  28. Soma's right you guys, you just need to use json_decode to get it into an array. From there you can foreach through the array and do whatever you want with it. You could even extract the content to add to PW pages for storage if you want. Given kimonolabs limits on the free option, that might be a decent idea. Cache the results in PW. They have a limit of 100 per hour, so even once a minute would be ok.
    1 point
  29. @Marco, thanks for posting this. I just used it to create a feed from a site that wanted to charge my client $50/month to have access to their api; now we can have an api feed from that site using kimono for free. So far it seems to be working really well; it's really quite an amazing app; right now i have gotten as far as reading the json into my processwire site, but i do also need to now figure a way to take this json string and make it into my markup for the output... so i guess i'm a bit stuck in the same place as you are, but if i come up with anything i'll report back.
    1 point
  30. I had to re-read your last post! This is fantastic. Thanks.
    1 point
  31. @nfil: $pages->get($page_id) returns one page and you can't "find" from one page Try adding new row after $p = $pages->get($pages_id) with something like this: if ($p->template != "basic-page") continue;
    1 point
  32. You might want to try what Ryan suggests here: http://processwire.com/talk/topic/1142-lots-of-sessions/?p=30237. Session garbage cleaning isn't currently working on certain systems with default config (more about that here). Garbage cleaning for sessions is always random and it's possible that it just hasn't happened for a while. Hard to say without knowing a bit more about your environment, how often new sessions are created etc. Anyway, above solution shouldn't cause any harm either, so I'd try if it helps.
    1 point
  33. Hi Ralf, If I understand correctly, it should be a simple matter of: if($page->Departure_AUI){ echo "<div>Aui: {$page->Departure_AUI}</div>"; } There are shorter/cleaner ways of doing this, but I think this is the most understandable for someone new to php. Hope that helps!
    1 point
  34. thanks for the great framework. Processwire is just awesome and all the people here are awesome too
    1 point
  35. Pw on Nginx diy: http://processwire.com/talk/topic/4324-how-to-forge-pw-on-nginx-tutorial/ http://www.howtoforge.com/running-processwire-on-nginx-lemp-on-debian-wheezy-ubuntu-13.04
    1 point
  36. Probably you are either hitting the time limit of your php script or then your server runs out of the memory. To avoid time limit issue, put this on top of your script: set_time_limit(0); That might be all you need. But probably you will hit memory issues too, since PW keeps pages in cache. At some point memory issues come - if not with 2000 pages, then probably with 20000 pages or so. That is easy to avoid, just call this at the end of your foreach loop: wire("pages")->uncacheAll(); Also make sure you don't have debug mode on when running this kind of scripts (there will be memory leak, since debug mode logs all queries in memory). I myself like to create this kind of scripts as a command line script. More information here: http://processwire.com/api/include/
    1 point
  37. Ha! A couple of years ago I got a call from a station saying a client had a jingle which needed an edit on it - some old thing they had used for years. So I said to send it over. When it arrived, not only was it some thing I had composed years before for a different client and so was not licenced for them to use, but it had never been licenced for any of the stations they had been on and the singer's licence had run out ten years before. I did quite well out of the ensuing letter from my lawyer...
    1 point
  38. could this possibly be an error on line 157 (note - already posted an issue on github)? @ @param array $options
    1 point
  39. I have tried both Pydio and Own Cloud with clients to try and find out what they prefered. Annoyingly, they almost all said "can't you just email us a link to a zip file? I can never remember my password." Perhaps they are right - we can over engineer this sometimes.
    1 point
  40. Yeah, not too sure about "or else" Sounds a bit threatening!
    1 point
  41. Greetings, I've transplanted most of my Seblod plants to new ProcessWire beds. It's amazing how the nutrients in the soil are depleted in those Seblod beds. Can't really grow anything there. Thanks, Matthew
    1 point
  42. If you guys are using 2.3 or 2.4 you might prefer: $this->wire('key', 'value'); rather than $this->setFuel('key', 'value'); and $this->wire('key'); rather than $this->fuel('key'). The "fuel" terminology is meant mainly for internal use rather than public API. It'll work, but I think it makes code more complex than it needs to be, versus just using that single wire() function for everything.
    1 point
  43. Hi Renobird, I assume you want to customize the breadcrumbs setup by ProcessPageAdd. I used a module for this particular project so it looks something like the below: class YourModule extends WireData implements Module { ... public function init() { $this->addHookAfter('ProcessPageAdd::execute', $this, 'pageAddExecuteAfter'); } public function pageAddExecuteAfter($event) { if($this->fuel('page')->process != 'ProcessPageAdd') return; //build your new breadcrumbs $breadcrumbs = new Breadcrumbs(); $breadcrumbs->add(...); //etc... $this->setFuel('breadcrumbs', null); // I forget if this is necessary, but it works. $this->setFuel('breadcrumbs', $breadcrumbs); } }
    1 point
  44. There's also an API variable (on the admin side) called $breadcrumbs that you can either modify or replace. $breadcrumbs = new Breadcrumbs(); // start with a fresh breadcrumbs list if you want... // $breadcrumbs = wire('breadcrumbs'); // ...or grab the existing copy // then add breadcrumbs to it, here's one example: $breadcrumbs->add(new Breadcrumb($this->config->urls->admin . 'your/path/', "Your Label")); wire('breadcrumbs', $breadcrumbs); // then set it back as an API variable Note that breadcrumbs is just a type of WireArray, so everything from the cheatsheet applies in terms of modifying the contents of it.
    1 point
  45. I found I could listen to ProcessPageList::execute and just overwrite the breadcrumbs, that should do the trick.
    1 point
  46. Bravo Christophe! I am beginning to wonder whether I should write an article not so much about Processwire, but rather why professional sites should not be made using Wordpress. I have nothing against Wordpress - it is an extremely powerful and well supported blogging platform and it is a really great tool for the hobbiest or small company that wants to create their own website without using a developer - indeed, I use it for a couple of my own blogs (though more recent ones have been built with PW) But the other day, while researching competition for a client, I came across a professional website made by an "award winning developer," built on Wordpress. I will be nice and not post the site here. It was a perfectly acceptable website, except that it used a wordpress installation and a ton and a half of wordpress plugins. The list of style sheets and script that the template was resourcing was huge and there were three different versions of JQuery being accessed, The actual site was very simple, but some of the layout was a bit cock-eyed because the client had been editing his own site with the TInyMCE editor and messed up some of the images. The client's web site requirement had been shoe-horned into Wordpress, whether that was appropriate or not, and for me that is just plain wrong. When I compose music for someone's advert, I don't go through my files trying to find an old piece of music that more or less fits the clients brand, I start from scratch and write something that fits their brand, their name and their campaign properly. In the industry I come from, that is what is expected of me. To stretch an analogy to breaking point, Processwire is a piano that you can use to write any song you like. Wordpress is a pianola that can only play the tune that is punched out on the scroll. (And just in case you don't know what a Pianola is: http://en.wikipedia.org/wiki/Player_piano)
    1 point
  47. This is sort-of built in to ProcessWire already on a basic level. If you make a copy of your config.php file called config-dev.php, then that one will take priority over config.php. Just ignore the -dev version in DeployHQ settings, or add it to .gitignore so it doesn't even get committed - up to you. As long as config-dev.php on your local system has your local settings in, and your config.php is treated as your live version, it should be fine
    1 point
  48. This is significantly more scalable and resource friendly than repeaters. It's directly connected to a single DB table without any other overhead.
    1 point
×
×
  • Create New...