Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/06/2013 in all areas

  1. Hi all, I'm a big fan of the Sublime Text 2 text editor and of course of huge fan of ProcessWire, so I went ahead and created a library of PW snippets to be used with the ST2 Snippet system. I followed the PW cheat sheet, and created Advanced and Basic versions. The Advanced version contains only those seen in the advanced mode of the cheat sheet, so if you want the full set, you'll want to get both Basic and Advanced. They are on GitHub here: https://github.com/evanmcd/SublimeProcessWireSnippetsBasic https://github.com/evanmcd/SublimeProcessWireSnippetsAdvanced I've just submitted the Advanced set for inclusion into Package Manager, so hopefully that will be added soon. See the README for more info. Any feedback welcomed
    4 points
  2. I've been doing the freelance thing for a while now and have a small business (very small, I am the only employee...LOL). I'm constantly on the lookout for free or inexpensive tools to make my work easier and make me more productive. I thought I would share some of the ones I use and see what else everyone else is using. My favorite ones at the moment are: Do - http://do.com - Free. Great for managing projects and tasks, and you can sync your task list and deadlines with your Google calendar. Also has an iphone app. Invoiceable - http://invoiceable.com - Free with branded footer, to remove footer one time fee of £49. I've found this to be great for creating and sending invoices. Allows for recurring invoices which is a big plus for me, and allows you to accept payment via PayPal. Google Calendar - I use this for making sure I never forget an appointment or task. Since it interfaces with do.com I can really keep track of jobs and deadlines, as well as my other obligations. Integrates well with my iPhone calendar as well. DropBox - https://www.dropbox.com/ - For saving files so I can access them elsewhere, and also for temporary backups. I'll add more as I remember them, but these are my favs at the moment. What do you use?
    2 points
  3. You can just do: if($field->type == 'FieldtypeText'. But it looks like you are intending to operate on the 'title' field? In that case, I think what you really want is FieldtypePageTitle. The "+" won't concatenate strings in PHP. You want to use "." instead. With regard to everything else, it looks like you are on the right track. However, it might make more sense for you to just implement a Textformatter module instead, as this is exactly what they are designed for: /site/modules/TextformatterOzwim.module class TextformatterOwzim extends Textformatter { public static function getModuleInfo() { return array('title'=>'Ozwim','version'=>1,'summary'=>'Ozwim summary'); } public function formatValue($page, $field, &$value) { $value .= "- modified page title FTW"; } } Once you've got that, install it and select it as the Textformatter for your page title field (or whatever field you want to apply it to).
    2 points
  4. To give you some ideas, here is what I do. I append my site name to the end of every <title>, it helps with SEO, bookmarks, etc. OrganizedFellow.com To the left of that I prepend the category name, whether it be Blog/Article, Products, Contact Page, About, etc. Blog | OrganizedFellow.com To the left of that I prepend the title of the page itself. I took up jogging | Blog | OrganizedFellow.com Contact Me | organizedfellow.com Screws and Nails | Products | OrganizedFellow.com There is no ONE way. Feel free to do it how you like.
    2 points
  5. Hi alishaantony, welcome! Which plugin do you mean exactly? I suggest to read through the docs first. It's as simple as this: // In template where your html markup is, we output the title of each page in the <title> tag <title><?= $page->title ?></title>
    2 points
  6. Ha! Now I have another ten pages to read, along with those 30 designer depot etc. articles piled up in my inbox and a couple of issues of .Net gathering dust under the bed. I'm actually working on ClipperCMS, a fork of Evo, now, and it's while researching something that cropped up during a write-up of its API that I found your post. I suspect it's what I needed some time last year to help me make sense of PW, since my brain has been rewired to view the world from an Evo standpoint. And now I'll have to read it and have another look. Pretty much like MODX, in fact - my first reaction to that was: "Oh no, another CMS that keeps everything in the database" (after finding Joomla site after Joomla site like watching paint dry as the page built up from bits & pieces). Something spurred me to have another look at MODX later, and I latched on to it immediately second time around. I'm pretty committed to Clipper, I think it has a great future for Evo fans, but I'm sure it's worth having a go at PW as well, and your guide could well give me the boost I need to do that in a reasonable time. TVM! KP
    2 points
  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
    1 point
  8. The discussion about an images "bucket" has been around for a while (can't find links atm). I still fail to see why you are treating CSS images as content though. But we all work differently I guess, so if that suits you, go for it
    1 point
  9. NoDice, I have re-read your post #6 and am still confused 1. By background images, you referring to the arrow images that control the "pagination" of the carousel? (e.g. bg_direction_nav.png). If yes, why would you want to edit those in PW? 2. If by "background" images you refer to the images actually looped through (the carousel), then those are not supplied by CSS as far as I can see. They are directly in the HTML. I have not seen any requirement to use background images as you state in you OP? How is that a problem? Wont flexislider produce consistently produce the same classes (e.g. flex-next and flex-prev) that you can style by overriding in your own CSS file? Quick clarification. The folder number is the ID of the page. That never changes....btw . Anyway, I'll let you explain what you are after.
    1 point
  10. Nice - the only thing I was thinking by the approach I suggested is that it would allow you to also set the status to hidden, or any other option you wanted.
    1 point
  11. I hv change the module............and it works ............ It needs three steps Line No: Add this 90 $this->set('publish', false); 110 else if($key == 'publish' && $value) { if($value!=0&&$value!=1) throw new WireException('$page->publish value should be true or false'); $this->publish = $value; } 210 if(!$this->publish) $this->contact->status = Page::statusUnpublished; and in your code just add $form->publish = true; and done.
    1 point
  12. Or....I could just implement the input fields in a Table, duh! Batcher does this (module) so does this excellent example (frontend - but can work in a module too) by Soma Who said tables were dead?!
    1 point
  13. Oh, I see - you are actually using Ryan's module from the first page of this thread - sorry, my bad! I assumed you were using diogo's code. There is a line in that module: $this->contact->status = Page::statusUnpublished; The easy hackish option would be to remove that line from the module code.
    1 point
  14. Just before: $mypage->save(); which I mention a couple of posts above, you just need to add: $mypage->removeStatus(Page::statusUnpublished); EDIT: although I thought they were published by default and you actually had to add: $mypage->addStatus(Page::statusUnpublished); to set them to be unpublished.
    1 point
  15. Ye Yes...the note Soma referred to is in the dev source code ....I believe...(since allow unpublished pages is only in the dev atm)
    1 point
  16. Hi demiansan. Welcome to PW and the forums! The Wiki stuff is in the process of being brought over to the main site. These links should get your started, if you haven't seen them already: http://processwire.com/api/ - the official docs; a must read http://processwire.com/talk/forum/13-tutorials/ - a couple of tutorials http://processwire.com/talk/topic/4173-grouped-forum-posts-links-articles-tutorials-code-snippets/ - an effort by the community to group links to useful resources, tutorials, etc http://cheatsheet.processwire.com/ - the cheatsheet Feel free to post any questions you might have
    1 point
  17. The question on that post was about having a different background image per page. Since CSS is not dynamic, that could only be done via PHP. Do you want different background images for your pages? If not, just do it the normal HTML/CSS way. No PHP required. I have an images folder in my css folder (/site/templates/css/images). No PHP involved; just plain old CSS. Maybe am missing something?
    1 point
  18. Please ignore me if I seem to be rambling....I just quickly read this...Yes and Yes. You can have your CSS call images from an assets folder. No need to put those images in a page first...
    1 point
  19. The code to render the rss feed should be placed in a template/page called "rss" or similar, not in the template for a "normal" page that includes content that you want in the feed. Try that and let us know how you go.
    1 point
  20. Sounds like you have pretty unique needs here, and I understand now – your approach does make sense given the context. I think Kongondo's ideas are good here, and I will keep thinking about how we might support separate labels in the asmSelect list there for the future.
    1 point
  21. I've been experimenting with something similar. For now I use the prependTemplateFile and I've changed my homepage fields/template set-up. Actually my homepage is my 'settings-page'... In the _init.php I use: $sitename = $pages->get(1)->site_name; $telephone = $pages->get(1)->site_tel; $siteslogan = $pages->get(1)->site_slogan; that way I did some facebook stuff etc... image etc... if ($page->get('news_mainImage') != ''){ $thumb = $page->news_mainImage->getThumb(thumbnail); $fbImage = 'http://'.$config->httpHost; $fbImage .=$thumb; // $fbImage =$page->news_mainImage->httpUrl; doesn t work? }else{ $fbImage = 'http://'.$config->httpHost; $fbImage .= $config->urls->root; $fbImage .= 'site/templates/styles/images/logo.png'; } That way I can use whatever I want whenever I need and if I made a mistake [e.g. phonenumber has to be changed], only one field has be corrected in the back-end... <title><?php echo $page->get('pagetitle|title'); ?> :: <?php echo $sitename; ?> :: <?php echo $siteslogan; ?></title> the only thing I was wondering... since I'm using it in my "init" file, maybe I should use 'auto join' fields... but that's for later... still experimenting... Am I on the right track, or am I overdoing it? Grtz!
    1 point
  22. I figured it out. Since PageRender::renderPage is providing the rendered output in $event->return; rather than the function returning it (since it is actually a hook to a non-existent Page::render), then you have to do the same. As a result, this code in your before hook function should work: $otherEvent = $event->arguments(0); // grab event provided to PageRender::renderPage $otherEvent->return = "<p>Hello World</p>"; // plug in our value $event->replace = true; // prevent PageRender::renderPage from being called
    1 point
  23. All projects, lists, tasks, etc. begin as handwritten notes. They end up in Trello. All collaboration between myself and client is done via Gmail. Google Calender for important dates. I used to have a very complicated process involving more apps (I cut back A LOT!) I use the username OrganizedFellow because I cope very well with my ADHD I use RescueTime to manage my productivity. When I reach 80%, I treat myself to a beer, lol
    1 point
  24. Technically everything can already be hooked into, return values modified, or methods replaced, the most likely candidates being Inputfield::render() and Inputfield::processInput(). But admittedly I can't think of an occasion where I'd need to do that. Fieldtypes are defining data that goes into the database and needs a schema, while Inputfields are handling that input at the UI level. An "anything goes" type Inputfield where you override the render() and/or processInput() with hooks would likely only be useful for situations where you want to substitute the way the input is performed at the UI level... but that's the purpose of Inputfields in the first place, so the question would be: why not just make an Inputfield? Perhaps there are some cases, like if you wanted to replace all <select> fields with a jQuery driven Chosen field or something. As for simplifying the approach, it's actually really very simple and a lot more so than what I think most people realize. But when people are making their own Fieldtype/Inputfields it's usually because they are trying to meet some data storage or input need that is not fundamentally simple in any system. In my opinion it's simpler and more reliable to handle such a need using the pattern made for it (i.e. custom Fieldtypes and/or Inputfields), rather than to selectively override things.
    1 point
  25. Assuming your field is called "seo_title" your template code should look like this: <title><?= $page->get('seo_title|title') ?></title> Which means the seo title field is used and if not present the usual title. Forget about keywords
    1 point
  26. Welcome to the PW forums kp52 thought that avatar looked familiar
    1 point
  27. OMG! Keith is here!!! Welcome to PW and the forums! Nice to see you in these parts. I didn't know you went with Clipper...anyway, hope to see you here more
    1 point
  28. Personal letter to Ryan, oh, I'm so excited
    1 point
  29. I second that, looking into nginx as well! edit: found it here: http://processwire.com/talk/topic/3246-nginx-directives-for-procache/
    1 point
  30. Hi, Thomas and welcome to the forums! From some of the details in your question, it looks like you have some experience in these matters, so I won't go through the obvious suggestions. The problem does indeed look like an .htaccess problem. There is some info about getting PW working on 1&1 starting here http://processwire.com/talk/topic/264-editing-htaccess-%E2%80%93-ok-or-not/#entry1788 I can't vouch for it's accuracy but it looks like it addresses similar problems to those you are having. Take a look, and if it doesn't help, come back here and I'm sure we can get you working.
    1 point
  31. I don't think it's possible. To achieve your goal, you can make 'Your details' an InputfieldMarkup and add the lables / input fields yourself (HTML markup).
    1 point
  32. Super cool ideas, thanks a lot! Point #3 sounds really good. The more I learn about ProcessWire and use it, the more I love it.
    1 point
  33. I can think of different ways to deal with this one. Printout: As someone suggested in the forums (Maybe Renobird?), they print out a list of all the fields on their site and what the fields are for. Admin page: Maybe create a hidden page, under Admin, with a list of all the fields and what they represent for each company? Custom Admin page: Create a custom admin page using Diogo's Admin Custom Page module that renders only for superuser showing you the list of fields and what they represent for each company. Maybe this is best because you can view it as read only and can get as creative as you want with the output Just thinking out loud here...
    1 point
  34. You can do this in ProcessModules. If no URL segment is given, ProcessWire executes the execute() method of your class. If you visit the module with an urlSegment, Pw executes the executeNameofurlsegment() method. Example: I used this in my Google Analytics module to load the statistics for the different sections with ajax: https://github.com/wanze/ProcessGoogleAnalytics/blob/master/ProcessGoogleAnalytics.module#L357 What does the code of your module look like? Do you extend Process?
    1 point
  35. Hi Rjay, thanks for the prompt response! I have that folder to 755 What permissions do you have for yours? Do you have any .htaccess settings for both main sitedomain.com and siteotherdomain.com on the servers LAMP public_html or www folder? UPDATE: Its working now I had some .htaccess settings on the public_html folder, I forgot to remove for the multisite to work. Thanks for all your help Rjay.
    1 point
  36. You'll find what you ask here http://wiki.processwire.com/index.php/Module_Creation
    1 point
  37. Hey Ryan, Using the following in InputfieldPageName.js seems to do the trick. if(name.length > 128) name = $.trim(title).substring(0, 128).trim(this); I was looking at InputfieldPageTitle.js and noticed that it doesn't actually do the truncate to 128. The browser is truncating to 255, but I think it is missing something like: $titleField.val(val).trigger('blur'); Also, I am not sure why, but the approach in the first code block above doesn't work for the title. Instead, I had to use: if($titleField.val().length > 128) val = $.trim($titleField.val()).substring(0, 128).split(" ").slice(0, -1).join(" "); But, I guess I am not sure what you actually want to do with the title field. Do you want it truncated to 255, or 128 to match the length of the name field? Some potentially more robust ways of doing this: https://github.com/micjamking/succinct/blob/master/jQuery.succinct.js https://gist.github.com/ChrisCinelli/5688048 Neither tested so far, as I don't think we need them. In particular, the succinct plugin was designed to deal with a couple of edge cases that I don't think should affect us: http://stackoverflow.com/questions/4637942/how-can-i-truncate-a-string-in-jquery
    1 point
  38. @Ryan: thanks for detailed info! @John: I'll take a closer look at this once I get the chance, though what Ryan explained above should be pretty helpful already. Just got back from quick trip to Stockholm, still on mobile and a bit unsteady connection.. For the record, data-attributes don't work too well with purifier. I needed these for pbckcode to recognize the language next time I edit same code block (for some reason class wasn't enough) so I ended up modifying the plugin itself and changing all mentions of the data-lang simply to lang. Bit ugly perhaps, but that did the trick.
    1 point
  39. Hi Alex. Welcome to PW and the forums. See screenshot below. Those particular settings are configured under ADMIN > SETUP > FIELDS > INPUT
    1 point
  40. Andrew, That's obviously MODX syntax. Before I answer your question, I have two things to say: 1. Please, if you have a question, post in either the General Support or the Getting Started or the API & Templates sections of these forums according the the relevance of the question.. This is the Tutorials Section of the Board where your posts/threads should be teaching something rather than asking questions, thanks. 2. Have you read this guide to PW for those familiar with MODX? If not, please do. It will answer questions such as above. As you'll see from that guide, apart from the name of a page, all other fields on a page are custom fields. There is no default title, keywords, description, etc fields. You will have to create those fields and add them to your template. Then, create a page and make it use that template. If you want your keywords to be unique to each page, then do it this way (illustrated below). If you want your keywords to be the same across the whole site, then you can create a page that will act as a settings page. For now, I'am not going to go into details about such a setup but will let you explore the system more. OK, so, 1. Create the following fields types a. Name: keywords; Type: text or text area (depending on how much space you want) b. Name: description; Type: text area Make sure to give the fields labels and a "description" if you want to. Your PW install should already come with the title field (if you installed the default PW profile) 2. Add the fields to your template. Order the fields in the template as you wish 3. Create a page and make it use the template in #2 4. You will see the keywords, description and title fields on that page. Enter your keywords and description in the fields and edit the page as you wish. Hit save. 5. In your template file <meta name="keywords" content="<?php echo $page->keywords;?>"/> <meta name="description" content="<?php echo $page->description;?>"/> <meta name="robots" content="All"/> <title><?php echo $page->title;?></title> You don't need the <base> tag in ProcessWire. You can get fancy and only echo out the keywords and description if they are actually present on your page. How to do that? That'll be your homework
    1 point
  41. Just curious - you say that you want to make the title field unique, but in your code you are trying to set the value of the invoice_number field. This should do what you want, assuming you actually want to set the title field. <?php class MarkupTitleField extends WireData implements Module { /** * getModuleInfo is a module required by all modules to tell ProcessWire about them * * @return array * */ public static function getModuleInfo() { return array( 'title' => 'Markup Title Field', 'version' => 100, 'summary' => 'Set the title field to predefined value', 'singular' => true, 'autoload' => true, ); } public function init() { // add before-hook to the inputfield render method $this->addHookBefore("Inputfield::render", $this, "renderField"); } public function renderField(HookEvent $event) { // // get the current field $field = $event->object; if(($field->name == 'title' || $field->name == '_pw_page_name') && $field->value == '' ) { $last_page_id = wire('pages')->get("include=all,sort=-id")->id; $id = date("Y") . "/" . ($last_page_id+1); // example for a possible id value $field->set('value', $id); } } } Edited code to get the id of the page that is about to be created. Not sure if this is completely robust. You might want to consider a different unique identifier.
    1 point
  42. Actions that create, modify or delete an entry in the DB (like save) should be done via POST requests. I find urlSegments or GET variables handy for the rest. Here's a rough skeleton of how you could do it: function edit() { ... } function save() { ... } function delete() { ... } if($input->urlSegment1 == 'edit') edit(); else if($input->post->save) save(); else if($input->post->delete) delete(); else $session->redirect($page->url . 'edit');
    1 point
  43. I think I've been relying on pen and paper too much and need to look up a lot of these
    1 point
  44. Sometimes a bit of inline CSS is better than a whole lot of other hacks to get past it. One of the discussions I mentioned is this: http://processwire.com/talk/topic/2210-help-getting-a-custom-styles-php-file-working/. In a nutshell you'd have to use a .php file for your CSS and send a header telling browser that it's actually CSS file. Not very difficult, but I'd still avoid it unless it's really necessary. By the way, I replied too hastily (tried and true "reply fast, edit later" strategy) and that code there has a few issues. I've corrected them to my reply above, so you might want to check it out before trying this..
    1 point
  45. Thanks for the update–It works perfectly here! I will submit a pull request to you that makes the title attribute translatable. I also moved the hook-attach logic to a ready() method (rather than init), and made it attach the hooks only if the page template is 'admin'.
    1 point
  46. V1.0.4 pushed, should fix both issues, a bit more cleanup and optimization needed but I'm pretty happy with this where it is, just wondering how I can make the title text translatable if it's inserted using JS? Maybe I missed that in the docs.
    1 point
  47. I'm really liking this module. Thanks for making this! I used it yesterday, all day on a multi-language site that I'm developing with 5 different languages. It has really made the interface a lot nicer to look at and use. It makes me think we should have this in the core. There are two things I think I'd personally add to it though: I'd make the tabs that have un-populated text a little different, perhaps a little faded or lighter text or something to indicate the empty state. Either that, or the populated tabs bold. I'd add an option to to switch between tabbed view and regular stacked view. The reason is that I anticipate clients have cases where they are translating and want to see the text in multiple languages at the same time. But overall tabbed view seems like a much better default than what we've got now. Has anyone tried this with Teppo's text version control module? I'm wondering if it would break that... will probably find out later today.
    1 point
  48. Here we go: https://github.com/apeisa/CommentRatings
    1 point
  49. I worked to make a module early this AM before everyone woke up, and have been banned from the computer since. But got a minute to post it so figured I would, and then I'll post a live example tomorrow. This is just a start on this module... lots more to cover obviously, but just wanted to get the momentum going. And it is fully functional even in this state, if anyone wants to try it out. I just experimented with simple forms having "name, email and message" text fields, so far. Here are usage instructions below (pulled from the module file), and the .module file is attached if anyone wants to try it or work with it. Just place it in: /site/modules/FormTemplateProcessor.module /** * Module to let you use templates as web contact forms. * * Can send you email and/or save the submission to a page in your site. * * Usage: * * 1. In admin, create the fields you want to be part of the form. * 2. Create a new template and assign your fields to this template. * 3. Create another template for your contact form page (if you don't already have one). * 4. Use the example below as a starting point for this contact form page: * * $form = $modules->get('FormTemplateProcessor'); * $form->template = $templates->get('my_contact_form_template'); // required * $form->requiredFields = array('fullname', 'email'); * $form->email = 'your@email.com'; // optional, sends form as email * $form->parent = $page; // optional, saves form as page * echo $form->render(); // draw form or process submitted form * * 5. Use CSS to style the fields. See the bottom of this file for suggestions. * */ Download at GitHub: https://github.com/ryancramerdesign/FormTemplateProcessor
    1 point
×
×
  • Create New...