Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/16/2016 in all areas

  1. With support for paginated Fieldtypes, ProcessWire’s scalability has moved to the next level. Not sure what this means? Don’t worry, this post has a screencast that makes it clear. We’ve also got some other nice upgrade for ProFields Table. https://processwire.com/blog/posts/fieldtype-pagination/
    6 points
  2. Awesome stuff indeed. Any chance to get drafts and preview of pages in core working for all fields? It's the most requested feature among projects and clients. Many other cms have this out of the box. We are now telling clients since 5 years that it will be maybe possible soon. Now there's ProDrafts and we can't use it cause it's not working for Repeaters, PageTables and so on.
    5 points
  3. @Juergen To setup a cronjob is really easy, but you have to understand some basics first. The cronjob past has nothing to do with ProcessWire. It is a separate program running on your server which is able to run commands at a certain time. It is either configured in your hosting admin panel (easiest, ask your hosting provider) or you can set-up it yourself through the command line. You can follow this example if you're running a Linux based server. You need to understand that you can execute a PHP file from the command line. Teppo has provided us with such a script that will activate the link checker. The file is "/ProcessLinkChecker/Init.php". This is the one the cronjob needs to run. If you are unsure what the correct path is you can ask your hosting provider or login into the shell and navigate to the "ProcessLinkChecker" folder and type "pwd". That will give you the current path. It will be something like: /srv/username/apps/appname/public/site/modules/ProcessLinkChecker/ Combine the path with your new knowlegde from the tutorial and you can set it up. p.s. If you are on Windows you need to create a "Task" in "Windows Task Scheduler". p.s. 2 You don't have to wait to test if the link is working since you can test the script by running: /usr/bin/php /path/to/site/modules/ProcessLinkChecker/Init.php >/dev/null 2>&1 p.s. 3 this whole timing stuff can be pretty confusing so use a tool like crontab.guru. p.s. 4 after proofreading this post now it seems pretty hard , but believe me after a few times you can set it up in a few minutes.
    4 points
  4. It is a caching problem. You have copied cache values (directory pathes) from one computer (your online) to another computer (your local), and file_last_modified timestamps too. But this stored ones from your online mostly will not match to your locals. So you need to clear caches and have to refresh the modules lists. (Maybe better 2 times than only once ) After all the caches are refreshed and the filecompiler builds all fitting to your local computer, all settings in DB should work again. The second thing in your case is the SessionHandlerDB. SessionHandlerDB is an alternative handler fro session management. Now, after you have disabled it the hard way, PW switched to the default session management via files, located under site/assets/sessions/. If you like, you also can switch back to SessionHandlerDB after all other caches (also minor one!) are working perfect again. To switch back, please go to modules and install it via the interface, as you have done when using the first time. (Don't modify the modules table!! this only works the other way round!) ------ --- ------ To avoid those caching issues, you could use the SiteExporterModule, but this would not give you an exact copy of your online site. So, in your case you have done most things right. Only thing what you may try next time could be: make a copy of all site/... files to your local PC modify the site/config.php to point to your local DB get a mysql dump from your online DB modify the mysql dump: remove all entries of the tables "caches, sessions", but only the data value entries, not the table definitions! import the modified mysql dump into your local DB login into admin, go to modules and hit the refresh button one or two times
    4 points
  5. You should do another nice Debugging like you have done with your GET string, to see whats going on: $itemsData = wire()->pages->find("template=portfolio-item"); echo "<pre>"; echo $itemsData InstanceOf PageArray ? "is PageArray\n" : "NOT a PageArray\n"; if($itemsData InstanceOf PageArray && count($itemsData)) { // we have at least one page in the collection, get the first one for testing $p = $itemsData->first(); echo $p InstanceOf Page ? "is Page\n" : "NOT a Page\n"; if($p InstanceOf Page && $p->viewable()) { echo $p->fields->has("$targetGrid") ? "Field $targetGrid exists\n" : "Field $targetGrid does NOT exist\n"; if($p->fields->has("$targetGrid")) { var_dump($p->$targetGrid); } } } echo "\n</pre>"; If you not already know it, here are a nice overview: http://cheatsheet.processwire.com/ PS: instead of $_GET you better should use wire('input')->get->targetGrid, or when in template scope: $input->get->targetGrid. Also don't forget to sanitize input values! $targetGrid = wire('sanitizer')->fieldName( wire('input')->get->targetGrid );
    3 points
  6. Perhaps not particularly helpful (sorry), but to be honest this sounds like something you should always do via an API. If the company hosting those properties intends them to be available to others this way, usually they would provide an API to said content. If they don't, it's possible that they wouldn't like anyone crawling their content either With some quick googling I found some hints that the company behind the actual platform (Immformer) might offer additional features etc. so I wouldn't be too surprised if they offered, either as a part of the platform or as a plugin/addition, some way to export entries. I don't know anything about your client's relation to the site in question and the relation of that site to the platform they're using so it's very difficult to say who you would contact in this case, but anyway: in my opinion the only future-proof, stable solution you're going to find would need co-operation from the management of the NetMakler site and perhaps the provider of the platform they're using. Anything else is, at the very least, very likely to break every time something changes at the site
    2 points
  7. Menu Builder As of 29 December 2017 ProcessWire versions earlier than 3.x are not supported Modules Directory Project Page Read Me (How to install, use, etc..) For highly customisable menus, please see this post. If you want a navigation that mirrors your ProcessWire page tree, the system allows you to easily create recursive menus using either vanilla PHP or Soma's great MarkupSimpleNavigation. In some cases, however, you may wish to create menus that: 1. Do not mirror you site's page tree (hirarchies and ancestry); and 2. You can add custom links (external to your site) to. That is primarily where Menu Builder comes in. It is also helpful if you: 3. Prefer creating menus via drag and drop 4. Have a need for menus (or other listings) that will be changing regularly or that you want to allow your admin users to edit. The issue of custom menus is not new here in the forums. The difference is that this module allows you to easily create such menus via drag and drop in the Admin. Actually, you can even use it to just create some list if you wanted to. In the backend, the module uses the jQueryUI plugin nestedSortable by Manuele J Sarfatti for the drag and drop and is inspired in part by the WP Custom Menu feature. Please read the Read Me completely before using this module. For Complex or highly-customised menus, it is recommended to use the getMenuItems() method as detailed in this post. Features Ability to create menus that do not mirror your ProcessWire Page Tree hierarchy/structure Menus can contain both ProcessWire pages and custom links Create menu hierarchies and nesting via drag and drop Easily add CSS IDs and Classes to each menu item on creating the menu items (both custom and from ProcessWire pages) or post creation. Optionally set custom links to open in a new tab Change menu item titles built from ProcessWire pages (without affecting the original page). E.g. if you have a page titled 'About Us' but you want the menu item title to be 'About' Readily view the structure and settings for each menu item Menus stored as pages (note: just the menu, not the items!) Menu items stored as JSON in a field in the menu pages (empty values not stored) Add menu items from ProcessWire pages using page fields (option to choose between PageAutocomplete and AsmSelect [default]) or a Selector (e.g. template=basic-page, limit=20, sort=title). For page fields, you can specify a selector to return only those specified pages for selection in the page field (i.e. asm and autocomplete) For superusers, optionally allow markup in your menu titles, e.g. <span>About</span> Menu settings for nestedSortable - e.g. maxLevels (limit nesting levels) Advanced features (e.g. add pages via selector, menu settings) currently permissible to superadmins only (may change to be permission-based) Delete single or all menu items without deleting the menu itself Lock down menus for editing Highly configurable MarkupMenuBuilder - e.g. can pass menu id, title, name or array to render(); Passing an array means you can conditionally manipulate it before rendering, e.g. make certain menu branches visible only to certain users [the code is up to you!] Optionally grab menu items only (as a Menu object WireArray or a normal array) and use your own code to create custom highly complex menus to meet any need. More... In the backend, ProcessMenuBuilder does the menu creation. For the frontend, menus are displayed using MarkupMenuBuilder. Credits In this module's infancy (way back!), I wanted to know more about ProcessWire modules as well as improve my PHP skills. As they say, what better way to learn than to actually create something? So, I developed this module (instead of writing PW tutorials as promised, tsk, tsk, naughty, naughty!) in my own summer of code . Props to Wanze, Soma, Pete, Antti and Ryan whose modules I studied (read copied ) to help in my module development and to Teppo for his wonderful write-up on the "Anatomy of fields in ProcessWire" that vastly improved my knowledge and understanding of how PW works. Diogo and marcus for idea about using pages (rather than a custom db table), onjegolders for his helpful UI comments, Martijn Geerts, OrganizedFellow, dazzyweb and Mike Anthony for 'pushing me' to complete this module and netcarver for help with the code. Screens
    1 point
  8. Hi everyone I´m creating an AdminTheme based on Semantic UI framework. Here is the beta version. I 'm fixing bugs. Github here Changelog: 0.0.1 --- Fixed background color / image.
    1 point
  9. Hello, in one of my current projects, we have a test and production stage with their own ProcessWire installations, and we regularly want to migrate template/field configuration to the next stage without migrating content as well. ProcessWire supports this via the import/export functionality in the admin GUI. However we (and some others) would like to do this as part of an automated process. There seem to have been some discussion on this topic and two existing modules that get pretty near our requirements: https://github.com/mindplay-dk/SystemMigrations/blob/master/SystemMigrations.module https://github.com/LostKobrakai/Migrations However, they try to solve more then we need and for mindplay-dk's module, development seems to have discontinued. At that point I decided to build a more simple module with reduced scope that basically just makes ProcessWire's import/export automation-ready. Thanks in advance for trying this out and any feedback! About this Module CAUTION: This module is incompatible with repeater fields and ProFields. The module enables you to transfer template and field configuration from one processwire installation to another in an automated way. Changes to templates or fields are exported to the file system immediately (so they can be added to source control together with changes in the template files) The import script is designed to run from the command line (so it can be invoked from your build/deployment tool). On invocation in import mode, a DB backup is created template/field changes from the persist directory are imported into the DB In restore mode, the import script can restore any of the DB backups previously saved How to Use Make sure the module is installed in the source and destination ProcessWire environments. After installation of the module, you should check if the module's default persistDirectory configuration setting fits your requirements. The module will automatically export all fields, fieldgroups, and templates to JSON files in the directory specified by that setting. Note that the same setting is used by the import script as well, so if you change it, make sure you change it in all affected ProcessWire environments. The JSON files can be transferred to the destination ProcessWire environment. Running the import script from the command line will import template and field data in the destination ProcessWire environment. Manual Installation Caution: Beta software - do not use in a production environment without prior testing and regular back-ups. Caution: This module is incompatible with repeater fields and ProFields. In case automatic installation does not work, get the code at https://github.com/jaromic/pw-autoexport-tf/ and follow the instructions in README.md for manual installation. Manual Uninstall Delete the following files and directories from your module directory: AutoExportTemplatesAndFields/ AutoExportTemplatesAndFields.module Download Install from the module directory, clone the repository via GitHub, or download ZIP.
    1 point
  10. Hi Horst, thanks a lot - this works - and i learned a lot new possibilities .) I am always looking into the cheatsheet & documentation. But iam relatively new to php ... because of that iam often not sure how to interprete what i read there ... i think its time for a basic book about php in general oO Thanks and && byebye Jochen PS: there was missing at semicolon $p = $itemsData->first()
    1 point
  11. I'm not sure I understand what you want, but if you want categories like in wordpress, this is how I did them. I have the above tree. Taxonomies = taxonomies template Genre, Audio = taxonomy template Horror, Parody, Drama etc. = terms template The templates have only the title field. Then for each taxonomy (genre, audio, whatever you need) i created a field of type page, in the input tab choose the corresponding taxonomy for your field under Parent of selectable page(s) and a little lower you have the Input field type option i chose AsmSelect but you can try them out. Now go to the template for the page you want to add the categories and add the field(s) you made. To display them i made a function so they link to an "archive" page. function getTaxonomyTerms($taxonomy, $sep) { $terms = ''; $x = 1; foreach ($taxonomy as $t) { $link = '<a href="'. wire('config')->urls->root . $t->parent->name.'/'.$t->name.'">'.$t->title.'</a>'; // if it's not the last item and a comma $terms .= ($x != count($taxonomy)) ? $link . $sep : $link; $x++; } return $terms; } // used like this echo getTaxonomyTerms($page->genre, ', ') This will link the terms to domain.tld/taxonomy/term i.e. domain.tld/genre/horror The above will not work since I have removed the taxonomies from the url. If this is what you need then i'll explain that part too.
    1 point
  12. Although this is in PHP, and doesn't completely answer my question, I think this is the only possible solution. Posted a question and my own solution on StackOverflow here.
    1 point
  13. Try this: foreach($albums as $album){ // if there's no thumbnail no need to do anything if(!$album->thumbnail) continue; // save srcset tag to a variable $srcset = $album->thumbnail->srcset('thumbnail', 'lazyload my-class inline-block', array('quality' => 80)); $out .="<a href='{$album->url}' class='item {$album->thumbnail->tags} {$album->thumbnail->orientation}'>"; if($album->images){ $out .="<img $srcset alt='{$album->thumbnail->Alt}'>"; } $out .="<div class='item-info'><h3>{$album->title}</h3><h4>{$album->thumbnail->tags}</h4></div>"; $out .="</a>"; } It's written in browser so double check the syntax.
    1 point
  14. Hi @johnteaksf, Welcome to the forums. Currently, it is not possible and I see no easy way of doing it within the module. My suggestion is that you try (and adapt to your needs), the approach outlined on page 7 of this support board, specifically this post or this gist See the example array of the $key => $value pairs you'd be working with here. The important things to remember are that Custom Links will not have a 'pages_id' $key. So, that's one way to identify such links in your loop You will have to code the inclusion of the children yourself
    1 point
  15. I didn't have the chance to use it yet, but https://www.import.io/ seems like an excellent tool. Maybe it works!
    1 point
  16. Google changed its use for Google Maps. Since 22 of June 2016 you no longer can use (embed) Google Maps without a registered api key bound to a domain name (called a referrer by Google) Just for the record: in Googles developer page where you have to register a Google Maps api key, they show a misleading dot after the first forward slash in their example: */.domain.com/* Only when I removed that dot my Google Map in a webshop showed up again. Anyway, read it all here: https://developers.google.com/maps/pricing-and-plans/standard-plan-2016-update
    1 point
  17. Since 2.6.9 we can also take care of Page Numbers and URL Segments: foreach ($templates->find('name!=admin') as $t) { if ($t->allowPageNum != 0) $t->slashPageNum = 0; if ($t->urlSegments != 0) $t->slashUrlSegments = 0; if ($t->slashUrls != 0) $t->slashUrls = 0; $t->save(); } https://processwire.com/api/ref/template/#pw-methods-URLs In addition, we could also move the conditions into the selector:
    1 point
  18. Ooh, ooh, me first! You should grab a template, give it a document, tag and description fields There's no document library module (that I'm aware of), probably because a module isn't needed for something like this. For your task the basic item you are dealing with is a document record. This is a collection of information: URI, description, tags. In ProcessWire the 'page' is the unit that is typically used to store a collection of information. And in ProcessWire, a page isn't necessarily a complete page that visitors view on the website front-end; a page can consist of only a title field, and you will probably use something like this for your tags/categories. The broadened definition of 'page' in PW is one of the things that can be confusing at first for new users. It took me a bit of time to adjust my idea of what a page can be. So as you predicted, you would create a template to use for document records and give it the fields you need. Then you add one page per document under a chosen parent in the page tree. It's up to you whether you make individual document records viewable as individual pages on the website front-end. You might decide you don't need that and only pull in information from the records to display as part of another page (search results or category listings). A great place to start is Ryan's Skyscrapers profile: http://demo.processwire.com/ http://modules.processwire.com/modules/skyscrapers-profile/ Replace the concept of 'skyscraper' with 'document' and you'll see how PW can be used as a document library. I did exactly that for the first website I built with PW: http://ref.dunestrust.org.nz/
    1 point
  19. Now, that's some nice first post to have in the forums, so first of all welcome here. I just wanted to add a word of caution here. The export functionality should work well for core fieldtypes, but 3rd party fieldtypes might not export/import their settings correctly. Especially for more complex (db-wise) fieldtypes like Table or maybe Matrix it's often not so simple to export to a text format. E.g. FieldtypeOptions didn't export it's options for quite some time. Also I'd be cautious with calling modules discontinued, which is, at least for my module, not the truth. Not seeing a weekly changelog is not necessarily a bad thing.
    1 point
  20. If you have to select a lot of images out of a mass, it is of real help, if the images are presented in a way that does not visually show one sort more prominent. It was by no means design what I have talked about. It was definetly about "to get the job done as fast as possible", what can be done way faster if a redacteur does not have to abstract those massive differend presented formats when comparing images against each other. Believe me, also if Pros in that field are able to abstract that a lot faster and better than None-Pros, - after screening 1k or 2k images, they would kiss every one who brings them a more weightened images table for their work.
    1 point
×
×
  • Create New...