Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/14/2014 in all areas

  1. I recently created an ecommerce website, iBuildMacs, that I built with ProcessWire. Given that there's been quite a bit activity on combining ecommerce with ProcessWire, I feel many people would be interested in the approach I took. Feel free to visit it at: http://ibuildmacs.com/ The requirements for this site were: a computer configurator, much like the Apple website; example product page here cart checkout payment methods: paypal or check/cash shipping methods: the cost of shipping is based on a fixed cost that is related to the country being shipped. no live quotes The requirements did NOT include: tax rules inventory management coupons, gift certificates different product types: simple products, variable products, digital/downloadable products, etc. user accounts, address management a fancy ajax driven checkout So, I had a bit of flexibility for this site given the specific feature set. I then thought about how I wanted to develop the site. The options I considered included: WooCommerce: I've built several intricate websites with WooCommerce, the most recent being caviar.com. It was good fit that website, but for iBuildMacs, which has less requirements and a very unique product configurator, which WooCommerce could do but with a tremendous amount of overrides and working backward, I decided this wouldn't but the right fit. Plus, I'm trying to become as WordPress-free as possible. FoxyCart: A ProcessWire favorite, however I wanted to challenge myself a little bit with this site, and also keep things under one roof. Magento, Shopify, (insert some specific heavy or cloud-based ecommerce system you like): No. Overkill and making a product configurator would be a pain. After considering my options, I felt just rolling it entirely with ProcessWire and programming the catalog, payment methods, shipping methods and checkout tailored to the site's specific needs was the way to go. This would definitely reduce the time and headache needed in bending anyone of the above systems I mentioned to behave exactly the way I wanted it to. Products This was one of the complicated parts of the website, but ProcessWire, with its infintely flexible custom fields, made this a breeze. I have a product template (product.php). It has some general fields like Title, Body, Image and Base Price. It also has a PageTable field called Features. These features are child pages of the product and use feature template (feature.php), so the Features PageTable field just grabs its data from there. Then, the feature template has some general fields like Title, Body, Image and PageTable field called Feature Options. These feature options are child pages of the feature template using the feature option template (feature_option.php). So, what I ended up having is a 3 level deep structure, with two nested PageTable fields. Here's a video of what it looks like, which is quite slick is very easy to manage: https://vid.me/kjDW Cart When a user adds a configured product to their cart, it must be stored somehow and I thought of a variety of ways to do this. Ultimately, I decided that cart data is handled as a page (using the order.php template) undernearth /orders/. This order.php template has a page name that is based on the session id of the user, so it'll remain unique and not cause a conflict with other people's carts (as well as obscure from people trying to guess it's url, which is used for the order confirmation page). One of the fields in this order.php template is called "products_ordered", which utilizes the Table fieldtype (a Profields table). Video: https://vid.me/MIRl Checkout The checkout is a straight forward form with the basic questions. However, the shipping section is where it gets tricky. The requirements for this site were that each computer has a fixed shipping price depending on the method being used to ship. The shipping methods available to a customer are dependent on their country. I think WooCommerce could manage rules like that, but directly coding it wasn't that difficult. I create an array that stored the 2 payment methods, and another array that stored the 6 total shipping methods. I also have an array for all the countries. I then wrote some JavaScript that managed the relationships between the country chosen and the shipping methods available for the chosen country. When choosing a method, it will update the Shipping cost line item on the car to the right. Just basic JavaScript going on here. All nice and on one page. When the submit button is pressed, it will run through some logic and validate all the data and save it to the same page that stored the cart data. An order confirmation email is sent to the customer, and one is also sent to the admin (SwiftMailer). If Check/Cash was chosen, the user is then simply forwarded to the order confirmation page, which is at /orders/whatever-their-page-name-was-saved-as/. The email they are sent also has a link referencing this page. If PayPal was chosen, a URI is built and the user is taken to PayPal complete payment with PayPal Payments Standard using the Cart Upload command. Documentation here. After they complete Payment on PayPal, they are then taken to the order confirmation page as described previously. Video: https://vid.me/hwfB I will eventually be using ListerPro for a nicer admin orders list display and build a few custom actions to allow administrators to quickly send general emails from the system (like, when the order is shipped). Modules Used Admin Template Columns: http://modules.processwire.com/modules/admin-template-columns/ Markup Simple Navigation: http://modules.processwire.com/modules/markup-simple-navigation/ Maintenance Mode: http://modules.processwire.com/modules/maintenance-mode/ Batcher: http://modules.processwire.com/modules/process-batcher/ Form Builder (for the contact form only): https://processwire.com/talk/store/category/2-form-builder/ Swift Mailer: http://modules.processwire.com/modules/wire-mail-swift-mailer/ PageTable field type ProFields Table: https://processwire.com/talk/store/category/7-profields/ ListerPro (eventually): https://processwire.com/talk/store/category/9-listerpro/ Enjoy!
    11 points
  2. Hi...just a quick one to let you know that I have this working...rows and columns grow with each new row and column pages or shrink when these are deleted/trashed/hidden/unpublished. I need to do a couple more tests and cleanup the code (remove hard-coded stuff, rename the db table columns to something more generic, e.g. matrix_row and matrix_column, etc) . I also want to make the Fieldtype more configurable - e.g. ability to use a PW selector to find pages to populate rows and column headers (x and y axes). However, not sure if the Fieldtype duplicates what is already available in PageTable? Anyway, here's some screens.. matrix (InputfieldMatrix) db table (FieldtypeMatrix)
    6 points
  3. Just popped out another bootstrap and processwire auto website! Uses the bootstrap carousel for the slider, Google maps marker module and the form templates processor module on the detail page. Also using redirects module and batcher. (Redirects for the sub menu items under inventory to send the user to the search page with the correct query strings.) I also use a cron that reads an inventory csv file and makes or updates processwire pages based on the vin number. http://www.greggorrextreme.com/ Thanks!
    4 points
  4. There's a video from Erika and me in the Portuguese television talking about the muesli project. It's in Portuguese but enjoy https://www.facebook.com/mueslicafe/posts/1552098018335775
    4 points
  5. Hi Marc Here a few things I see that need fixing: $page_id = htmlspecialchars($_POST['select_product']); // page ID You should use (int) instead of htmlspecialchars - that is the safest way to sanitize a page id. You shouldn't overwrite $page, so change: $page = $pages->get($page_id); to: $p = $pages->get($page_id); I think you want: $template = $page->template; // this is the template where we will get the fields from to be: $template = $page->template->name; // this is the template where we will get the fields from That will mean that your hidden field is storing the name of the template, rather than the template object. Also, you are using: $form->processInput($this->input->post); But then still using: $p->template = $input->post->template_name; // set template when you could be using: $p->template = $form->get("template_name"); // set template Hopefully that should get things working for you, although it is only: $template = $page->template->name; that is critical.
    3 points
  6. Hi guys am a complete Noob to Processwire and i have spent the past two weeks reading codes and understanding the structure and concept around it. So i am the type of dev who obesseses about architecture structure before getting to work, and i think my mind is broken due to my limited knowledge on PW. So i will expain my goal. I intend to rebuild http://styljunki.com from Wordpress to Processwire because of two reasons. 1. PW has no templating system meaning no hacks like shortcode or mundane template conventions. 2. Modules dependency meaning i can leverage on existing modules (easily) e.g wire('moduleName')->method this really appeals to me alot However there are certain tasks i want to achieve. Concept of Blog vs Pages There are some contents which are Post and some which are pages, is there some such dinstinction in PW, I know PW manipulates pages and adds fields but what of Blogs which just take entry and nothing special, I tried my hands on the Blog Module on PW 2.5.8 but it threw some errors. Menu Management My Client intends to manage menus and from what i have seen ; PW lists all the pages, we were looking for something where we can simply create menus for the front page and we simply pick those. But if there's a module around I am willing to use/ contribute code if it is neccessary. Custom Post In Wordpress you can create a custom post and query that, is there any similar thing to that ? Unit testing PHPUnit Testing in WordPress was a big joke, is there any link to unit test processwire while we work Thanks this are my questions NOTE: Also i'd really like to say congrats because, I have spent the 4 years of my life developing with CMS from Joomla,WordPress,ImpressPages and really this is the first time i am really excited about a CMS. Working with WordPress as a CMS is a pain in the ass, esp for someone used to MVC frameworks like Zend and Yii. I have searched and searched till i came across your site on CMSCritic and Joss Salinger 's post the rocker blogger (rock on) on how easily he could use it despite no coding experience. I intend to contribute in my way. Keep up the good work guys. Love from Nigeria
    2 points
  7. Cool. I suppose you also know about MarkupSimpleNavigation?
    2 points
  8. @mrkhan, If by child pages you are referring to the children of the pages you have selected in your menu_page page field, then the following (slightly verbose) code should do it. This will create a 2-level menu. For anything deeper use a recursive function - there's plenty right here in the forums. $out = ''; $out .= '<ul>'; foreach($page->menu_page as $item) { $out .= '<li class="top"><a href="#">'. $item->title . '</a>'; if ($item->numChildren) { $out .='<ul>'; foreach ($item->children as $child) { $out .= '<li class="child"><a href="#">'. $child->title . '</a></li>'; } $out .='</ul>'; }//end if child items $out .='</li>'; } $out .='</ul>'; echo $out;
    2 points
  9. @mrkahn - I've yet to see a way to represent nested pages in a multi-page select; it would be interesting if it were possible, but i think it would take some custom module. I guess you could create dummy pages that trigger a new dropdown and then the first item after that is the dropdown parent and then the subsequent items are the children of the first item; then you would need another dummy page to end the subnav; i think that would work, but it seems like a lot of work; I build menus using pages, so this makes it easy to build menus, publish and unpublish menu items, and have as many levels as needed with no extra work. It also allows you to have a custom title for every menu item, set an icon if you want, or classes, or use javascript as the menu item... here's an example site with 3 menus:
    2 points
  10. Sure, I can and I have tested this and it works but let me show you how to do it without repeaters (it's just an unnecessary step in this case IMO)...assuming you want a single level menu. This is for a single level menu Edit and change your page field (menu_page) to be a Multiple pages (PageArray) While still editing it, on the Input Tab, scroll down to Input field type * and select an appropriate input, maybe *AsmSelect. Save Add menu_page to your top-menu template Edit the page 'top-menu' and select your menu pages Output your menu using code similar to below (add code to top-menu.php)..or adjust it if adding to your head.inc (i.e use $pages->get to get the Top Menu page first) foreach($page->menu_page as $item) echo '<li class=""><a href="#">'. $item->title . '</a></li>'; Screenshot
    2 points
  11. Introducing ProcessWire ProFields: Table – it lets you literally define your own Fieldtype! This is one of the most exciting ProFields and it's something very different than any other Fieldtypes. I think it is best described by this screencast (be sure your sound is on): Special thanks to Joss for his great voiceover on this screencast. Please view the video at 720p and full screen if possible. Read more about the Table Field Table is part of the ProcessWire ProFields package now available for purchase in the ProcessWire store.
    1 point
  12. You shall not objectify people, but you could objectify Textfields!!! Github: https://github.com/owzim/pw-fieldtype-yaml Module page: http://modules.processwire.com/modules/fieldtype-yaml/ Summary Field that stores YAML data and formats it as an object, when requested. Setup After installation create a new field, let's say called "people" and assign it to a template, or just edit an existing text-based field and choose Yaml for the type, save! In the Details-Tab you have an additional option, the Texformatter option is removed, because it does not make sense in this case. Parse as Default is WireArray/WireData, the data can also be parsed as Object or Associative Array. Associative Array is the fastest and the default output by the used Spyc parser, WireArray/WireData might be the slowest, but it's also the most feature rich. You can access properties like you are used to with pages or fields, like $page->person->get('title|name') or $page->people->find('age>30'). Usage Now, in your just created field you can put in some YAML like this: - name: Jane Doe occupation: Product Manager age: 33 hobbies: - running - movies - name: John Doe occupation: Service Worker age: 28 hobbies: - cycling - fishing In your template, or wherever you are accessing the page, you would use it like any other ProcesssWire data (if you set the parse option to either WireData or Object): $out = ''; foreach ($page->people as $person) { $out .= "Name: {$person->name} <br>"; $out .= "Occupation: {$person->occupation} <br>"; $out .= "Age: {$person->age} <br>"; $out .= "Hobbies: <br>"; foreach ($person->hobbies as $hobby) { $out .= "- {$hobby} <br>"; } $out .= "--- <br>"; } echo $out; More info about YAML: Complete idiot's introduction to YAML Specification Wikipedia Acknowledgements I've used a namespaced version of the Autoloader class from Template Data Providers The YAML parser is a namespaced version of Spyc Edit: updated the repo link
    1 point
  13. Needed to show someone how to quickly setup some settings for various things in a simple text area: could be used for slider settings, site settings, etc; What it does: gives you a matching variable for each key of each line... 1.) setup a textarea field for the settings ; i'm calling it settings_ta 2.) add delimited settings, 1 per line; i use a pipe (|) delimiter; example: address|some info here facebook|https://www.facebook.com twitter|https://twitter.com phone|(999) 999-9999 3.) in your _init.php, get the settings - replace the page number and the name of your settings field: $settings_ta = $pages->get(1644)->settings_ta; $settings_lines = explode(PHP_EOL, $settings_ta); foreach($settings_lines as $settings_row) { $settings_pair = explode('|', $settings_row); ${trim($settings_pair[0])} = trim($settings_pair[1]); } more condensed version, for those of you who like brevity... foreach(explode(PHP_EOL, $pages->get(1644)->settings_ta) as $settings_row) { $settings_pair = explode('|', $settings_row); ${trim($settings_pair[0])} = trim($settings_pair[1]); } now you can do this in your templates: echo $address; echo $facebook; echo $twitter; echo $phone; Edit: made the code simpler....; 2nd edit - added trim to support using ace editor with tabs Addendum: as an added convenience, you could use the Ace text editor module which would give you a monospaced text field and the ability to use tabs for your settings, which could be more readable and easier to edit. The code has been updated to support this by trimming the exploded strings prior to generating the variable/value. address | some info here facebook | http://www.facebook.com twitter | http://twitter.com phone | (999) 999-9999
    1 point
  14. I have been seeing slower and slower response times on Processwire and Drupal sites on my local Xampp server for a while now. Just spent a couple of hours searching for some hints/fixes. Thought I would share this here as the answer I found that worked for me was reported on Wampp as well and using Joomla and Wordpress so seems to be across the board. I am running Windows 8.1 64bit. That seems to be where the issue stems, and has to do with a bug in that operating system with how they handle IPV6 first then fallback to IPV4. The way this manifests is frequent calls to the database being repeated, increasing server response times. So the fix is as follows. In phpMyAdmin\config.inc.php change $cfg['Servers'][$i]['host'] = 'localhost'; to $cfg['Servers'][$i]['host'] = '127.0.0.1'; This one I did not actually need as Xampp had that already, but according to the thread I found Mampp did need it. Next uncomment bind-address="127.0.0.1" in mysql\bin\my.ini And finally the real culprit, in Processwire site\config.php change the database configuration from $config->dbHost = 'localhost'; to $config->dbHost = '127.0.0.1'; This same applies for any CMS config file that connects to a MySQL database. (Maybe even any other database too as the issue is with OS) And hey, WOW!! my local dev sites are running way faster now. Hope all that is clear, and useful if anyone else is seeing slow response times locally. Just in case here is my current setup details. Windows Version: Windows 8 Enterprise 64-bit XAMPP Version: 1.8.3 Apache/2.4.7 (Win32) OpenSSL/1.0.1e PHP/5.5.9 MySQL Community Server (GPL) 5.6.16 libmysql - mysqlnd 5.0.11-dev phpMyAdmin Version information: 4.1.6
    1 point
  15. Validation Module for ProcessWire, Validation module using GUMP standalone PHP data validation and filtering class. That makes validating any data easy and painless without the reliance on a framework. Usage almost same with original GUMP validation class. Extended original validation class for make it multi-language and added 2 new function 1 for field labels, 1 for set and get fields. Module Link
    1 point
  16. Hi all, This one is special because it's for a project of ours, Erika and mine. http://muesli-cafe.com/ We are starting a crowdfunding campaign to open a breakfast place in Porto where we will serve muesli. This is quite a bold attempt because muesli is not common at all in Portugal and it will take a good communication effort from our part. We will need all the help we can get, if you guys want to contribute here's the project's crowdfunding page http://ppl.com.pt/en/prj/muesli-cafe-porto and you will be all welcome to Porto to taste our delicacies It will be great if we make it
    1 point
  17. Because of the $, $download_counter is a variable here. You’re not accessing the page field “download_counter”, but a field by the name of whatever that variable contains. You should also disable output formatting before modifying a field. Use $page->setOutputFormatting(false) or $page->of(false). Lastly, it’s possible to save just the field by calling $page->save('download_counter'). Untested: wireSendFile($page->download_file_link); $page->of(false); $page->download_counter = $page->download_counter + 1; $page->save('download_counter'); $page->of(true);
    1 point
  18. Perfect, $page->sort fits my need. Thank you very much!
    1 point
  19. I take it you don’t want to show the date the page was created? That would be $page->created. $page->sort gives you the zero-based sort index, but it’s only unique in relation to the parent. This might be the closest to your requirement. $page->id is not necessarily consecutive and starts at 1000, but it’s unique site wide. I believe ProcessWire doesn’t reuse deleted IDs, so they should reflect the order of page creation. However, every new admin page and repeater item will increase this number. Do with that what you will.
    1 point
  20. Some want the readers to go to the website and publish only the summary, most commonly because of publicity.
    1 point
  21. Thanks. But this script isn't used, so it's kinda leftover.
    1 point
  22. Thanks for the contribution. I used YAML in past PHP projects outside of ProcessWire a lot and found it very useful. Great to see now support in PorcessWire for it. I also used initially SpyC but found its parsing not as robust and compliant and subsequently switched to Symfony's Yaml component which I found a better parser. For example Spyc does not support correctly anchors with newline folds > (item: > &anchor). Migrating from SpyC to Symfony\Yaml is easy, just replace Spyc::YAMLLoad($sourceFile); with Symfony\Component\Yaml\Yaml::parse($sourceFile);. Should you decide to migrate to the Symfony compnent, use the 2.0.* branch of Symfony\Yaml which still does support mixing list and associative array elements which the 2.1.* branch does not allow any more despite it being correct YAML syntax. If you use composer "require": { "symfony/yaml": "2.0.*" }, will pull in the correct Yaml library.
    1 point
  23. Nicely done. One little recommendation I have on the frontend is to utilize Slick Carousel instead of Bootstrap's carousel. It's much more powerful and has touch support, among many other features. I will eventually be switching some carousels I've done in the past to it. Zurb Foundation also recommends it now instead of their built in carousel (Orbit Slider, which is being deprecated). - Jonathan
    1 point
  24. This module Fieldtype Image Extra (multi-language) should be able to handle that I should think: http://mods.pw/82 Support: https://processwire.com/talk/topic/7910-module-fieldtype-image-extra-multi-language/
    1 point
  25. You can add as many pages as you want. Try it. There is no limit. I was just using 4 as an example... . You can order them the way you want. Depending on how you setup the menu_page field under Input Tab -> Selectable Pages, you can limit the pages that are selectable as menu items. By limit here I mean you could limit them to child pages of a particular parent, or pages using a particular template, etc (I don't mean a limit on numbers!)
    1 point
  26. Can you confirm if your page fields are for single or multiple pages? If multiple and if you have set up as shown in the screenshot below, then you need to nest yet another foreach! If you really want to continue using repeaters for this then you probably want to write a recursive function to output your menu. Is this your setup? If yes, you would need to loop through $menu_item as well...
    1 point
  27. I assume you have a special template for /functions/ and you have set up your config.php to auto-append _main.php. You can exclude templates from auto-appending and auto-prepending in the “files” tab of the template settings. If auto-append is active, there will be a checkbox called “Disable automatic append of file: _main.php”. Regardless, it’s always a good idea to die() as soon as possible. In your case, I would advocate putting a die() at the end of each if ($command ...) block, unless there’s something you need to do afterwards. Probably a good idea to use a switch, too, then.
    1 point
  28. Macrura, thanks for testing/using the module. The current master branch only uses WireData on object like structures and regular arrays for numeric key structures. I renamed the module to FieldtypeDataStructrue (because it now supports more than YAML) and have a separate repo for that, what you want is all there on the dev branch. Check it out, I added a bunch of features (including your wanted WireArray output and a couple of new input/structure types, beside YAML) and the whole thing is unit tested, so it SHOULD be pretty stable: https://github.com/owzim/FieldtypeDataStructure/tree/dev More detailed info on the new version: https://github.com/owzim/FieldtypeDataStructure/blob/dev/README.md For now you should create a new field and not change the fieldtype on your existing one to the new FieldtypeDataStructrue I think it now became pretty powerful, I am planning to make a video to cover it and all it's possible use cases. Please (all) share your thoughts on how else it could be used.
    1 point
  29. Part III: Using YAML (part of structured data module). 1.) Install the module (make sure to install the new version, FieldtypeDataStructure) 2.) create the field for it (ex. settings_ds) 3.) Add some settings - these can be more sophisticated/nested than the settings above, because of the YAML structure options: - name: address street: 27 Hawthorne Lane city: New York state: NY zip: 10982 phones: main: (999) 888 9874 fax: (555) 548-5647 - name: social_media facebook: https://www.facebook.com twitter: https://twitter.com - name: global site_title: My Awesome Site tagline: Tulips Rule 4.) Get the field into your template: $settings_ds = $pages->get(1644)->settings_ds; 5a.) Option 1: Auto populate the $vars foreach($settings_ds as $setting) ${$setting->name} = $setting; 5b.) Option 2: Query the field with PW selectors (this is awesome): $address = $settings_ds->get("name=address"); $social_media = $settings_ds->get("name=social_media"); $global = $settings_ds->get("name=global"); this is cool because you can keep all the parts of a setting together as a group, and have multiple parameters like this: // address echo $address->street; echo $address->city; echo $address->state; echo $address->zip; echo $address->phones->main; echo $address->phones->fax; // social media echo $social_media->facebook; echo $social_media->twitter; // global echo $global->site_title; echo $global->tagline;
    1 point
  30. Part II: Using a Profields Table [Note: this part requires you to own ProFields] 1.) Setup a field of type table for settings, I call it settings_table. It will have 2 columns, setting and value 2.) add it to your template (example would be if you had a settings template). 3.) Add some settings.. | site_title | My Great Site | |------------|-------------------------| | phone | (666) 777-8888 | |------------|-------------------------| | slogan | Tulips Rule | |------------|-------------------------| | facebook | http://www.facebook.com | 3.) Place this code in your _init.php or wherever you have global stuff.. replace the page number with the appropriate page number: $settings_table = $pages->get(1020)->settings_table; foreach($settings_table as $row) { ${$row->setting} = $row->value; } now you can do this: echo $site_title echo $phone echo $slogan echo $facebook - - - ...and one might wonder, what is to prevent a client from inadvertently changing the setting name or even deleting a critical setting and consequently breaking their site? with some jQuery, and the help of admin custom files (courtesy of martijn-geerts) you can disable any existing setting name from being edited. or deleted; add this to your AdminCustomFiles/ProcessPageEdit.js file: $(function(){ $('li.Inputfield_settings_table tr').each(function(){ setting = $(this).find('input[name*="_setting"]'); value = $(this).find('input[name*="_value"]').val(); icon = $(this).find('i.InputfieldTableRowDeleteLink'); if(value) { setting.addClass("disabled").attr('readonly', true); icon.removeClass("InputfieldTableRowDeleteLink fa-trash-o").addClass("fa-lock"); } }); }); this does assume that the table is named settings_table, the setting column is named "setting" and the value column is named "value". you can also add this to your AdminCustomFiles/ProcessPageEdit.css li.Inputfield_settings_table tr input.disabled { background-color: #e8e5e5 !important; color: #949494!important; } Here is a screenshot of this in action: Edit: added instructions to protect the settings names, prevent deletion, and change the color to differentiate the field status.
    1 point
  31. Okay, I will address the Pages issue - I am somewhat famous for it! To start: https://processwire.com/talk/topic/2296-confused-by-pages/ And once you have that out of your system, here is the real info. Basically, a page in Processwire is just a container for content - nothing more. So, it could be a: Web Page News Bullitin Block of info Some strange widget An option for a dropdown selector A gallery item A review Something that gets stuffed into something else! A parent of some other group of pages, A child of something Basically, it is just an item that is created using the criteria of a template. It does not need to have a template file associated with it - if you are using it as a simple option in a drop down, what would be the point? Fields from a particular page can be called into another template or page or anything else, either singularly or rendered as a group. The contents of a page need a template file to be displayed on the site as they are, but not if they are being displayed by something else. Confused? The bottom line is don't think of a page as a "page" that you would get in Wordpress - just think of it as a container for data that can be used for anything at all. This is why Processwire is a TRUE content management system - because all the elements are simply tools to help you manage content, they do not force you to make your content any particular shape.
    1 point
  32. Hi Juergen - you can enter a Label for the template and that will be used instead of the template name.
    1 point
  33. Check the entry $config->userAuthSalt in your site/config.php file. This hash must be identical with the one on your live site.
    1 point
  34. I use transmit, then mount the FTP server on my desktop as it is a local drive. Then you can work with FTP just as you would have done on your local drive. Edit an image on FTP, no problem, just open the file in Photoshop and press save. Want to edit a MS Word file on FTP, browse to the file, open it, edit and press save. You get the idea.
    1 point
  35. What I do is use $config->js to populate the config array that I then output in the head for dynamic variables that want to share in a script. $config->js("myconfig", array("myajaxurl" => $pages->get(1991)->url); You can do this in templates or modules doesn't matter as long as it's before rendering page. Then this little to output as json. This is the same as PW uses in the admin to share config vars with js. <script type="text/javascript"> <?php // output javascript config json string to html // for use in javascripts from this point on $jsConfig = $config->js(); $jsConfig['debug'] = $config->debug; $jsConfig['urls'] = array( 'current_url' => $page->url, 'root' => $config->urls->root, ); ?> var config = <?php echo json_encode($jsConfig); ?>; </script> Then use in your script as var rootUrl = config.urls.root; for example
    1 point
  36. Ok, finally fixed it. I realised the second foreach loop needed to be way down the code. Once I figured out my list of brackets, semi-colons, quotation marks etc etc it worked Here's my code <?php $updates = $pages->find("template=blog-post, blog_tags=Studio Watch");//Get blog posts tagged Studio Watch echo"<section id=\"cd-timeline\" class=\"cd-container\">"; foreach ($updates as $update) { echo"<div class=\"cd-timeline-block\"> <div class=\"cd-timeline-img\"> <img src=\"img/cd-icon-picture.svg\" alt=\"Picture\"> </div> <div class=\"cd-timeline-content\"> <p>{$update->title}</p>";{ echo "<i class=\"fa fa-tags\"></i>"; foreach ($update->blog_tags as $t) { echo "{$t->title}"; } echo"<span class=\"cd-date\">Jan 14</span></div></div>" ;} } echo"</section>"; ?>
    1 point
  37. No problem, and yes I agree with everything you say. The point of this "fix" was specifically for Windows 8/8.1 OS not anything else, where 'localhost' is legitimate and causes no issues. When I said culprit I meant the actual thing that fixes the issue. This is a bug in Windows 8/8.1 only as far as I have been able to find out.
    1 point
  38. Surely say the learning curve is neglible? I mean apart from understanding how the Finder works and some basic navigation of the directories, there can't be much to learn. BTW I'm actually a Mac and PC man myself. Been building my own PCs for years (for gaming). I've nothing against PCs but think Windows is a nightmare.
    1 point
  39. Table Use this for tabular data, like rate tables or other things that you might typically represent in a spreadsheet. Use it for situations where you don't need the full-blown flexibility of repeaters, as it's technically more efficient with far less overhead than repeaters. Something like the Events Fieldtype could be very easily re-created via a Table field, but the potential uses are far broader. But for the most part, think tabular data when it comes to the Table field. Multipliers This is good for when you need a range of values (whether text, textarea, numbers, dates, etc.). If you are using repeaters with just one field in them, you might be a lot better off with a Multiplier. Like the Table field, Multipliers are very efficient and low overhead relative to something like Repeaters. Use Multipliers when you need to repeat a single input multiple times, optionally with a min and max number of inputs. Lets say you are building an employee directory, and each employee has between 1 and 3 email addresses. Rather than using 3 separate email fields, you would use 1 multiplier field and specify min=1 and max=3. Repeaters These are infinitely flexible in terms of what they represent, but each row of values is technically a page in the system. As a result, with the flexibility comes significant overhead. This is really only an issue when the quantity of repeater items gets high, or when you have lots (thousands) of pages using repeaters. I recommend repeaters for setting up things like homepage carousels. For example, if you go to the Villas of Distinction homepage, there are 3 separate repeaters in use on that page, each holding a photo, title, description, link. The client can have as many items in each of those sections as they want. Currently it looks like the first repeater as 6 items, the 2nd has 2, and the 3rd has 6. The possibilities of what can be represented with repeaters is endless, but look for potential alternatives when dealing with large quantities (whether large quantities of repeater items, or large quantities of pages using repeaters). PageTable This is one of the ProFields that is available for free (thanks to Avoine sponsorship) on the ProcessWire dev branch. Meaning, it'll be available for everyone to use as part of the core in ProcessWire 2.5. And you can use it now if you don't mind running the dev branch. PageTable has all the flexibility of repeaters, but with lower overhead from the admin/input perspective. Rather than trying to bundle all the inputs on one screen, PageTable shows you a table of items and you click on the item to edit it in a modal window. This enables it to be a lot more efficient from the admin UI perspective. It's also more flexible than repeaters are in terms of where you store your items. PageTable lets you choose where they should live, whether as children of the page being edited, or as children of some other parent page you designate. They might be a little more work to setup than repeaters, but I think that most situations where you need the flexibility of repeaters may be better served by PageTable. PageTable still can't compete with the speed and efficiency of Table or Multiplier, but consider using PageTable anywhere that you might have used Repeaters before. Repeaters and PageTable are fundamentally different from the admin UI/input perspective, so you'd want to compare them yourself to see what suits your individual input needs better. PageTable involves more clicking to create and edit items, making Repeaters potentially faster for entering data rapidly. But PageTable will scale much further in the admin UI than Repeaters will, so I would personally favor PageTable in more situations than Repeaters.
    1 point
×
×
  • Create New...