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. Hey All. I am currently writing a very small module to accomplish the following: - I have a Page "Service Types" with multiple childs "Service Type". Whenever a new "Service Type" is added, a Field (in my case FieldtypeRangeSlider) should be generated, eg "servicetype_communication_rangeslider" and added to an existing template ('case') at a specific position. I have little experience with modules but managed to get it done till the successfull creation of the range-field. But now I am struggeling with adding it to the template. First, I havend managed to get a list of templates in the module..just a workaround via pages and selector template=case. I think this would work, but only of there are pages with this tempalte. If not, this solution fails and in general, I don't know how to get the templates in a module. Second, I have no clue how to add a field at a specific position to an existing template (to an existing Fieldset in my case). Here is my code so far: class AddServiceTypesByPage extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Add ServiceTypes By Page (Didhavn)', 'version' => 1.0, 'summary' => 'Add the ServiceTypes by getting Pages with Template "service-type"', 'singular' => true, 'autoload' => true ); } public function init() { $this->pages->addHookAfter('added', $this, "hookAdded"); } public function ready() { // PW API is ready, Controllers go here } public function hookAdded(HookEvent $event) { $page = $event->object; if (!$page->template) { $page = $event->arguments[0]; } if($page->template == 'service-type') { $f = new Field(); $f->type = $this->modules->get("FieldtypeRangeSlider"); $f->name = 'servicetype_' . $page->name; $f->label = 'Service-Type ' . $page->get('title')->getDefaultValue(); $f->set('suffix','%'); $f->set('tags','servicetype'); $f->set('icon','fa-sliders'); $f->save(); /* * now add the field to existing template with name 'case' */ } } } I am thankfull for any help or suggestion! Thanks a lot!
  2. Hi there, i just installed the ProcessPreview Module and it works on templates with classic field types like Textarea/Text etc. But if a template uses a repeater - the modul seems to be unable to get the contents. I tried to modify the modul - but im still learning php - so my guess i have to make changes here line 38-39 and maybe add repeater support here line 35 ... Thanks for reading/helping Simon
  3. Hi Guys, I am going to add capability to a USA version of a site to redirect or display a message to users visiting the website from UK or Ireland notifying them of an international website at .co.uk Any suggestions, module recommendations, plugins etc. ? Figured I would ask before I started working on this solution. Thanks!
  4. Description This module adds icons based on the file type uploaded. It also lets you change the columns, etc. You can watch the video for more details or download and install. To make it work (do not know why) you have to change any configuration setting and save. Version Alpha version (0.0.1). Updated: 0.0.2 - Added Json name shorter, icons and columns. Updated 0.0.3 - Config in columns Updated 0.0.4 - Video and Audio extensions added. Updated 0.0.5 - Fixed select files and drag to upload div position. Updated 0.0.6 - Execution of the module only in the administration. What a fail! Github
  5. Hi all! Are there any storefront modules available for use? Something that lists items for sale with images and prices, and perhaps also a way to order items and pay for them. Thanks! Julio
  6. Hi everybody, I'd like to share with you another new module. It helps you to manage user ratings for pages in a very simple way. You can add a user rating to a certain page with a line of code: $page->ratings->add(4) If the user is logged in, the module remembers which page the user has rated for. For non-logged-in visitors, the module stores the pages, the user has rated, in the session. You can get a page's rating and its total amount of votes in a similar way: $page->ratings->average; // => 3.2 $page->ratings->count; // => 5 For more information about this module, please check out its GitHub repository. You can check out a working version of the module here: http://curium-cte.lightningpw.com Edit: The module is now available in the ProcessWire modules directory. Update: Ratings has been updated to version 1.1, including a new, simpler API accessor. As always - please comment for bugs or feature wishes. Thanks in advance, Marvin
  7. AvbMarkupHtml - HTML tag manager for ProcessWire This module allow you to use less HTML elements inside your PHP code ! Added hook for page. For make quick markup calls : $page->html(); Github : https://github.com/trk/AvbMarkupHtml Example usage and all methods : // All Configs $config = array( 'quote' => '"', 'indent_with' => ' ', 'tags_without_indentation' => 'link,img,meta', 'WirePage' => null, 'tag' => null, 'tagSelfClosed' => null, 'tagNoClose' => null, 'tagCustom' => null, 'tagStart' => '', 'tagEnd' => '', 'prepend' => '', 'prepends' => '', 'attributes' => array(), 'dataAttributes' => array(), 'label' => '', 'note' => '', 'text' => '', 'texts' => array(), 'hasTexts' => false, 'field' => '', 'field_value' => '', 'fields' => array(), 'hasFields' => false, 'child' => '', 'children' => '', 'append' => '', 'appends' => '' ); // All Methods $page->html(array('key', 'value')) // $config ->tag('string', $args=array())) // tag name, $args=content,tag-options => "/>" self closed, "->" no close, "=>" special tag ->setQuote('double or single quote') // default is : " ->addClass('string') // Element class name ->id('string') // Element id ->attr('key', 'value') // output : key='value' ->attributes(array('key', 'value')) // attributes ->data('key', 'value') // output : data-key='value' ->dataAttributes(array('key', 'value')) // data-attributes, this will add auto data- prefix to your attribute ->prepend('string') // a string value ->prepends(array('values')) // array for values ->text('string') // text for inner tag ->field('field_name', 'page_object') // Field name and page object ->texts(array()) // enter text array | array('Text 1', 'Text 2') ->fields(array(), 'page_object') // enter field names as array, a page | array('title', 'body') ->note('field_name', 'page') // enter a field name, a page ->label('field_name', 'page') // enter a field name, a page ->append('string') // a string value ->appends(array('values')) // array for values ->r(true|false) // Alis with ->render(); function ->render(true|false) // This will return result ->o(true|false) // Alias with ->output(); function ->output(true|false); // This will print result | default pretty print value is : false // #Example 1 : Working With ProcessWire $ul = html::ul()->addClass('list'); foreach($page->children as $p) { $ul->child( html::li() ->addClass('list-item') ->data('id', $p->id) ->child( html::a($p->title) ->addClass('list-item-link') ->attr('href', $p->url) ->data('id', $p->id)->r() )->r() ); } $ul->o(true); /* output : <ul class='list'> <li class='list-item' data-id='1057'> <a class='list-item-link' href='/en/villas/' data-id='1057'> Villas </a> </li> <li class='list-item' data-id='1001'> <a class='list-item-link' href='/en/location/' data-id='1001'> Location </a> </li> <li class='list-item' data-id='1090'> <a class='list-item-link' href='/en/guestbook/' data-id='1090'> Guestbook </a> </li> <li class='list-item' data-id='1055'> <a class='list-item-link' href='/en/contact/' data-id='1055'> Contact </a> </li> <li class='list-item' data-id='1005'> <a class='list-item-link' href='/en/site-map/' data-id='1005'> Site Map </a> </li> </ul> */ // #Example 2 html::div() ->addClass('container') ->addClass('container-center') ->attr('style', 'border: 1px solid #000;') ->data('id', $page->id) ->data('title', $page->title) ->child( html::h1($page->title) ->addClass('h1-title') ->r() ) ->child( html::div($page->body) ->addClass('container-inner') ->r() ) ->o($config->debug); /* Output <div class="container container-center" style="border: 1px solid #000;" data-id="Page id field data will come here" data-title="Page title field data will come here"> <h1 class="h1-title"> Page title field data will come here </h1> <div class="container-inner"> Page body field data will come here </div> </div> */ // #Example 3 : html::div("Hey !") ->addClass('container') ->addClass('container-center') ->id('centered-container') ->output(true); /* Output <div id='centered-container' class='container container-center'> Hey ! </div> */ // #Example 4 html::ul()->addClass('list')->children(array( html::li('Li element value 1')->addClass('list-item')->render(), html::li('Li element value 2')->addClass('list-item')->render(), html::li('Li element value 3')->addClass('list-item')->render(), html::li('Li element value 4')->addClass('list-item')->render(), html::li('Li element value 5')->addClass('list-item')->render() ))->output(true); /* Output <ul class='list'> <li class='list-item'> Li element value 1 </li> <li class='list-item'> Li element value 2 </li> <li class='list-item'> Li element value 3 </li> <li class='list-item'> Li element value 4 </li> <li class='list-item'> Li element value 5 </li> </ul> */ // #Example 5 $title = $page->html('title')->tag('h1')->addClass('h1-class')->render(); echo $title; // #Example 6 : This will directly print $page->html($page->title)->tag('h1')->addClass('h1-class')->output(); html::h1($page->title)->o(); // #Example 7 : Self Closed Tag $modules->AvbMarkupHtml->html()->tag('hr', array(null, '/>'))->output(); html::hr()->o(); // #Example 8 $page->html($page->title)->tag('h1')->addClass('my-h1-class')->output(); html::h1($page->title)->addClass('my-h1-class')->o(); // #Example 9 $page->html('title', $pages->get('/contact/'))->tag('h1')->addClass('my-h1-class')->output(); html::h1()->addClass('my-h1-class')->field('title', $pages->get('/contact/'))->o(); // #Example 10 $modules->AvbMarkupHtml->html()->tag('div')->addClass('container')->children(array( $page->html('title')->tag('h1')->addClass('my-title')->render(), $page->html('body')->tag('div')->addClass('my-body')->render() ))->output(); // #Example 11 | Multiple child, prepend, append $html = $page->html()->tag('div')->addClass('uk-container')->addClass('uk-container-center'); $html->prepend( $page->html()->tag('div')->text('Prepend #1 !')->render() ); $html->prepend( $page->html()->tag('div')->text('Prepend #2 !')->render() ); $html->child( $page->html()->tag('div')->text('Hey !')->render() ); $html->child( $page->html()->tag('div')->text('Foo !')->render() ); $html->child( $page->html()->tag('div')->text('Bar !')->render() ); $html->append( $page->html()->tag('div')->text('Append #1 !')->render() ); $html->append( $page->html()->tag('div')->text('Append #2 !')->render() ); $html->output(); // #Example 12 | Create A HTML page //-> Create Html Tag $html = $page->html()->tag('html')->attr('lang', 'en')->attr('dir', 'ltr'); //-> Create Head Tag $head = $page->html()->tag('head'); //-> Add TITLE inside HEAD tag $head->child( $page->html()->tag('title')->text('My Website')->render() ); //-> Put HEAD inside HTML Tag $html->child($head->render()); //-> Create BODY Tag $body = $page->html()->tag('body')->addClass($page->template); //-> Create DIV Tag $container = $page->html()->tag('div')->addClass('container'); $container->children(array( $page->html()->tag('h1')->addClass('h1-title')->text('H1 Title')->render(), $page->html()->tag('div')->addClass('body-content')->text('Body Content')->render() )); //-> Put DIV.container inside BODY Tag $body->child($container->render()); //-> Put BODY inside HTML Tag $html->child($body->render()); $html->output(true); // Pretty HTML output /* Output <html lang='en' dir='ltr'> <head> <title> My Website </title> </head> <body class='homepage'> <div class='container'> <h1 class='h1-title'> H1 Title </h1> <div class='body-content'> Body Content </div> </div> </body> </html> */ // #Example 13 Static Call Example $article = html::tag('article')->addClass('uk-article')->children(array( html::field('title')->tag('h1')->addClass('uk-article-title')->render(), html::tag('hr', array(null, '/>'))->addClass('uk-article-divider')->render(), html::field('body')->render() )); $article->output(true); /* Output <article class='uk-article'> <h1 class='uk-article-title'>Page Title</h1> <hr class='uk-article-divider' /> Body Content </article> */
  8. I was looking for a more comfortable solution to add pages from a PageField Select. I ended up in this small module. Which is quite simple, but very useful. I created a PageField and another field of Type AddPage (requires FieldtypePageTable) with same settings for template and parent. Now I can easily add the page in the Modal. If you need it, take it as a Christmas Present from my side. (no christmas smiley available ... ) Dear Ryan, dear community, I wish you all the best for christmas and the upcoming year. <?php /** * Excellent side dish to Fieldtype Page. Doesn't store any data. Provides comfortable page creation. * * made by kixe (Christoph Thelen) 22.12.15 * Licensed under GNU/GPL v3 * * ProcessWire 2.x * Copyright (C) 2015 by Ryan Cramer * Licensed under GNU/GPL v2, see LICENSE.TXT * * http://processwire.com * * */ class FieldtypeAddPage extends FieldtypePageTable implements Module { public static function getModuleInfo() { return array( 'title' => 'Fieldtype Add Page', 'version' => 100, 'summary' => 'Excellent side dish to Fieldtype Page. Doesn\'t store any data. Provides comfortable page creation.', 'author' => 'kixe', 'requires' => 'FieldtypePageTable' ); } public function init() { // prevent data storage $this->addHookAfter('FieldtypePageTable::sleepValue', function($event) { $event->return = array(); }); // unneeded configuration fields can be removed $this->addHookAfter('FieldtypePageTable::getConfigInputfields', function($event) { $inputfields = $event->return; $page_behavior = $inputfields->children()->get(2); $removes = array('sortfields','trashOnDelete','unpubOnTrash','unpubOnUnpub',$page_behavior); foreach ($removes as $remove) $inputfields->remove($remove); $event->return = $inputfields; }); } } Screencast
  9. Chrome Php Logger Module to log useful details directly in your Chrome JS console. You can inspect most as objects and see infos or values. To enable logging with this module you have to enable debug modue in config.php. If debug is set to false in config.php, it will not output any log. Important: It is not recommended to enable it on live stage, as it reveal infos you might not want everybody to see, although it's not obvious as it requires the ChromePhp Extension installed and enabled. - render time - memory consumption - cpu usage - current user infos - current user roles - current user permissions - current page with all its fields and their value and field settings - page cache/loaded on request count - fuel - modules loaded - Server vars etc. - Cookies - Requests - mySQL query log When installed you can also use ChromePhp static methods to output your own data in all your templates or modules: ChromePhp::log($page->somefield); Note: This module requires the ChromePhp Extension installed to see the log in the Javascript console. More infos can be found on http://chromephp.com Download: Modules Directory: http://modules.processwire.com/modules/chrome-php-logger/ Github: https://github.com/s...ChromePhpLogger
  10. Given a Google Calendar XML feed URL, this module will pull it, cache it, and let you foreach() it or render it. Download at: https://github.com/r.../MarkupLoadGCal USAGE The MarkupLoadRSS module is used from your template files. To use it, you get a copy of the module, tell it what URL to load from (with the load method), and then execute a find() query with a selector string. It works basically the same as a $pages->find("selector string"). <?php $cal = $modules->get("MarkupLoadGCal"); $cal->load('http://calendar XML feed'); $items = $cal->find('from=2011-12-1, to=2011-12-31'); foreach($items as $item) echo "<p>{$item->title}</p>"; To get a Google calendar URL, you would go into your (or another) calendar on Google and click to the calendar's settings. At the bottom of the screen, you will see a section called "Calendar Address" with XML, ICAL, and HTML. Copy the XML address, and use that with this module. If you just want one to test with, use the one from my examples below: http://www.google.co...com/public/full Note: you must use the 'full' not 'basic' calendar from Google Calendar. You can identify if you've got the right one because it will end with 'full' rather than 'basic', as in the URL above. Selector Properties The selector properties you may provide to find() are: from: Starting date in any common date/time format (or unix timestamp). to: Ending date in any common date/time format (or unix timestamp). keywords: Keyword(s) to search for in the Google calendar events. limit: Max number of items to load (default = 100). sort: May be 'date', '-date', 'modified' or '-modified'. html: Set to '0' if you don't want the event description in HTML. The find() method will return the found items. You can then foreach() these items to generate your output. A render() method is also included with the items which provides some default output, if you want it. Calendar Item (Event) Properties Each calendar item has the following properties: title: The title of the event description: Detailed description of the event (in HTML, unless disabled) location: Where the event will take place author: Author of this item from: Timestamp of when the event begins to: Timestamp of when the event ends dateFrom: Formatted date string of when the event begins dateTo: Formatted date string of when the event ends See the module file for additional configuration options. EXAMPLES Example #1: Simplest example <?php // get the calendar module $cal = $modules->get("MarkupLoadGCal"); // set the feed URL: may be any google calendar XML feed URL $cal->load('http://www.google.com/calendar/feeds/3icgo6ucgvsf6bi5orld9moqqc%40group.calendar.google.com/public/full'); // find all items for December, 2011 $items = $cal->find('from=2011-12-1, to=2011-12-31'); // render items using built-in rendering echo $items->render(); Example #2: Rendering your own items <?php $cal = $modules->get("MarkupLoadGCal"); $cal->load('http://www.google.com/calendar/feeds/3icgo6ucgvsf6bi5orld9moqqc%40group.calendar.google.com/public/full'); $items = $cal->find('from=2011-12-1, to=2011-12-31'); foreach($items as $item) { echo " <h2>{$item->title}</h2> <p> <b>Date From:</b> {$item->dateFrom} (Timestamp: {$item->from}) <br /> <b>Date To:</b> {$item->dateTo} (Timestamp: {$item->to}) <br /> <b>Location:</b> {$item->location} <br /> <b>Author:</b> {$item->author} </p> {$item->description} "; } Example #3: Finding Keywords <?php $cal = $modules->get("MarkupLoadGCal"); $cal->load('http://www.google.com/calendar/feeds/3icgo6ucgvsf6bi5orld9moqqc%40group.calendar.google.com/public/full'); $items = $cal->find("from=Aug 1 2011, to=Dec 1 2011, keywords=Eddie Owen"); echo $items->render(); ADDITIONAL INFO Options See the module's class file (MarkupLoadGCal) for a description of all options in the comments of the $options and $markup arrays at the top of the class file. Handling Errors If an error occurred when loading the feed, the $cal will have an 'error' property populated with a message of what error occurred: <?php $items = $cal->find("..."); if(empty($items) && $cal->error) { // an error occurred echo "Error! " . $cal->error; } $items will be blank if an error occurs, but it will always be of the same type, so it's up to you whether you want to detect errors. If you don't, then your calendar output will just indicate that nothing was found. Cache By default your calendar queries are cached for an hour. You can change the cache time by setting the $cal->cache property to the number of seconds you want it to cache. --- Edit: Added note that you must use the 'full' google calendar feed rather than the 'basic' one.
  11. ukyo

    AvbImage

    AvbImage - Image Manipulator Module for ProcessWire This module using Intervention Image PHP image handling and manipulation library. Update Status Module and InterventionImage Library update - 10-12-2015 More performance imporements - 18-11-2015 Module Update and Performance Improvements - 17-11-2015 First Commit - 28-10-2015 RequirementsProcessWire >= 2.5.11 PHP >=5.4 Fileinfo Extension Supported Image LibrariesGD Library (>=2.0) Imagick PHP extension (>=6.5.7) For usage and methods please look githup repo : README.md > For issues and fix and corrections please use Githup Repo
  12. AdminSaveActions (Was: After Save Actions - guess why the rename?) Admin Save Actions adds the possibility to choose where the browser gets redirected after saving a page, template or field. Admin save actions are displayed just before the save button in a collapsed container. Chosen action can be saved in a cookie for current user by checking "Remember this setting". By leaving this option unchecked upon save, the chosen action will not become the default. Why? Some of you wanted something like this to exists in ProcessWire - and so did I. I've read discussions here, here, here and here carefully trying to cover at least most of the options discussed. I know this implementation wont satisfy all the needs, but I'm looking into adding some things afterwards to cover even more of them. I called the first version of this module PageEditRedirects but decided to to change the name in to a more descriptive one. So that module got deprecated as of now (and does not exists at GitHub anymore). This new version also does not require PW 2.3 but works just fine on PW 2.2 as well. Special thanks A module by Adam Kiss (ListAfterSave) implemented some of these actions a long time ago. Thanks to Adam for letting me use the ideas introduced by his module. There are actually some things there my module isn't going to cover even in future versions. Links AdminSaveActions can be found from the modules section. AdminSaveAction is downloadable from GitHub. (Edit: added link to the modules section. Edit 2: Implemented config option + version bump. Edit 3: Removed feature list - see GitHub.)
  13. Hello, I am using FormBuilder and I want to create a multi-language form (1 form for N languages, not 1 separate form for each language!). Everything is translatable except the Select fieldtype. I like to also translate the options in a select field. I found a workaround, but I can not use it (UX reasons for client): Create Pages with Options and use Page fields with select instead of true/raw select fieldtype. Well, this is a workaround, but not a solution. How can I translate my options in select fieldtype? Thank you!
  14. I have a simple module that creates a page when another page is saved with a checkbox field checked. My code below works well but I have one issue, it runs when the page is trashed as well as saved (creating an erroneous second duplication of the page). <? public function init() { $this->pages->addHookAfter('save', $this, 'dupeStandalone'); } public function dupeStandalone($event) { $page = $event->arguments[0]; if($page->template->name == "article_language" && $page->article_standalone == 1) { $a = new Page(); $a->template = 'article_standalone'; $a->parent = wire('pages')->get('/article/'); $a->name = $page->name; $a->title = "{$page->title} (standalone placeholder post for {$page->parent->parent->title}-only article)"; $a->save(); } } Could anyone help as to why it runs the function on trash as well as save?
  15. Helllllo! I am working on a simple module / pet project for a module that inserts custom classes into specific templates for forms that are generated via the api. I use bootstrap a bunch and am always messing with the defaults in processwire, now it should be a simple manner to tweak my settings in the admin area. As this seems to be something that I keep needing I thought that others might as well. Right now the functionality is pretty simple: Select the templates that you want to override the default styling on. Set your new defaults .... Proffit. What I would like is maybe some suggestions for options or functionality that I should try for. I have never really deep dived into modules so this is a bit new to me, but as I am looking for a new development job I would push myself for something cool. https://github.com/MuchDevelopment/FormStyler/tree/master
  16. Hi everybody, I'd like to share a new module with you. Its purpose is to let users sign in with their Active Directory accounts using LDAP. It works similar to the module jimyost released in 2012, but adds some new features to it. You can define specific roles that are applied to new LDAP users Passwords are automatically updated by LDAP Local users still work like a charm You can translate it in the language you want to deploy your ProcessWire site New: Connect to a LDAP server via SSL New: Debug Mode New: Your configuration will be validated on save In my opinion, LDAP authentication is a must-have for ProcessWire being successful in the enterprise. What do you think? Is there a feature you miss? You can find the repository here: https://github.com/conclurer/LdapSignIn You can find the module in the ProcessWire module directory. Thanks in advance! Marvin Edit: Updated to Version 0.5.1 Beta including some minor fixes
  17. Hi everyone, I got a serious problem with the LanguageSupport module. I already found a forum thread regarding the topic, but it doesn't work in my case. https://processwire.com/talk/topic/7207-can%C2%B4t-install-languagesupport/ My problem is, that "ProcessLanguage" can get installed but "LanguageSupport" doesn't. I can uninstall ProcessLanguage via the Module configuration, but that doesn't change anything. I always get this Error: I've found a "Languages" Page under Admin/Setup and deleted it with this code https://processwire.com/talk/topic/7207-can´t-install-languagesupport/?p=69520 I also deleted the LanguageSupport module via FTP from the server and uploaded the newest version of it. The error still occurs. I'm still a beginner and don't know how to deal with it. Please help me! I'm using the Blue-VR Site Profile made by Gayan Virajith, if that information helps. Thanks a lot in advance, Leo
  18. Hello, I am having an autoloaded module that should execute before another autoloaded module. Currently, my module is loaded after the other one -.- How can I achieve this? If that's not possible: How can I say that my autoloaded module should boot as first one in PW boot process? Thanks for your answers!
  19. Adds twig support for language translator list. To get your `.twig` files listed as well, you need to wrap the phrases like this: {{ __('text to translate', 'filepath/filename relative to site/templates/') }} {{ __('another text to translate', 'home') }} {{ __('one more text to translate', 'partials/header') }} first line - general usage second line - example for a text in site/templates/home.twig third line - example tor a text in site/templates/partials/header.twig
  20. Hey guys, Love PW except the forms which are grinding my hopes and dreams away. I'm rendering a form with this call $images = $modules->get("InputfieldFile"); $images->label = " "; $images->description = "Upload photo/s (max 2mb)"; $images->attr("name+id", 'myimages'); $images->attr("class", 'images-class'); $images->destinationPath = $this->config->paths->root . 'tmp_uploads/'; $images->extensions = "jpg jpeg gif png"; $images->maxFilesize = 2; // 2mb $images->maxFiles = 2; $form->append($images); Now I expect it to render a form that can take two uploads AND can remove one of the uploads. It doesn't seem to work like this. Firstly I needed to modify the output so I created an afterHook to modify this, just removing all the spans basically not important. Further along I decided to create a hook which replaced the ___renderUpload function so that I can play around with the output and how it positions itself. This threw errors at me for calling methods such as $attrs = $this->getAttributes(); $this->getAttributesString($attrs) So I gave up on that as well. Now I realised that a possible reason (hopefully, really really hopefully) I can't remove images is because the method __renderList isn't being executed because $this->value is failing at if(!$value) return ''; inside __renderList Now I just need to ask how can I enable the removal of images and change the output to my own markup. I have thought about moving it to /site/modules and play around with it there but it still won't solve the problem of removing images. Thanks in advance,
  21. Hello, I have following structure: / -- www.campaign.com -- www.campaign2.com I am using soma's Multisite module (fork of apeisa's Multisite module) and I installed the multi-language module of ProcessWire. My two languages are German (as default) and English. And on www.campaign.com, I changed the name for English to en.campaign.com. I thought that now everything should work, but didn't. Can anyone give me a working example of using this module with Soma's extendend multi-language-features? Maybe I missed some settings or didn't understand this module in the first place.. Thank you!
  22. Hey guys, I'm really really desperate for help at this stage, for my own sanity mostly. I've been trying to set up a form that requires several fields one of which is a file upload, the user can upload max 10 files with extension jpg/png/jpeg and these are sent to the admin email as attachments. Currently this i am using the InputfieldFile module, I have moved it over to /site/modules because hooking the return html wasn't enough for my needs. So basically I have this. $images = $modules->get("InputfieldFileCustom"); $images->attr('label', "Upload your images"); $images->required = 0; $images->maxFiles = 10; $images->attr('id+images','image'); $images->attr('placeholder','no file selected'); $images->attr('extensions','jpg'); $form->append($images); I expected output that would allow me to upload and delete files. Except right now my biggest issue is the fact that the remove button isn't being displayed because the ___renderItem method isn't being run and I have no idea how to make this work. I'm going to have to do a lot of fun stuff with the markup for the majority of the render methods but I can't do anything until I get the remove button to display. I also made a inputfieldfilecustom.js which is imported on the page. I've renamed all instances of InputFieldFile to InputFIeldFileCustom (in both js and module) Begging for help around now. it would be incredibly appreciated if someone can give me any direction.
  23. Hi everyone!!! I have catalog of some products and I'm wanting create modul, which will be show slider of recommended products. And I'm wanting to show this modal in every page of products. I don't know, how I can choose products which I will demonstrate on the page. Who can recommend some model or solution for this situation? Thanks!!!
  24. What is the $event variable/parameter in the Helloworld.module? What does the $event? How does it work? Are there php classes which describes $event? What are all these things doing? $event $event->arguments[0] $event->object Im sorry if this is a nooby question
  25. Hey there, this is a little helper I'm using on some sites, thougth mabe someone is interested. With this simple module you can easily add pages to a global blacklist and use it for filtering of subsequent selector queries. The idea is the following: Let's assume you have something like a blog. You have a simple list of articles in the main column of the page, showing the newest articles from every category. Also you have a small teaser on the right sidebar, showing the latest articles filed under a special category, like news. Now you possibly don't want that teaser to include articles, which are already in the big list in the main column. PageBlacklist is a small module, helping you to implement blacklisting on for such cases. Assuming the scenario on the top, your code could look something like this: // Retrieve the maincol list and add to blacklist $bigList = $pages->find('template=article, sort=-created'); $pageBlacklist->add($bigList); // Possibly you will output $bigList here // Retrieve the sidecol teaser, excluding blacklisted articles $teaser = $pages->find('template=article, parent=news, sort=-created, ' . $pageBlacklist); // Basically, this will alter the selector to something like: // 'template=article, parent=news, sort=-created, id!=1012,1031,1153' I would love to hear ideas to improve this helpfull little module. You can find PageBlacklist on GitHub: https://github.com/tsdtsdtsd/PageBlacklist
×
×
  • Create New...