Jump to content

kongondo

PW-Moderators
  • Posts

    7,479
  • Joined

  • Last visited

  • Days Won

    146

Everything posted by kongondo

  1. Welcome Xpn (cool name, btw!)...since you mentioned the "m" word, this thread might be of interest in case u missed it..
  2. OK, I would recommend that you first learn the basics of PW (http://processwire.com/api/) and some PHP, if you haven't already. Otherwise, it will be difficult for you to follow any threads I point you to, for instance the below. One good way to learn PW is to go through the "Small Project Walkthrough" tutorial in the Wiki, creating a simple site. PW has nothing to do with the size of upload files. That is something you set in your server environment, in your php.ini. Google "php maximum upload size" and have a read. Also, have a look at these discussions (Google upload site:processwire.com) as well as this topic: http://processwire.com/talk/topic/3105-create-pages-with-file-upload-field-via-api/
  3. +1 for #2 Edit: Should have been clearer. I like the structure...but yes, I agree with Teppo below, it is a bit pale. Hence, why I preferred the original #2 with the darker sidebar
  4. Nice 3rd post! I prefer the 2nd one. The first one's left sidebar is too wide for my liking...Good job. Looking forward to how your progress these.
  5. Klauss, I believe you meant wetransfer? The bulk file sending service? I agree with Ryan, more info is needed before you can get helpful answers. Just broadly, you are looking to do two things - upload files and notify users. ProcessWire can do both. Google this forum (e.g. "upload" and "email notification") and you'll find multiple hits. Beyond this, we don't know the technical details about your app to give you more specific responses. Secondly, how comfortable are you with PHP and ProcessWire API? These will determine how much effort you will need to achieve what you want.
  6. Thanks Teppo! That was it. I was committing the cardinal sin - echoing $out in the method instead of returning it! (grrr!). It works as intended. That markup is output in the right place. Thanks for answering the other question too! For some reason, I didn't realise I could render an InputfieldWrapper like that. I don't know where I got the the idea that an InputfieldWrapper always goes with a form! , i.e, that I would have to do something like $form->add($wrapper) ; in the end before returning the form. Hence my original question; I didn't need form markup and was wondering how to avoid it. Cheers. Edit: I can't find the "solved/best answer button"...
  7. Hi all, Let's say I want a landing page for a process module. If I wanted a form on the landing page - InputfieldForm comes to mind If I wanted a table - MarkupAdminDataTable However, on that page, I don't want a form nor a table. I just want my plain HTML to be rendered. I have no need for Inputfields on this page. Next, I look at InputfieldWrapper - But the docs say: Not my intended question, but I don't get this bit "but you can set a value...". How? I tried different stuff without success. Final up (to the best of my knowledge) is InputfieldMarkup. This code does work: $test = $this->modules->get('InputfieldMarkup'); $test->value = "<p>My test HTML output</p>"; //return $test->renderValue();//doesn't work. Markup not output return $test->render();//works fine I get my HTML output in the right place in my module landing page in the PW Admin without any extraneous markup. <div id="content" class="content"> <div class="container"> <p>My test HTML output</p> </div> </div> <!--/#content--> But is this the way to go? The name of the class sort of suggests that it should be used with Inputfields. If I try to add my HTML independent of these methods, the markup is not output in the right place in my module landing page in the PW admin, i.e. between the <div class="container"></div>. It will be thrown to the top of the page, somewhere weird like before the <body> tag. So, am I on the right track here or there is a "more appropriate" way? By the way, I tried to use renderValue() but it doesn't output anything? What's the use case for this method? The docs say: I have studied some other modules but have not seen something similar to this sort of landing page. Thanks.
  8. Thanks Ryan! Going straight into a Gist this one, thanks!
  9. Is this thread helpful? http://processwire.com/talk/topic/5417-using-git-with-a-cms-for-version-control-and-deployment-on-multiple-machines/
  10. Logging in with email address has bee asked before (I think more than once?) and was not granted...can't find the topic now but it was mindplay. Ryan suggested to use a module instead. Mindplay ended up creating a module to do this...I'll search and post here if I find the thread..This is about ADMIN LOGIN. If you are talking frontend, please ignore me ;-) http://processwire.com/talk/topic/1838-login-using-e-mail-rather-than-username-and-general-login-issues/ Related: http://processwire.com/talk/topic/4552-user-names/ Edit: added link to thread + related stuff...
  11. Hi arpeekay, Welcome to ProcessWire and the forums... Yes, you are right. PW uses "," [i.e. a comma] as AND. The pipe symbol | is used just like in normal PHP "OR". http://processwire.com/api/selectors/#or-selectors1 - OR http://processwire.com/api/selectors/#and-selectors - AND But maybe there is a prettier way of writing those long AND conditions? - just wondering....
  12. Glad you sorted it. One thing I love about PHP is that it gives you very useful, meaningful feedback/error messages...unlike Windows which would say something along the lines "Something went wrong...and we've had to shut down the system" - bang BSOD!...I digress; I love my W7....
  13. Like Soma says and I alluded to earlier. Check your /sites/modules folder... if you have a file called MarkupSitemapXML.module inside this file you must also have class MarkupSitemapXML extends..... if you have a file called MyMarkupSitemapXML.module inside this file you must also have class MyMarkupSitemapXML extends.... In other words, the class and module name should match..... Edit: Btw, You would also have to rename related .css and .js files if you want them to be loaded with the module. Edit2: Was a bit misleading; edited for clarity.
  14. A error message about a class being redeclared means that you have, in this case, two modules with the SAME CLASS name running. Renaming the module alone won't do the trick. You need to open the .module file and rename the class there, e..g MyCustomMarkupSitemapXML. A .module file is just a php file.
  15. Soma, will you be updating to 1.10. any time soon? I know it is in beta and may break some things but there are some very nice changes. I also like their new website btw.
  16. kongondo

    1800 Members!

    Yeah, Congrats! Have seen quite a few new members recently. Would love to hear their stories how they found PW Recent contest? Welcome all!
  17. EDIT Again - I just read that tutorial you pointed to and I see if uses: public function __construct() to set the default values. I haven't used that before. I guess I started by copying from other modules and never came across that approach. I guess there are a few different options, but construct does seem cleaner. @Adrian: Yes you are right, it does. Btw, all the modules I pointed to also use the __construct() method. Wanze explains it well above why this is important. Thanks Wanze! Thanks Adrian for the write-up! I have edited my first post with the names of the methods/properties. My links kept being mangled up and anyway, when code is updated, they may move lines ...
  18. As you wait for other responses, have a look at the following examples from AdminSaveActions module. It looks really straightforward. Thanks for asking this question...I'll be needing this soon . Seems, you set the defaults in one function, then build the form/fields in another function using the defaults previously set...or something along those lines AdminSaveActions module static public function getDefaultConfig() {} https://github.com/niklaka/AdminSaveActions/blob/master/AdminSaveActions.module#L51 public function __construct() {} https://github.com/niklaka/AdminSaveActions/blob/master/AdminSaveActions.module#L105 public static function getModuleConfigInputfields(array $data) {} https://github.com/niklaka/AdminSaveActions/blob/master/AdminSaveActions.module#L390 MaintenanceMode module static public function getDefaultData() {} https://github.com/Notanotherdotcom/Maintenance-Mode/blob/master/MaintenanceMode.module#L25 public function __construct() {} https://github.com/Notanotherdotcom/Maintenance-Mode/blob/master/MaintenanceMode.module#L38 static public function getModuleConfigInputfields(array $data) {} https://github.com/Notanotherdotcom/Maintenance-Mode/blob/master/MaintenanceMode.module#L52 ProcessTrashman - Last one, static public function getDefaultData() {} https://github.com/apeisa/Trashman/blob/master/ProcessTrashman.module#L42 public function __construct() {} https://github.com/apeisa/Trashman/blob/master/ProcessTrashman.module#L54 static public function getModuleConfigInputfields(array $data) {} https://github.com/apeisa/Trashman/blob/master/ProcessTrashman.module#L255 MarkupRSS module - Sorry, the very last one (this one has more detailed defaults and some notes) protected static $defaultConfigData = array() https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Markup/MarkupRSS.module#L32 public function __construct() {} https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Markup/MarkupRSS.module#L67 static public function getModuleConfigInputfields(array $data) {} https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Markup/MarkupRSS.module#L219 Tutorial on forum - Create your first Module with configuration settings and a overview page: http://processwire.com/talk/topic/2318-create-your-first-module-with-configuration-settings-and-a-overview-page/ However, this Tut does not set defaults, which I think I have read somewhere is good practice to do? OK, sorry, am overdoing it but this will help me later too ;-) Edit: corrected wrong links + added a tutorial from the forums Edit 2: Something has been eating my links! Anyway, added methods/properties names...
  19. Writing this quickly, have to run...there could be errors... I don't know what you mean by an included image but here goes: If talking about RTE (e.g. TinyMCE), yes you can include images from other pages... If you are talking about images inserted in pages via image fields, yes, you can grab this and output them in other template files. Just remember: $page will give you access to everything about the current page. If you want to get this page's images, oh well, see link below...;-) $pages will give you access to everything about other pages.. So, if you want images inserted in other pages, you will use $pages to get to them. How you get to other pages using $pages vary - you can get there by path, ID, name, etc...choose the selector that suits you. In some cases, people prefer getting there by ID in case they need to be very sure (since ID does not change). In other cases, people prefer getting other pages by their title since it makes for better human-readable code. http://processwire.com/api/variables/pages/ Also to remember. Sometimes people grab images from a multiple image field and try to echo them out and nothing happens. Point is? multiple image fields will return an array so you would need to loop through them using foreach or similar. Otherwise, for a single image field, you can just echo the image out. Now this may be misleading, you can specifically grab only one image from a multiple image field. In that case, there is no array, so just echo out what you want. I am not sure about best practice. I can't recall anyone here grabbing an image by its id. Pages, yes, but images can be tricky remembering ids. It is more common to grab images (all), or by their index in the array, eq(0), etc. A good practice though is to check if there are images before trying to output them (i.e. using "if"). This saves outputting blank HTML tags, getting PHP errors and sometimes is a good cure for headaches - why isn't my image showing?!? OK, enough theory. For some code, have a read in the docs about images; no need for me to reinvent the wheel: http://processwire.com/api/fieldtypes/images/. It also include image properties e.g. $image->filename. One more thing, at times, something some people forget; as with other fields, grab the images on a page using the name of the image field! People have been known to copy paste code and wonder why $pages->get("selector")->images doesn't work. For the "images", you need to use the image field's name . See also the cheatsheet: http://cheatsheet.processwire.com/ For more complicated scenarios, Google this forum. Some wonderful examples come up
  20. Hmmm, it's a she, we are getting somewhere... (twiddling thumbs)....
  21. Yeah, I recall those discussion and all sorts of workarounds..
  22. That I can vouch for. I spent a long while with MODX before I moved here...then again you may know that already ;-)
×
×
  • Create New...