Jump to content

Search the Community

Showing results for tags 'Module'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

  1. Get it from GitHub Setup Just put the module in you modules directory and install it via admin. Intro This module might come in handy if you like to keep your templates clean and free of unreadable and unmaintainable string concatenations and even free of any logic. It also comes with some handy features besides just embedding JS, CSS and image assets, see below. Yikes! <link href="<?php echo $config->urls->templates . 'styles/foo.css'; ?>"> <link href="<?php echo $config->urls->templates . 'styles/bar.css'; ?>"> <script src="<?php echo $config->urls->templates . 'scripts/foo.js'; ?>"></script> <script src="<?php echo $config->urls->templates . 'scripts/bar.js'; ?>"></script> <img src="<?php echo $config->urls->templates . 'images/sky-scraper.jpg'; ?>" alt="Some huge building"> <img src="<?php echo $config->urls->templates . 'images/owzim.jpg'; ?>" alt="Handsome!"> Way cleaner <?php echo $asset->css('foo'); ?> <?php echo $asset->js('foo'); ?> <?php echo $asset->img('sky-scraper.jpg', 'Some huge building'); ?> or with short syntax <?= $asset->css('bar') ?> <?= $asset->js('bar') ?> <?= $asset->img('owzim.jpg', 'Handsome!') ?> And prettier if you're using Twig {{ asset.css('foo') }} {{ asset.css('bar') }} {{ asset.js('foo') }} {{ asset.js('bar') }} {{ asset.img('sky-scraper.jpg', 'Some huge building') }} {{ asset.img('owzim.jpg', 'Handsome!') }} Usage JS example Let's use the js method an its configuration as an example, and assume we have the following files located in /site/templates/scripts - index.js - index.min.js - main.js $config->blick = array( 'jsPath' => $config->paths->templates . 'scripts', 'jsUrl' => $config->urls->templates . 'scripts', 'jsMarkup' => '<script src="{url}"></script>', 'jsDefault' => 'markup', 'jsVersioning' => true, 'jsVersioningFormat' => '?v={version}', 'jsMin' => true, 'jsMinFormat' => "{file}.min.{ext}", ); $asset = $modules->get('Blick'); $asset->js('index')->url; // returns /site/templates/scripts/index.min.js?v=1426170460935 // 'min' and version parameter added, which was fetched from the file modified date $asset->js('main')->url; // returns /site/templates/scripts/main.js?v=1426170460935 // without 'min', because there is no main.min.js $asset->js('main'); // returns <script src="/site/templates/scripts/main.js"></script> // because 'jsDefault' is set to 'markup' // you can also access it explicitly via $asset->js('main')->markup $asset->js('http://code.jquery.com/jquery-2.1.3.js'); // returns <script src="http://code.jquery.com/jquery-2.1.3.js"></script> // nothing is modified here, because it's a remote url You can use the file name with or without extension. Adding a version parameter only takes place, if jsVersioning is set to true, it's a local file and it exists. Modifying the file name to include min only takes place, if jsMin is set to true, it's a local file and it exists. The same applies for the $asset->css('file') method: $config->blick = array( 'cssPath' => $config->paths->templates . 'styles', 'cssUrl' => $config->urls->templates . 'styles', // and so on ... ); IMG example the img method lets you include images, crop and resize them, without them having to be a page image. $config->blick = array( 'imgPath' => $config->paths->templates . 'images', 'imgUrl' => $config->urls->templates . 'images', 'imgMarkup' => '<img {attrs} src="{url}" alt="{0}">', 'imgDefault' => 'markup', 'imgVariationSubDir' => 'variations', ); $asset = $modules->get('Blick'); $asset->img('sky-scraper.jpg')->url; // returns /site/templates/images/sky-scraper.jpg $asset->img('sky-scraper.jpg', 'Some huge building'); // returns <img src="/site/templates/images/sky-scraper.jpg" alt="Some huge building"> // any arguments following the filename are passed as an array // in this case the alt value is the 0th argument, so {0} get's replaced // you can set as many arguments as you want in 'imgMarkup' $asset->img('sky-scraper.jpg')->size(100, 100)->url; // returns /site/templates/images/variations/sky-scraper.100x100.jpg // the resized image is put into a subdir 'variations' as configured in 'imgVariationSubDir' // if 'imgVariationSubDir' is left empty, the variation will be put in the same directory $asset->img('sky-scraper.jpg', 'Some huge building')->attr('title', 'Some huge building'); // returns <img title="Some huge building" src="/site/templates/images/sky-scraper.jpg" alt="Some huge building"> // the resized image is put into a subdir 'variations' as configured in 'imgVariationSubDir' // if 'imgVariationSubDir' is left empty, the variation will be put in the same directory You can also setup predefined variation settings in imgVariations $config->blick = array( 'imgVariations' => array( 'header' => array( 'width' => 960, 'height' => 360, 'options' => array( 'suffix' => 'header', ), ), 'person' => array( // and so on ... ), ), ); And call it like so: $asset->img('sky-scraper.jpg')->variant('header')->url; // returns /site/templates/images/variations/sky-scraper.960x360-header.jpg $asset->img('sky-scraper.jpg')->variant('header', 50)->url; // returns /site/templates/images/variations/sky-scraper.480x180-header.jpg Attributes example Since version 0.4.0 you don't need to create arbitrary variable placeholders, if you want to use attributes only. Now you can use the {attrs} placeholder and set the attributes via $asset->attr('name', 'value'). The name argument can also be multiple names, split by a pipe |. $config->blick = array( // ... 'imgMarkup' => '<img {attrs} src="{url}">', // ... ); $asset->img('sky-scraper.jpg')->attr('alt|title', 'Some huge building'); // returns <img alt="Some huge building" title="Some huge building" src="/site/templates/images/sky-scraper.jpg" > Using files that are not in the configured directory If you want to include files, that are neither in the configured directory nor in one of its sub directores, just use an absolute path (actually, relative to your /site directory. $asset->js($config->urls->SomeModule . 'scripts/file-in-root'); Autoload the module If you don't want to include the module manually via $assets = $modules->get('Blick'); you can set it to be autoloaded under a custom name: $config->blick['autoloadAs'] = 'fiddle'; Now it becomes automatically available in your templates under the name fiddle $fiddle->css('foo'); $fiddle->js('foo'); $fiddle->img('baz.png', 'qux'); Please note, that, if you're using the TemplateTwigReplace.module you will have to add your chosen autoload name to the Auto-import fuel list on the module's config page. See config-example.php for all configurable settings. Change Log 0.5.0 add optional scale argument to variant-method: $asset->img('foo.jpg')->variant('header', 50) 0.4.0 add possibility to get/set and render attributes (see section Attributes example) 0.3.0 add $asset->variant('name') alias for $asset->getVariation('name') 0.2.0 fixes and internal refactorings 0.1.0 initial version
  2. Hi everybody, First of all: Thanks to everybody for keeping the community alive. Every time I search for something in the forum I find the solution. Great work! I wanted to share a small module with you / my first one. I use it in order to switch the user language on page load. Processwire GeoInfo GeoInfo is a small module that Implements Geoplugin PHP web service. Please donate to "geoplugin.com" in order to keep the service alive. The Module ads two methods to retrieve data from the web service. $page->GeoInfoIP('IP ADDRESS'); you can enter the ip address manually. If left blank the server remote address will be used. The retrieved data is then stored to the active session, in order to limit the requests. The web service gives back following data. 'geoplugin_request' 'geoplugin_status' 'geoplugin_credit' 'geoplugin_city' 'geoplugin_region' 'geoplugin_areaCode' 'geoplugin_dmaCode' 'geoplugin_countryCode' 'geoplugin_countryName' 'geoplugin_continentCode' 'geoplugin_latitude' 'geoplugin_longitude' 'geoplugin_regionCode' 'geoplugin_regionName' 'geoplugin_currencyCode' 'geoplugin_currencySymbol' 'geoplugin_currencySymbol_UTF8' 'geoplugin_currencyConverter' for e.g. $page->GeoInfoIP('IP ADDRESS')->geoplugin_countryCode; will give back the country iso code. $page->GeoInfoLatLong('LAT', 'LONG'); Enter Latitude and Longitude in order to get following information: 'geoplugin_place' 'geoplugin_countryCode' 'geoplugin_region' 'geoplugin_regionAbbreviated' 'geoplugin_latitude' 'geoplugin_longitude' 'geoplugin_distanceMiles' 'geoplugin_distanceKilometers' for e.g. $page->GeoInfoLatLong('40.712784', '-74.005941'); will give back the city name "New York City". Todo store places in json file / check if place exists implement nearby "service" https://bitbucket.org/pmichaelis/processwire-geoinfo
  3. Hi, it looks that only minimum of people there care about this. If the PW's license is GPL v2, what license the module is allowed to be? E.g. if I derive Pagefile class, may the derived class be licensed under MIT (or any other), or it must also be under GPL v2 license? Thanks
  4. MarkupTagcloud The module generates a simple tagcloud based an page references as tags and a default template. Settings and template can be easily changed to fit your needs. Version 0.5.2Download Processwire module page: http://modules.processwire.com/modules/markup-tagcloud/ Bitbucket Repo: https://bitbucket.org/pwFoo/markuptagcloud/ Usage Readme fileExample output <ul> <li class="tag3"> <a class="tag3" href="/pw/tags/mytag/">myTag</a> </li> <li class="tag1"> <a class="tag1" href="/pw/tags/tag123/">tag123</a> </li> <li class="tag2"> <a class="tag2" href="/pw/tags/hello/">Hello</a> </li> <li class="tag2"> <a class="tag2" href="/pw/tags/tagged/">Tagged</a> </li> <li class="tag1"> <a class="tag1" href="/pw/tags/template/">Template</a> </li> <li class="tag1"> <a class="tag1" href="/pw/tags/template2/">Template2</a> </li> </ul> Tagcloud / list can be styled by css via weight / class.
  5. Hi everyone, I want to use the core module PagePathHistory in a Processwire instance with multi-language URLs/page names activated through the core module LanguageSupportPageNames. From looking at that old Post by Ryan I was pretty sure that it should work without any problems and was surprised that actually it doesn't. PagePathHistory only saves entries to it's DB table when the page name in the main language changes, not when any of the other language names change. Looking at the code this is no suprise as PagePathHistory only hooks Pages::moved(), Pages::renamed() and Pages::deleted(), none of which would be triggered by a change in a language page name. Starry-eyed I started to implement the missing language-awareness in the module, how hard can it be, eh? ...pretty quickly it turned out that this isn't that simple, so I decided to first ask for some help and guidance. Does anyone maybe already work out a solution for this particular problem or something similiar? The problem with the implementation is that after saving a page with changes to language names, there still has to be a means of accessing the old names. For the default language name this is pretty simple because it's saved as $page->namePrevious. For language names the module would have to deposit the original names for later to build the PagePathHistory-URLs. I've been looking through all hookable functions in core classes/modules but haven't found the best place to hook into to implement this functionality. Does anyone have an idea where this would be done best? Any help is appreciated. Thanks a lot in advance Marc
  6. I've a huge problem after installing updates in my processwire installation. As you can see in the screenshot, everything is labeled "array"! I'm on the "dev" git branch with theses site modules installed: - AllInOneMinify - ProcessTemplateEditor Thanks
  7. ------------------------------------------------------------------- LanguageFieldTabs is now included in ProcessWire by default (version 2.4). Unless you are using version 2.3 DO NOT install this module, instead navigate to Modules and then core and you will find the module in the Language section ------------------------------------------------------------------- LanguageFieldTabs Beautify and organize you Field Languages into tabs! DOWNLOAD - Github DEFAULT UI UI IN "UNIFY" ADMIN THEME Sorry for the lack luster write up, will add to Modules Directory later, late, long day tomorrow. Enjoy! (very much beta maybe alpha, minimal testing, just quick evening idea at this point). Changelog v1.0.2 Improved styling capabilities (added surrounding class "LangTabsContainer" ) Added admin wide support Fixed description text order (was being pushed to bottom) v1.0.3 Added support for toggling tabs display and faded labels to represent empty fieldsv1.0.4 Fixed tabs destroy error Moved toggle into Inputfield ui-widget-header
  8. Like I mentioned in another topic I'm working on a theming system for Processwire. Today I finished a huge step in the right direction: A theme switcher. How does it work It's really easy. Frontend Themes are modules, (I added two testing Themes to the attachment), which only contain the module information (version, author, name, ...). They are based on a module called "WireThemes" which is included, too. WireThemes is the main controlling class. It rewrites the path of "$config->paths->templates" and "$config->urls->templates" which afterwards pointing to the folder of your Theme and contains the installing and uninstalling methods. What I'm still working on ProcessWire's great strength - but in case of theming a big complication - is that you have to/can create fields by yourself. So it's hard to create a theme which fit's on every system. That's why I'm still brainstorming how to make this easier. Possible solutions I see at the moment are: Creating a site profile with the most used fields Creating a json file for ProcessMigrator Hoping that the 2.5 default site profile includes the most used fields so I wouldn't have to change something ... Please try it and tell me about any problems. And if you have additional ideas this is the right place to write about them. Download: https://github.com/NicoKnoll/WireThemes
  9. So in previous version of PW (2.1) we were using the modified FieldtypeComments as shown here to enable nested/threaded comments which isn't compatible with the current (2.5.3) version of PW. Now unfortunately since we have updated our old installation to the newest stable we can't use this feature. I know after reading this article that is is coming but is there anyway you guys could recommend to grab the needed files and integrate it into 2.5.3? Thanks!
  10. I've created an Inputfield module but have some questions about how the initialization works. The field works, but I don't understand how the class is being initialized and default values supplied to ___render. If I don't set the value in my code that executes wire('modules')->get('InputfieldMine') then no default value is supplied to ___render even though it's clearly set in __construct. Excerpted logic for my module/class (InputfieldMine): public function __construct() { parent::__construct(); $this->set('minLength', 6); wire('log')->save('trace', "__construct $this->minLength"); } public function init() { parent::init(); // other stuff $ml = $this->minLength; wire('log')->save('trace', "init $ml"); } public function ___render() { $ml = $this->minLength; wire('log')->save('trace', "___render $ml"); } I'm writing a log in __construct, init, and ___render. Excerpted logic from where I'm using the InputfieldMine: // get a my field wire('log')->save('trace', 'B4 LOAD'); $field = wire('modules')->get("InputfieldMine"); wire('log')->save('trace', "AFTER LOAD $field->minLength"); // ellided setting of attributes and properties $field->minLength = 6; wire('log')->save('trace', "AFTER SET $field->minLength"); $form->add($field); I'm writing a log before loading the module, right after loading the module, and after setting the minLength. The log sequence I get is: B4 LOAD __construct init AFTER LOAD AFTER SET 6 ___render 6 So it's clear that the ->get method causes both the constructor and the init function to get invoked as I'd expect. What's not clear to me is why the value set in __construct isn't get-able after $this->set('minLength', 6); is executed. The 6 is present in a var_dump - it's in the data: array['minLength']. If I remove the line: $field->minLength = 6; right before the "AFTER SET" log call then the value is null when ___render is called. What is the purpose of setting minLength to 6 in the constructor? And how would I cause the Inputfield to use it?
  11. To refresh my thumbnails I have been using a solution found in this thread. It is a script in the root of my PW installation on my localhost that when accessed in the browser displays a list of all "orphaned" image files and directories, this way: if (!in_array($f->getFilename(), $valid)) { echo "Orphaned file: " . wire('config')->urls->files . "$id/" . $f->getBasename() . "\n"; // unlink($f->getPathname()); } So you can preview the list first, and then choose to un-comment the unlink function and re-run the script to delete them, and fresh thumbs will be regenerated the next time they are requested, all the outdated ones will be eliminated. I want to make this a simple module: Include this script on an admin page Create a Fresh Thumbs action option on the page (just a button, rather than having to un-comment that line in the source) Enable a cron job option... Seems simple enough so I was hoping maybe someone could shed some light on this for me. Past the creation of a blank admin page, I'm sure I can just include the file and figure out the rest with that foundation. I have also been curious as to how to do this for a long time. As always all your gracious input is much appreciated in advance.
  12. I modified an existing module to experiment with creating an Inputfield module. While core modules are good examples, I shouldn't have copied the "permanent => true" part in getModuleInfo. Can I just delete that record in the modules table in the DB or are there dependencies I need to clean up?
  13. WORK IN PROGRESS PLEASE BE AWARE Processwire MVC by Harmster A quick guide Introduction I am developing a MVC like module for Processwire. My goal is to split code login and design as much as possible. If you're familiar with CakePHP and or Zend you shouldn't have much trouble as those are the frameworks I loosely based this on. This module comes with Twig Template engine from Symfony 2 (see more here) Download Download PWMvc at github: https://github.com/Hawiak/MvcModule Configure 1) Drag/upload/add the /site/modules/MvcModule folder into your project's module folder. 2) Search for new Modules 3) Install MVC 4) Press "Submit", this is important, without the submit your paths are not saved. 5) Leave every textfield as it is for now, these are the defaults. 6) Create 3 folders in your /site/templates folder and call them assets, snippets and layouts 7) You are going to need a default layout file, just create a new php file in the folder layouts you just created called layout.php 8) Place the AppController.class in your /site/templates 9) Place the _create_mvc.php in your /site/templates 10) Edit your /site/config.php and add the following line $config->appendTemplateFile = '_create_mvc.php'; Files, Folders and Fields You might be wondering what you just installed. Here's a quickreference guide to the files: FILE: AppController.class This is actually just an empty class and it can be used for things that are all the same over your website, so not controller reliable. For example a title that you want to append on each one of the controllers, or scripts or stylesheets you want to have all over your website. FILE: _create_mvc.php This script sets up the MVC, it fetches the action, calls the methods. This script runs after EVERY template but only works if the template has an MVC field. FIELD: mvc If you've installed the MVC module you will notice you have an extra field installed called MVC. Add this field to every template you want to enable MVC on. FOLDER: assets In this folder there will be 2 folders called, scripts and styles by default but you can place any folders in here. By default MVC will look in these folders for scripts or styles you use using the $script or $styles property of the controller. FOLDER: layouts In this folder you will put your layout files, layout files is the structure of your website, think about a <head> and <body> tag, in general this is the same for most of your views, however you can set layouts per controller, even per action. Read about that later. FOLDER: snippets In this folder you will put your snippet files, snippets are piece of code that you re-use. The Controller The Controller is the Base provided by MvcModule. It has basic functionality and some properties (These will be extended if needed over time) For now the Controller class has these properties: layout - The "layout" property is used to set a file to be used as a layout file, this can be done in the method or the controller. view - The "view" property can be used to change the view for the action, by default the view will be the same as the action e.g. index.view for the index action and edit.view for the edit action. vars = array() - An array with all the variables that are being used in the controller and in the view, try and not use this variable but it is accesible in any controller or the AppController. Use the set() method instead. render_layout = 1 - This will be a switch to turn of the layout rendering, handy for ajax calls. layout_vars = array() - This is a array with all the vars being used in the layout, same applies here as for the vars, try and not use this variable but still it is accesible throughout your project. Use the set_layout_var instead. scripts = array() - An array with all the scripts for a project, use as follow: $scripts = array('1' => 'jquery.js'); The 1 is the sequence of which the scripts will be loaded, it is handy when you want to load jquery before you load foundation or bootstrap. The scripts need to be in the /site/templates/assets/scripts folder by default. styles = array() - An array with all the styles for a project, use as follow: $styles= array('1' => 'jquery.css'); The 1 is the sequence of which the styles will be loaded, it is handy when you want to bootstrap first before your theme The styles need to be in the /site/templates/assets/styles folder by default. And these methods: set($var, $val) - Will set a variable for your View set_layout_var($var, $val) - Will set a variable for your Layout The AppController The AppController is the class you want to extend when creating a controller, its basicly an empty class where you can put custom stuff in, this class extends the Controller inside the MvcModule folder. Make custimizations in this class to prevent issues while updating MvcModule. Setting up a controller To set up a controller you need to create a file in the root of the template folder (/site/template). Name it like you named the template. It needs to be the same name as the template. Then create a class in it with a capital at the beginning, and append it with the word Controller. This is an example for the Controller Test in /site/template/test.php: <?php class TestController extends AppController{ } ?> You'll then have to set up methods inside this class, lets say you have an edit, view, delete and a list view of a few pages. <?php class TestController extends AppController{ public $title; public function index(){ $this->set('list-view', $pages->find('/')); } public function view(){ $this->set('view', $pages->get($this->input->urlSegments[2])); } public function edit(){ $this->set('edit', $pages->get($this->input->urlSegments[2])); } public function delete(){ $page_id = $sanitizer->value($this->input->urlSegments[2]); $this->pages->get($page_id)->delete(); } } ?> The code here is just to demonstrate how different views work and far from efficiant. In order for the views to work you'll have to create views in the view folder, like index.view, view.view, edit.view and delete.view. Because the TestController extends AppController and AppController extends Controller and Controller extends Wire you can use ProcessWire function by using $this. Template variables The following variables should be available in your template/layout/snippet (Not all of them have been properly tested) user pages page sanitizer files input permissions roles templates session config controller wire this (mvc module) Using Layouts A layout is the markup of your website. Its most of the time the same on all the pages for every view. It goes like. A very simple example of a working layout is: <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/> {{ this.render_headers()|raw }} <title>{{ this.controller.title }}</title> </head> <body data-spy="scroll" data-target="#main-nav"> {{ this.render_snippet('navbar.php')|raw }} {{ this.render_view()|raw }} {{ this.render_snippet('login.php')|raw }} </body> </html> As you can see I used $this->controller->title you can set any variable you like and used it in here. Also, there is the $this->view_body. The view body is the result from the rendered view. And I use the method $this->render_headers() this renders the script and styles for your layout defined in your controller. You can define a layout for each controller or even for each method. Using $this->layout = 'yourlayout.php'; anywhere in your controller. Using Snippets A snippet can be used for a lot of stuff, like your navbar or your login, something you want to re use but not necessary on your layout. You can render a snippet using the {{ render_snippet(string $snippet_name, array $vars)|raw }} Just give the name e.g. login.php and an array of variables you want to use within the snippet, the variables are optional. The snippets can also access controller variables and/or wire variables objects. Using Views A view is where you will put your markup and all the stuff that your visitor will see. A simple basic page could just display a body A view that just displays the body that is set in the controller ($this->set('body', $this->pages->get('/'))) and then just echo $body on the view This is an example view: <div> {{ body }} </div> UPDATE Twig template engine has been implemented see the Twig documentation for more info TODO: Create more controller methods that make it easier to generate views Create an Error class for MVC enabled templates. Implementing Twig as a template engine for views and possible layouts, snippets. Implement feutures like extend in twig. May change the core. Advanced testing Write tutorial The module now features an admin panel. Create view files/folders from admin panel Create controllers from the admin panel Create new methods in the controller from the admin panel Changelog - 11/20/2013 - Updated whole module - 11/22/2013 - Implemented Twig, renamed views extension to .tmpl WORK IN PROGRESS PLEASE BE AWARE
  14. This module provides simplified (no fancy diff etc. features available, at least yet) version control for text type fields. Originally introduced in another post as a proof of concept, I'm now considering it stable enough to deserve a thread of it's own here. Just so that you know: I've tested this module in multiple ProcessWire installations, three or four different versions in total running on two different platforms, but it still hasn't seen too much real world use. Any information you folks can provide me about how well (or badly) it worked (or didn't work) for you would be considered extremely helpful! So, what does it do? When editing pages, fields with old revisions available show up with a new icon in their header bars. By hovering that icon you get a list of available revisions and by clicking any one of those the value of that particular field is reverted to that revision. No changes are made to page until you choose a revision and save the page, which means that you can keep switching between revisions to get an idea what's really changed without inadvertently causing any content to change. How does it work? Behind the scenes hooks provided by ProcessWire are utilized to catch page edits. If text fields (such as FieldtypeText, FieldtypeTextarea etc.) selected at module configuration to be tracked were changed, their values (along with some metadata) are saved to two custom database tables. See attached screenshots for better idea about how this thing works. Please note that before you've selected at least one template + field combination to be tracked via module settings nothing will be saved to database! Getting started Module is available at GitHub: https://github.com/teppokoivula/VersionControlForTextFields. Here's a direct download link if that's what you prefer. Installation instructions etc. are available at README.md. If you've got any questions, feel free to post them here or PM me!
  15. I have a shopping website to create using PW, there's a great shopping module available, but i was wondering does it implement abandoned shopping cart emails? If not, would anyone have any tips as to how i could add this functionality? Thanks
  16. Do you hate dislike TinyMCE and heart Markdown? Or Textile? Or HTML? Do you wish there was better way to create content than textarea? Well there is! Content creation oriented, syntax highlighted and easy on the eyes, that is this new plugin I made. And I know you'll love it! And did I mention it supports HTML, Markdown and Textile? Download/fork/star here: GitHub PW Modules Your local modules manager Features Syntax highlight your text, for easier preparation of content Nice light, readable theme Supports Textile, Markdown & HTML Auto selects mode, based on field's textformatters (last found is used) Works with multiple fields on page, each with different settings Features inspired by iA writer Blue Cursor Focus mode We are still kind-of in beta, so please, test your browsers and let me know… Thank you! <3 PW
  17. I'm wondering is it possible to have a custom page within the admin area? For example i have a table in my database that's very specific in it's structure, so doesn't fit with Processwire's db structure. I'd like to create a module that adds another area to the admin backend, that an admin can then click on (similar to the pages, modules, setup tabs) and then shows them a custom area for editing X or whatever. Any help would be great. Thanks
  18. AlternativeGridImages module for Processwire Details Add a slider directly proportional to the size of the images introduced in the input field image. Installation copy AlternativeGridImages folder to /site/modules/ Screenshot https://github.com/LuisSantiago/AlternativeGridImages Updated 1.0.6: - Renamed altGrid as AlternativeGridImages. (Thanks @adrian) - Changed styles. - The slider value is saved in a cookie. (Thanks @Martijn Geerts) Updated 1.0.7: - Limit the number of characters in the file name (all items have the same height) (Thanks @enricob)
  19. GitHub: https://github.com/owzim/FieldnameUnprefixer From the README.md: Makes it possible to access prefixed field names without the prefix. Usage Create some prefixed fields and add it to you desired template, for example prefix_myField and otherPrefix_myOtherField. Configure the prefixes, that should be removed in your /site/config.php, like so: $config->FieldnameUnprefixer = array( 'basic-page' => array('prefix_', 'otherPrefix_'), 'home' => array('prefix_', 'otherPrefix_') ); The first array keys are the template names. The Prefixes also can be assigned as a string if it's just a single one: $config->FieldnameUnprefixer = array( 'basic-page' => 'prefix_', 'home' => 'otherPrefix_' ); Now you can access the fields without the prefix, like so: echo $page->myField; echo $page->myOtherField; The unprefixed field names are now also accessible via selectors, but only for already fetched data, since the field is not really in the database: // not $pages->find('myField=something'); // but $pages->find('template.name=basic-page')->filter('myField=something'); Use case Prefixes are sometimes necessary to have fields that behave specific to the template, so you need to create a specific field and namespace it with a prefix, but don't want to access the fields differently on each template. // eeew! $client->client_address; $something->something_address; // yay! $client->address; $something->address; Might be not the ProcessWire-way because data access is abstracted, but I use it, and perhaps some of you find it useful too.
  20. Hello PW'ers, I'm a PW newbie and my first post in this forum. In the last years i was a 'hardcore' Drupal user, but i'm confused about the 'bloated' code. Make your own Drupal-theme is a hell. A few days ago I find PW. My first impression, HOW WORKS THIS??? Reading many posts in this forum, and a lot of searching on the net for good simple tutorials to understand PW. Today follow a first 'beginner' tutorial, finding in Docs of the PW-site. Wauw!! Thats an amazing CMS/CMF. I searching for a tutorial how make a select/dropdown/tag-list (similar as 'Taxonomies' in Drupal) and find it: http://wiki.processwire.com/index.php/Page_Field I try it succesfully. Ok, I have a question: I found a good tutorial in this forum how make a simple form (thanks @soma!). But how know with options a module have? Example: $field = $modules->get("InputfieldText"); $field->label = "Name"; $field->attr('id+name','name'); $field->required = 1; $form->append($field); In the above code, i see a label, attr, required But how can I know with options are available for a module? PS: Sorry for my bad english Regards, Christophe
  21. This module is obsolete and will not be developed any further. Please use the ImageExtra Module instead. Overview This module allows you to add additional informations to an image (for example: title, description, link, orientation and any field you may need). If you want to, you can install FieldtypeImageExtraLanguage to get multi-language support. For more informations have a look at the readme. Installation 1a. Clone the module and place FieldtypeImageExtra in your site/modules/ directory. [OR] 1b. Download and unzip it from the module page. git clone https://github.com/justonestep/processwire-fieldtypeimageextra.git your/path/site/modules/FieldtypeImageExtra 2. Login to ProcessWire admin and click Modules. 3. Click "Check for new modules". 4. Click "install" next to the new FieldtypeImageExtra module. If you need multi-language support, you have to install the FieldtypeImageExtraLanguage module. 5. That's all - no settings are required but possible. Define your custom fields 1. Login to ProcessWire admin and click Modules. 2. Open `Images Extra Inputfield` Settings. The following fields are available by default: orientation - image orientation orientation values - values to use as classnames or identifiers for different image orientations title - image title to use for title/alt tag or/and caption, if empty, the content will be generated from the applications filename description - image description link - image link to internal pages If these fields are not enough for you, you can add any other field (for example _author_ and _location_) by writing it (separated by comma) in the field otherField. If you don't need all custom fields, you can easily disable them. One more exception is orientationValues. Here you can insert identifiers for classnames or similar separated by comma. This values will be available in a dropdown list. Usage 1. Under Setup and Fields create a new field using type `ImageExtra` or `ImageExtraLanguage`. 2. After entering the new field name and label, click Save. 3. Configure it depending on your own needs. 4. Save. 5. Add your new field to one or more Templates. Accessing the value This is no different than accessing the value of any other field. $image = $page->image->getRandom(); echo $image->title; echo $pages->get($image->link)->url For use with TemplateTwigReplace {% set image = page.images.getRandom() %} {{image.title}} {{pages.get(image.link).url}} Screenshots Here is a litte example how to access the new fields: // if there are images, lets choose one to output in the sidebar if (count($page->images)) { // if the page has images on it, grab one of them randomly... $image = $page->images->getRandom(); // resize it to 400 pixels wide $image = $image->width(400); // output the image at the top of the sidebar $sidebar = "<img src='$image->url' alt='$image->description' />" . "<h3>$image->title</h3>" . "<blockquote>$image->description</blockquote>" . "<p>$image->author ($image->location)</p>" . $page->sidebar; }
  22. Hi folks, I used to be a big fan of WP, but luckily found ProcessWire and in general it has been so great and super flexible... so thanks for that and all your hard work. It's appreciated. One thing I was a big fan of on WP when using the ACF (Advanced Custom Fields) was the 'Flexible Content' add-on (http://www.advancedcustomfields.com/add-ons/flexible-content-field/) which essentially allowed you to build a series of elements to use (textarea, image etc) then when a user came to build this section on the CMS, they could build a flexible page using those defined elements. So one page might be textarea, image, image, textarea and another may be image, textarea, image, image, image, textarea etc. They have the fields and they build the order. Is there anything PW offers in this respect? I was checking out Tables (https://processwire.com/api/modules/profields/table/) but it's quite strict and not that flexible (unless I am missing something!) Thanks and hope you can help, R
  23. I am trying to determine if the Form Builder module is suitable for my project. The project has a 9-step form where each step is on a different page. Does Form Builder allow this functionality of keeping at answers stored and only sumbit once the visitor completes the last step? Or do Form Builder forms all have to be on the same page?
  24. Page References Tab This little module adds a new tab, References, to the page editor. There it lists pages referencing the page that is being edited (title, path, field). There are also links to view or edit the listed pages (if they're viewable/editable). Only fields of type FieldtypePage are considered to be references and system fields are not listed at all (roles, permissions). It's nothing much, but as the subject has turned up a couple of times in the forums, I decided to give it a try. So watch out what you're asking! Screenshot Links Modules directory: http://modules.processwire.com/modules/page-references-tab/ GitHub: https://github.com/niklaka/PageReferencesTab
  25. I came across a strange problem on my site as I wanted to display a teaser of the latest news. I've got this Hanna Code: <?php $latestNews = $pages->find('tweet_page=1, check_access=0, sort=-created, limit=1')->first(); ?> <?php if($latestNews) { ?> <div class="snippet-teaser clearfix"> <h3><?php echo $latestNews->get("heading|title"); ?></h3> <p><?php echo substr(strip_tags( $latestNews->body ), 0, 40); ?>… <a href="/test/">more</a></p> </div> <?php } ?> I put my [[show-latest-news]] into my sidebar and instead of showing the title and 40 characters of the body the complete body gets outputted without any of the HTML around it. If I change it to truncate the title it works well. I also tried the same code in a template file (without Hanna Code) and the truncated body is displayed. Even the preview within the Hanna Code module displays the truncated body. I can't think of where this error comes from. Why is it working from my template and with any other field but not with the body field?
×
×
  • Create New...