Jump to content

GuruMeditation

Members
  • Posts

    171
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by GuruMeditation

  1. I hope this goes ahead. Together with the snippets site it would make PW so much easier to use. I've been attempting to write my own full module lately for a site I'm working on, and it's not been easy in terms of finding certain examples to look at. It's been a case of looking through existing modules and searching the forum which can take up a lot of time. We definitely need documentation to aid us with creating our own modules, i.e module config options, tips for installing, upgrading and uninstalling our modules etc. It took me a while of trial and error to add a simple pre-checked checkbox to my module configuration page using the following code. <?php class TestConfig extends ModuleConfig { public function __construct() { $this->add(array( array( 'name' => 'Enabled', 'label' => 'If unchecked, module will be temporarily disabled throughout the site.', 'type' => 'checkbox', 'autocheck' => 1, // => Autoset the default value 'uncheckedValue' => 0, 'checkedValue' => 1, ) )); } } Examples of all other fields we can add to our configuration page would also be nice additions to the documentation. Well that's just my thoughts, not sure if they are of any use or not.
  2. Have you tried changing the Content Type to Markup/HTML?
  3. There's http://easyiicms.com/ Not exactly a killer CMS, but you might want to have a look anyway. Yupe is another one, but you'll need to understand Russian to make use of that https://github.com/yupe/yupe/tree/dev
  4. Lol you're not being rude. I failed to elaborate, but I was thinking more on a larger scale, i.e 100 documents or so. Copy and paste would work, but I was wondering if there was another way that I may not have considered that would simplify the process. I.e if the document had ##Title it could be imported into the title field, and everything else into the body....
  5. I like to use Sublime Text to write Markdown documents. Is there a way to import them to PW pages? i.e ## Text basics this is *italic* and this is **bold** . another _italic_ and another __bold__ ....imported into my body field etc.
  6. How exactly do you go about looping through thumbnails? I have an image field called f_multi_image which allows multiple image attachments. I would have thought it was something like this, but obviously it's not right. $gallery = $page->f_multi_image->getCrop('gallery'); foreach($gallery as $image){ echo "<img src='{$image->url}' alt='{$image->description}' />"; }
  7. Thanks all. It was indeed due to the fact that I forgot to add in the lightbox.js file as I assumed it was a part of the core.
  8. Hi all, I'm working on a project which will be using UIKit for the frontend framework, and the front page will display images that are attached to various pages. I'm using CroppableImage to generate the thumbnails. The idea is that clicking on the thumbnails will display the original image in UIKit's lightbox. The problem is that I can't get the lightbox to work. My simplified code...... <!doctype html> <html class="no-js" lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="description" content="<?php echo $config->site_meta;?>"> <title><?=$config->site_title;?> | <?=$page->title;?></title> <link rel="stylesheet" type="text/css" href="<?=$config->urls->templates;?>css/uikit.css"> <script src="http://code.jquery.com/jquery-latest.min.js"></script> <script src="<?=$config->urls->templates;?>js/uikit.min.js"></script> </head> <body> <?php $items = $pages->find("template=link_full, limit=10, sort=-f_date"); foreach($items as $item) { $image = $item->f_multi_image->first()->getCrop('frontpage'); echo "<article class='uk-article'> <a class='uk-thumbnail' href='{$image->url}' data-uk-lightbox title='{$image->description}'> <img src='{$image->url}' alt='{$image->description}' /> </a> </article>"; } </body> Now, I've added the "data-uk-lightbox" attribute as it states in the docs http://getuikit.com/docs/lightbox.html but I'm at a loss after that. Any help?
  9. A couple I have been messing about with lately. OctoberCMS - Laravel based, currently in beta, but looks like it has a lot of potential. Bolt - Nice lightweight CMS.
  10. I know what you mean Mo. I usually go to the doctors to get my car fixed.
  11. Thanks, I think I will go down the route of copying the comments module and editing the CommentsForm. I'm a bit confused about how it works in terms of modules though. Do I uninstall the Comments module from the /wire/modules/ folder and then copy it to the /site/modules/ folder? If so, how do updates work when you personally release a new version of the comments module? Thanks again
  12. You might find these links interesting in reference to e-mail privacy: http://sealedabstract.com/code/nsa-proof-your-e-mail-in-2-hours/ https://mykolab.com/
  13. Hi, does anyone have any example code of the correct way to go about showing just the submit button and the textarea for the actual comment? I want to make the comments available only to members, so they will already have to be logged in to posts comments. Therefore I would have no need for the name and e-mail fields to be displayed to the user and instead would want that to be sent automatically behind the scenes. I have the new comments upgrade installed, but like the OP said, there isn't really any documentation for rendering the actual comment form in a custom way. I know how to customise the actual comments, but the not the form. I've looked through module source code, but I'm still confused. ​ ​It merely says this in the documentation..... ​ The line in bold is what I would ideally like to see some examples for. ​ Thanks
  14. Ok, now you can't leave it at that.... please spill the beans.
  15. Hi, I'm trying to work out how to create new permissions, and also to check for them before installation. I can't seem to find any info on how to do this. So far I have the following code to create a new permission: $pm = new Permission(); $pm->name = 'new-permission'; $pm->title = 'A test permission?'; $pm = $pm->save(); Not sure if that's the right way to do it? Now to check if the permission already exists before installation, I use the following but it's returning true even when the permission doesn't exist. if($this->permissions->get('new-permission')) throw new WireException("The 'Permission already exists"); I know I'm probably doesn't something stupid, but I have no code to reference for this.
  16. Hi, I'm trying to create a template for a module I'm working on. The page that uses this template will be used specifically as a category to hold other pages. For this reason, I don't need to add any extra fields to it, other than the title, and obviously the name. But I can't seem to figure out how to do it. I've tried the following, but it complains about needing a field. $template_category = new Template(); $template_category->name = 'template_category'; $template_category = $template_category->save(); Any help appreciated.
  17. Thanks for the extra info. It becomes much clearer when you find the correct documentation. It now makes sense regarding the configuration fields, and the fact that they are simply HTML input areas, as I was under the impression they were added to the database beforehand. ProcessWire is a seriously clever and efficient framework. I look forward to seeing your tutorials.
  18. Thanks for this. I've been learning to create a module for the last week and I'm surprised at how well I seem to be doing (touch wood). The problem I'm facing is that I can't find some of the information I'm looking for, as it seems to be spread all over the place. I have looked through the HelloWorld example, but that didn't help me either. So, I'm hoping someone here can point me to the relevant documentation, or answer the following for me. How do we remove the fields created in the getModuleConfigInputfields() function? Are they automatically removed when the module is uninstalled, or do we have to manually remove them within the ___uninstall() function? Also, does anyone have a complete list of the available functions for use within a module, i.e I know about ___uninstall(), ___install(), __construct(), etc, but are there any more built-in ones we can use? Thanks
  19. Related content would also be a good idea. Let's say you have an article relating to a certain CMS etc, at the bottom you could have ad links under a "Related Reading..." section like in the following image. Those links are still referring the visitor, and you could still be getting paid, but they also don't deceive and they look like they are supposed to be there. Also, the other ads in this image look professional and actually a part of the site, and I'd actually click on them (if I needed bike parts). As Peter points out, notice how you have a slight background colour variation between the ads and the main content etc.
  20. Keep up the good work. My understanding is that the functionality of what FrontendContentManager provides can be achieved purely by using FormHelper alone?
  21. This looks promising. So basically this will allow us to easily create front-end forms for editing content, posting content etc? I'm looking for something that will allow me to use my own markup on the front-end for my members to use. Honeypot seems a good idea as an option as Ryan suggests with his comments field. Will this work with a Fancybox modal window? I'd like to be able to click on an edit button on a front-end page, have a form pop up via something like Fancybox or Foundation and then for it to process the form and redirect to a page of my choice etc.
  22. I had never even noticed any ads before it was mentioned, so it shows what a great job AdBlock Edge does. I've just had a look at the site using Opera. I personally think you should have one dedicated area for ads, rather than multiple areas, e.g there are ads down the left and on the right, perhaps just down the right hand side? Also, I hate the ads with the big green arrow button below them, as they generally make the site look cheap. Just a few of my thoughts.
×
×
  • Create New...