Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/09/2013 in all areas

  1. Hi, After reading this thread, I decided to make a module that helps generating PDF files of ProcessWire pages. GitHub: https://github.com/wanze/Pages2Pdf Modules Directory: http://modules.processwire.com/modules/pages2-pdf/ This module uses the mPDF library to generate the PDF files. It has fully UTF-8 and basic HTML/CSS support for rendering the PDF files. The output is customizable with ProcessWire templates. Example I've enabled generating PDF files for the skyscraper template of ryans Skyscrapers-profile with a template that outputs the data in a table along with the body text and the images: one-atlantic-center-pdf-4177.pdf Please take a look at the README on GitHub for instructions and further information/examples. Cheers
    10 points
  2. Ok, this thread has gotten a little bit out of control in regards to the original question and where it went from there. It's not even about the possibility of putting PHP into text(area) fields perse, but the ability to use variables or tags inside text fields. In your example something for $config->urls->templates. Like Soma said: "Pw has no template tag language and will never have in core level. However this is an easy task and would make a simple textformatter module. Basicly what wanze does but more convenient." I was thinking you could maybe use http://processwire.com/talk/topic/1819-markupshortcodes/ to map $config->urls->templates to [urltemplates]. Then you could just use [urltemplates] anywhere in text fields of your choosing. The sky is the limit, you can define as many tags as you like representing every combination of php/js/html you wish.
    4 points
  3. hmmm - maybe you should add an export function to the Pro Cache module ...
    3 points
  4. In case you didn't know or had forgotten, in PW you can edit /site/config.php and set $config->debug = true; to help track down errors. I've often found 'soft errors' (bad practice PHP etc (something you get if you are PHP 'lite' like I am)) that were previously hidden are displayed when this is set to true. But I also found I set it and forget that it's set then sometimes see a page load slightly slowly or with a visible 'flash' and wonder what's wrong, only later remembering I have debug left on. So now as a reminder I echo (if the setting is true) a reminder somewhere obvious such as adjacent to the homepage (or every pages's) H1. It's good to be reminded since going to a production site with it set to true is NOT recommended (API doc). This is the simple test and echo I now add: if(wire('config')->debug) echo "<span class='alert'>Flashy? Slow? Probably because of \$config->debug = true;</span>";
    2 points
  5. LOL Damn joss this is brillant! Shame I didn't notice when viewing this on mobile back then, the audio wasn't showing up, just noticed now...
    2 points
  6. So sorry guys, link is fixed.
    2 points
  7. Even after two years of PW-development I seem to make things much more complicated than they are (same goes for you Petey-boy ). Thanks Ryan!
    2 points
  8. Antti, I think you should be able to just set that email field before you output your comments. I don't think you'd need any modules or hooks or anything like that. So lets say you had a field on your page called comments_email. You may be able to do something like this: if($page->comments_email) { $commentsField = $fields->get('comments'); $commentsField->notificationEmail = $page->comments_email; } echo $page->comments->render(); echo $page->comments->renderForm();
    2 points
  9. Here's a link to the CKEditor module work-in-progress if you want to try it out. I'm not yet using it in production, but it seems to work well locally on the sites I'm developing. https://github.com/ryancramerdesign/InputfieldCKEditor
    2 points
  10. A short tutorial/help package aimed at new users (Note, a more step by step version of this tutorial is now available on the Wiki as a follow on to the Basic Website Tutorial - http://wiki.processwire.com/index.php/Simple_News_System ) - BE CAREFUL - don't mix the two. Either use the wiki or my files, not both at the same time. To be honest, you will learn more using the wiki version. This is an example script showing how to create a very basic news system with categories in PW. It includes templates and functions and full instructions of how to use it, which fields to create and so on. This is NOT a module or an instant solution, but it will help get you going faster if you have not done this sort of thing before. This example is for when you have a site carefully constructed round the page hierarchy, but want to add a basic news or blog that sits at least partly outside that tree. The system helps you to create a single news page that lists articles that are stored under a hidden parent. The articles are sorted by category - categories are created under another hidden parent and are selected with a page field. Full instructions are in the main newsfunctions.inc script and everything is commented. You can find it all here: https://github.com/jsanglier/Pw-News Joss PS: This is just one way to do a news system and should be taken as an example, not as the best way.
    1 point
  11. HTML Purifier is an HTML sanitization and validation module for ProcessWire. It serves as a front-end to the HTML Purifier PHP library. From htmlpurifier.org: Usage: This module is something that you would use from a template file or another module. The syntax basically goes like this: $purifier = $modules->get('MarkupHTMLPurifier'); $cleanHTML = $purifier->purify($dirtyHTML); The default settings seem to be about right for most cases. However, you can also specify custom settings to HTML Purifier by performing set() calls before calling purify(). For example, UTF-8 encoding is assumed, so if you wanted ISO-8859-1 instead, you'd do: $purifier->set('Core.Encoding', 'ISO-8859-1'); About this module: The reason I made this module is that I'm currently working on a CKEditor module for ProcessWire. It supports a very nice inline mode that I'd like to use. But the problem with an inline mode is that the text you edit is real rendered HTML (rather than a textarea), so that could be a security problem (i.e. XSS). I researched into into how best to resolve that, and the HTML Purifier library kept coming up. So here this module is. The new CKEditor module will require it if you want to use inline mode. Download: GitHub: https://github.com/ryancramerdesign/MarkupHTMLPurifier Modules Directory: http://modules.processwire.com/modules/markup-htmlpurifier/
    1 point
  12. Hey PW, I am only a starting developer and I am still in school and my experience with processwire is quite small but recently I've created my own module for Processwire and I kind of had to ask and copy a lot from other sources, now I want to create a small walk through tutorial for people with the same lack of knowledge as me And as a guide for myselfs in the future 1) Setting up the file. Okay, so we start of by making a new document in the Module root folder and call it Harmster.module for this example, we dont need to add the .php extension. Now every module in Processwire needs to extends the classes and methods from Processwire itselfs so we start off by typing class Harmster extends Process{ } You can also extend WireData, I don't really understand the difference but both work for me A module contains 2 standart classes, init() and getModuleInfo() init() This is kind of, or the same as a __construct() method, this always executes and is executed almost at creation. getModuleInfo() This is a method that is used to show the information in the Processwire CMS. We both need to add these to our fresh class like following: class Harmster extends WireData { public static function getModuleInfo() { return array( 'title' => 'Harmster', 'version' => 100, 'summary' => 'Harmster module' 'singular' => true, ); } public function init() { $this->setFuel("harmster", $this); } This is where I, as a starting developer, get really excited about this little code in the init() method $this->setFuel("harmster", $this); Basically creates your class in every template you are going to use and it is callable by $harmster Woah! awesome right! Now this is where I got stuck on, I the user to configure some options in the module :\ hmm... Well I just went asking on the forums and the super nice community of PW came to help me, Wanze in this case (no emoticon because its not allowed) (Check it for yourselfs, http://processwire.c...lds-for-module/) And basically you need to implement some methods from an another object, you should replace this, class Harmster extends WireData implements Module with class Harmster extends Process implements Module, ConfigurableModule But when you add that and try to use your module you'll see you get an error, we need to add one more method to the class called getModuleConfigInputfields add static public function getModuleConfigInputfields(array $data) { } 2) Adding a configurable and usable textbox But now you want to add some input fields, now this is pretty hmm complicated For a simple textbox you put this inside the method you just made: $modules = Wire::getFuel('modules'); $fields = new InputfieldWrapper(); $field = $modules->get("InputfieldText"); $field->attr('name+id', ''some_text_field_saved_name''); $field->attr('value', $data['some_text_field_saved_name']); $field->label = "Hamsters rule!"; $field->description = 'Enter a nice sentance here if you like hamsters'; $fields->append($field); Now you've created a input field and you can use it with $this->get(''some_text_field_saved_name''); in all your methods in this class (no emoticon because its not allowed) If you're lazy Now what you've created is a configurable module, heres a I am lazy and i want to pastey (no emoticon because its not allowed) class Harmster extends Process implements Module, ConfigurableModule { public static function getModuleInfo() { return array( 'title' => 'Harmster', 'version' => 001, 'summary' => '', 'href' => '', 'singular' => true, 'autoload' => true, ); } public function init() { $this->fuel->set("harmster", $this); } static public function getModuleConfigInputfields(array $data) { } } Now if you want to add a overview page, much like the setup, pages, acces and module tab in Processwire CMS default you can easily do this by adding 2 new methods in your class, install and uninstall 3) Creating your install and uninstall So you want to get a nice overview for your module now eh? Well we can do that because Processwire is awesome like that I did this for my module Now, we need to add 2 methods to our class, ___install and ___uninstall (yes, 3 underscores) So add this to your class: public function ___install() { } public function ___uninstall() { } I think that these are kind of self explaing, the one method gets executed when the user installs the module and the other one gets executed when the user deinstalls the module. Now we want to add a page to PW CMS, but how (no emoticon because its not allowed) Thats actually really easy, $page = $this->pages->get('template=admin,name='.self::PAGE_NAME); if (!$page->id) { $page = new Page(); $page->template = $this->templates->get('admin'); $page->parent = $this->pages->get($this->config->adminRootPageID); $page->title = 'MailChimp'; $page->name = self::PAGE_NAME; $page->process = $this; $page->save(); } This is how you install a page, notice that we name the page to self::PAGE_NAME therefor you want to add const PAGE_NAME = 'harmster-module'; with the name of your module BUT BUT now everyone can look in to this module D:< i dont want that! Ofcourse you dont want that. Clients are famous for breaking everything where they put their hands on, so we need to create permissions! Now the way you make permissions is just genius and so easy, you just add this to your ___install method, $permission = $this->permissions->get(self::PERMISSION_NAME); if (!$permission->id) { $p = new Permission(); $p->name = self::PERMISSION_NAME; $p->title = $this->_('View Harmster Page statistics and synchronize pages with lists'); $p->save(); } And you create a permission constant just like PAGE_NAME like this const PERMISSION_NAME = 'hr-view'; And of course you can create more permissions, just genius! Now what our install method should look like is this: public function ___install() { $page = $this->pages->get('template=admin,name='.self::PAGE_NAME); if (!$page->id) { $page = new Page(); $page->template = $this->templates->get('admin'); $page->parent = $this->pages->get($this->config->adminRootPageID); $page->title = 'Harmster'; $page->name = self::PAGE_NAME; $page->process = $this; $page->save(); } $permission = $this->permissions->get(self::PERMISSION_NAME); if (!$permission->id) { $p = new Permission(); $p->name = self::PERMISSION_NAME; $p->title = $this->_('View Harmster Page statistics and synchronize pages with lists'); $p->save(); } } This will set a module page up for you And we create an uninstall method, this basicly reverts your installed permissions and pages. public function ___uninstall() { $permission = $this->permissions->get(self::PERMISSION_NAME); if ($permission->id) { $permission->delete(); } $page = $this->pages->get('template=admin, name='.self::PAGE_NAME); if ($page->id) { $page->delete(); } } Now you are might be wondering, how do i get to display content in my page :S Well, I kinda stole this from other modules and it does work, but I am open for suggestions. the method ___execute gets executed when you click on your page in the PWCMS. What i wrote in there is public function ___execute() { return $this->_renderInterface(); } and in renderInterface() i put the next code: private function _renderInterface() { $this->setFuel('processHeadline', 'MailChimp synchronize tool'); $form = $this->modules->get('InputfieldForm'); $form->attr('id','ga_form'); $wrapper_audience = new InputfieldWrapper(); $field = $this->modules->get("InputfieldMarkup"); $field->label = $this->_("Gebruikers"); $field->columnWidth = 100; $members = $this->list_members($this->get_apikey()); $html = "<table class='AdminDataTable AdminDataList AdminDataTableSortable'>"; foreach($members['data'] as $member) { $html .= "<tr><td>" . $member['email'] . "</td><td>" . $member['timestamp'] . "</td></tr>"; } $html .= "</table>"; $field->attr('value',$html); $wrapper_audience->append($field); $form->append($wrapper_audience); return $form->render(); } Bascily you create a form and you render the form and that displays it for you, just play around with it for a bit and you'll get into it, as i am still getting into it. I am lazy, here a copy, pastey (no emoticon because its not allowed) <?php class Harmster extends Process implements Module, ConfigurableModule { const PAGE_NAME = 'harmster-module'; const PERMISSION_NAME = 'hr-view'; public static function getModuleInfo() { return array( 'title' => 'Harmster', 'version' => 001, 'summary' => '', 'href' => '', 'singular' => true, 'autoload' => true, ); } public function init() { $this->fuel->set("harmster", $this); } static public function getModuleConfigInputfields(array $data) { } public function ___install() { $page = $this->pages->get('template=admin,name='.self::PAGE_NAME); if (!$page->id) { $page = new Page(); $page->template = $this->templates->get('admin'); $page->parent = $this->pages->get($this->config->adminRootPageID); $page->title = 'Harmster'; $page->name = self::PAGE_NAME; $page->process = $this; $page->save(); } $permission = $this->permissions->get(self::PERMISSION_NAME); if (!$permission->id) { $p = new Permission(); $p->name = self::PERMISSION_NAME; $p->title = $this->_('View Harmster Page statistics and synchronize pages with lists'); $p->save(); } } public function ___uninstall() { $permission = $this->permissions->get(self::PERMISSION_NAME); if ($permission->id) { $permission->delete(); } $page = $this->pages->get('template=admin, name='.self::PAGE_NAME); if ($page->id) { $page->delete(); } } public function ___execute() { return $this->_renderInterface(); } private function _renderInterface() { $this->setFuel('processHeadline', 'MailChimp synchronize tool'); $form = $this->modules->get('InputfieldForm'); $form->attr('id','ga_form'); $wrapper_audience = new InputfieldWrapper(); $field = $this->modules->get("InputfieldMarkup"); $field->label = $this->_("Gebruikers"); $field->columnWidth = 100; $members = $this->list_members($this->get_apikey()); $html = "<table class='AdminDataTable AdminDataList AdminDataTableSortable'>"; foreach($members['data'] as $member) { $html .= "<tr><td>" . $member['email'] . "</td><td>" . $member['timestamp'] . "</td></tr>"; } $html .= "</table>"; $field->attr('value',$html); $wrapper_audience->append($field); $form->append($wrapper_audience); return $form->render(); } } I'll update this tutorial in the near future as i am still working my way up (no emoticon because its not allowed) Aww, i get an error when i save it, thats not nice. Thanks for reading (no emoticon because its not allowed)EDIT Updating this tutorial very soon, its horrible and incorrect
    1 point
  13. 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
    1 point
  14. Renobird built this lovely calendar here. Is there a way to do this just using a date field? Is it possible to extract just the month from a date for example and foreach it?
    1 point
  15. Hey all, I'm releasing a new admin theme called Elegance. I tried to keep the look and feel of ProcessWire, but with a modern clean and robust touch to it. Special thanks to nikola, soma and adamspruijt, because I've used components from their themes that I liked (hope u guys are okay with it ). GitHub: https://github.com/u...ganceAdminTheme Direct download link: https://github.com/u...hive/master.zip
    1 point
  16. InputfieldMailChimpCampaign This is the very early state of a basic Inputfield & Fieldtype for creating & updating a MailChimp campaign. What it does: on create Creates a campaign on MailChimp Sends the url of the page (where the inputfield lives) to MailChimp and uses that page as campaign. Attache a mailing list to your campaign. Add several settings. Upon save ( check update on MailChimp checkbox ), let MailChimp pull a text-version of the campaign-page and store it on MailChimp. on update Update all previously set settings except the campaign ID Create a new text vesion of the campaign What you should know: Your page must be reachable from the internet. And your page must be in a published state. It's just pushing values from ProcessWire to MailChimp. Settings changed in MailChimp self will get overwritten upon page save. It's only handling campaign create & update. Send functions are not included. You can download it on github. --- note: It's in development state.
    1 point
  17. Whenever I create new page and then I type few letters in the "Title" field and then my chrome browser gives me list of values as pre-fill selection to auto fill text field data and when I select it then the next field which is "Name" which fill out automatically based on "Title" fields value, only gets value of whatever I typed but not what I have selected after I typed few letters. Anyone have having same issue?
    1 point
  18. Thanks teppo, Just a note on that SQL command. The second one has: ON version_control_for_text_fields_id__data but it should just be: ON version_control_for_text_fields__data
    1 point
  19. Your welcome! Greets from the MarkupShortcode developer
    1 point
  20. Very cool module, and it looks like it can do exactly what I want. My original question about php in fields was driven by my specific need to use the value of $config->urls->templates inside markup fields. It looks like MarkupShortcodes makes this relatively easy. Thanks!
    1 point
  21. I've seen this happen before, just didn't have the time to see what's causing it then. Now that I did, it seems pretty obvious: JS related to title field only expects keyup, which isn't triggered when you choose a value from autofill list. Making following change would fix this, though I wouldn't necessarily suggest that you make this change locally -- it would make it slightly more difficult to update ProcessWire later. Posting it here just to point out what the problem is/was. --- a/wire/modules/Inputfield/InputfieldPageTitle/InputfieldPageTitle.js +++ b/wire/modules/Inputfield/InputfieldPageTitle/InputfieldPageTitle.js @@ -25,7 +25,7 @@ $(document).ready(function() { $nameField.val(val).trigger('blur'); } - $titleField.keyup(titleKeyup); + $titleField.bind('keyup change', titleKeyup); $nameField.focus(function() { // if they happen to change the name field on their own, then disable I've also just opened an issue for this at GitHub, let's see what Ryan says
    1 point
  22. Hi Ryan, Thank you for your reply, amazing how no single thread remains unseen by you! For now I’ve added it to the .htaccess file as well, I’ll be sure to remember this solution if I ever run into this issue again. Thijs
    1 point
  23. I did mean previously that eval() to execute php is bad practice theres more elegant ways to archive what you're speaking.
    1 point
  24. A friend of mine tell me about process wire.
    1 point
  25. To add an image to TinyMCE, make sure the template has an images field - that will be your local library for the page, if you like. Upload what ever images you want. To insert into TinyMCE, click on the TinyMCE images button - a bespoke images popup will open listing all the images from your image field (Note: you can also browse images from other pages). Select an image and resize to suit (an automatic thumbnail will be created). Choose your alignment, and click the box if you want the image to link to the original version. Insert, and there you go. NOTE: If you would like those images to open in a lightbox (for instance colorbox or fancybox), Install and set up the jquery plugin (making sure you also installed JQuery, of course) and then you can use a bit of jquery to automatically add the required images for any <img> tag that is surrounded by an <a> tag. Probably limit it to the container where your articles appear, for safety. The image system in PW means that when ever you dictate sizes, whether that is via TinyMCE (and CKEditor in a day or so), or set sizes when rendering images in your template files, thumbnails are cached of the right size without you actually having to tell it to do so. And if you are using image fields (rather than inserting via TinyMCE), there is also a superb Thumbnails module that allows you to preset multiple thumbnail sizes and comes with a Crop function so you can customize each one.
    1 point
  26. Yep, just always replace the profile image with selected one.
    1 point
  27. Simple way would be just use page per image (and then choose background with page field): /background-images/ /background-images/first-image/ /background-images/second-image/ /background-images/third-image/ This solution also scales, when your client wants to have different "color scheme" per image etc.
    1 point
  28. You are crazy genius if you can build site like desk.com in 1-2 days. But wait.. you actually are crazy genius!
    1 point
  29. I could build this site in PW in 1-2days and it will be fully flexible content block type you can build those pages and have all configurable and sortable just powerful with sliders and colorpickers. Think outside of the 'page' and step back. Use them as blocks. You got jquery at your fingertips for the whole page tree, repeaters, page references. This may sounds as it would be silly but see pages as repeaters and there's nothing that can stop you. See one one page as a page you look on the screen and you'll be limited by what it can do. PW is build to work this way and performs and scales very well. There's plenty of module already and they`re easy to understand and build/maintain. I'm not a very good coder but PW makes me look like one.
    1 point
  30. Interesting discussion. If "sandwich" type of website (without actually coding it by hand) is what you are building, then CMS like Concrete5 (http://www.concrete5.org/) or Apostrophe Now (http://www.apostrophenow.com/) is probably much better solution than ProcessWire. ProcessWire strengths are definitely in it's data modelling and as a building platform (framework). When it comes to sites where each page should be a little different to each other with totally custom content (no clear templates) - then PW helps you very little out of the box. Of course it would be my weapon of choice, if I would start building simple cms for that need
    1 point
  31. If I am writing a journal entry I may want to write a paragraph, insert an image inline with the text, write another paragraph and embed a Youtube video. I don't want to create a new page type with a text field or two, an images field, a movie field and a template to put them all together. I just want to sandwich some html markup with a header and a footer and move on. There would be nothing stopping you from doing so with any text area field with tinymce turned on. Images added to the page become available in tinymce/rich text via the 'Select Image' button. You can also choose from different pages. By default the tinymce configuration is fairly bare-bones but you can change this to the point where it is a ms word clone. Not 100% sure about youtube stuff but you can prolly just insert the embed code where you want. Ryan is also working on a CKEditor implementation which may be of interest to you. Even if you load the images in a journal entry into the images field of a typical page template, how are you supposed to access them from within your rich text or markup?... see the above One of my competitors is Salesforce's Desk.com, and they have an outrageously good sales website. A site like this would be really tough to develop in ProcessWire since almost everything on the site is handcrafted, single-use content. Not much of their site is well-suited for templates, but the whole thing is pixel perfect. There's a place in the world for content that isn't generated by invoking a template on a set of page data. I don't see anything on that site (which is indeed nice) that would be particularly tough to do in PW. In fact, it would suit PW well i think. When you say "Not much of their site is well-suited for templates, but the whole thing is pixel perfect." i don't understand. How do templates and fields relate to a design and layout being pixel perfect? In essence the desk.com site is a well executed Twitter Bootstrap site and i'm guessing that they have structured their content well in the backend. Or maybe it's just handwritten html, who knows. ProcessWire is an awesome tool, but not all content is so rigidly aimed at separation into data and templates. Some content is just content, use it once and keep moving. Lots of other CMS's make that easy, but they don't excel at the structured repetitive stuff like ProcessWire does. It would be great if ProcessWire also made it easier to produce those conventional throwaway pages, too. I'm not saying that PW is perfect. Some things take getting used to, others could be improved upon and surely there are other systems out there that do a better job at a certain content management aspect. What i don't see is that PW makes it particularly hard to create content, throwaway pages, or otherwise.
    1 point
  32. But you know that with Tinymce and soon also with the brand new CkEditor you can insert images from the images field into your html markup? (http://processwire.com/talk/topic/627-ckeditor-module/page-2) There's also a Youtube-video Textformatter by ryan. Just copy the Youtube-url inside and it gets replaced with the video. If you have content-editors that understand html/css etc, you could use only a richtext/image field and write the complete markup there. However, this is not a good solution for most of the editors because they can mess up the entire design. It's safer to split things up in different fields (headline, description, body, images, files, related_posts etc.). This way ou can also easy change the whole markup afterwards.
    1 point
  33. This is an interesting thread that touches on the difference between PW and other cms'es. Usually a cms is defined by it's rules and dashboard that you first have to learn before you can make websites with it. Advantage: it shows you defined ways of working and you'll know what to do. Disadvantage: you are bound to it's rules and dashboard and sooner or later this will limit your creativity. PW can make a developer with little coding experience float in it's open potential sometimes not knowing where to go. Look how this still pulls my leg with PW, so I can understand what DZoneRick is saying in his posts. But I prefer it this way over other cms'es because coding skills can always be learned. I really hope that PW will never build in out of the box fancy cms ways/rules on it's future roadmap, ending up just another cms. I'm not an experienced coder (yet) but I think DZoneRick can use .inc blocks or <?php include 'content.php'; ?> to accomplish throw away content where he needs it.
    1 point
  34. Would it be nicer/easier to have profile image as a separate image field?
    1 point
  35. That is prettiest and probably most easy to use/browse calendar in long time. Reno is my designer hero for sure!
    1 point
  36. Thanks for confirming. A fix has been pushed for this.
    1 point
  37. Adding this to your .htaccess file might do the trick too: AddDefaultCharset UTF-8 Make sure your document is also specifying a <meta charset>.
    1 point
  38. Please send a cold keg of Unibroue La Fin Du Monde, and I'll have my tap ready. Just kidding, but that's one of my top 3 beers and has been for a long time. Canadians know how to make some damn fine beer, that's for sure. Luckily it's easy to get around here. A good thing, because Georgia has some kind of laws about shipping beer (to protect the poor beer/wine distributors).
    1 point
  39. You can enter any php code in text and use eval like modx, but that's horrible practice not shining.
    1 point
  40. The possibilities are endless in Pw to achieve what you want. Some Possibilities: Don't use $page->title but $page->id instead - this id is unique even if you change the title Better: Give the pages you need the additional js the same template => this way you only have to check for the template Add a checkbox field to the template(s) of pages that need the additional stuff and check if this is set If you really, really need to access the templates url from inside a textarea, you could do something like this: //in Textarea blu blu blu {{templates}} blub blub blub //In template $blub = str_replace('{{templates}}', $config->urls->templates, $page->blub); @pwired What? In Pw your fields ARE the template variables, just more flexible. Who stops you from adding html/css/js into a textarea field in ProcessWire?
    1 point
  41. Another would be to hand the items to the outer_tpl. $customPage = $pages->get('/.../'); $item = "<li><a href='{$customPage->url}'>{$customPage->title}</a></li>"; echo $modules->get('MarkupSimpleNavigation')->render(array('outer_tpl' => "<ul>$item||</ul>"));
    1 point
  42. Ryan, you are animal. Others talk, but you do. I definitely agree with ckeditor and it's inline speed. And about the docs: yep, I had the same experience recently when I had to dig little deeper. My first experience with the docs was very positive though
    1 point
  43. I can confirm Dave's problem. An integer field that I set to Number (html5) in Numeric Input Type, reverted to Text when saved. Dave s not crazy.
    1 point
  44. I attached a screenshot to show what I did with processwire - piwik
    1 point
  45. Okay this was very short notice so it is incredibly rough! But this is for Diogo and all those others wedded to PW http://21stcenturyblues.co.uk/pwdream1.mp3 (Organized, try listening at less than 120db!)
    1 point
  46. radioparadise.com. Plays a lot of great stuff.
    1 point
  47. Thanks @Ryan. Looking at my module again, I seem to have missed that I already have a recursive remove dir function I used. I just forgot about since it's some time ago already I implemented that. Baaah, shame on me I'll update the module again to correct that. Yeah for future version. It's might be cool to have a version check to see if a module support the installed PW version. @Nico. I'm not sure. Does the zip extract not work for you? I already have a much simpler zip extract function, but thanks anyway. At least, it remembers me to implement DIRECTORY_SEPARATOR too.
    1 point
  48. Soma, here's what I did in FormBuilder, which also requires wireRmdir: /** * Temporary, until Form Builder requires PW 2.3 * */ if(!function_exists('wireRmdir')): /** * Remove a directory * * @param string $path * @param bool $recursive If set to true, all files and directories in $path will be recursively removed as well. * @return bool * */ function wireRmdir($path, $recursive = false) { if(!is_dir($path)) return false; if($recursive) { $files = scandir($path); if(is_array($files)) foreach($files as $file) { if($file == '.' || $file == '..') continue; $pathname = "$path/$file"; if(is_dir($pathname)) { wireRmdir($pathname, true); } else { unlink($pathname); } } } return rmdir($path); } endif; Always be very careful with wireRmdir and check everything you send to it to make sure it's correct and not blank, etc. This function always scares me a bit. The wireRmdir function will empty your entire file system if told to.
    1 point
  49. Cool thanks for writing. Extending "Process" in a module is meant for admin pages. Each admin page has the admin template and a process attached. For normal modules you extend "Wire" or "WireData", if you want to create hooks and all sort of helper modules. For more infos look at what Ryan wrote here: http://wiki.processwire.com/index.php/Module_Creation
    1 point
×
×
  • Create New...