Jump to content

pogidude

Members
  • Posts

    122
  • Joined

  • Last visited

Everything posted by pogidude

  1. I use ckeditor for my textareas. Now, I'd like to ask if it'd be possible to include in core to have it so that when an image is inserted into the textarea, the image src is the absolute uri instead of relative to root. Basically, in ProcessPageEditImageSelect::executeResize() method, the src of the returned image can be set to $image->httpUrl instead of just $image->url. With that in place, we can now ask authors of the ckeditor module to add an option to be able to return absolute uri or use default of root relative uri. Now, please, no discussions about merits of absolute vs relative urls. I'm for relative urls, but I need absolute urls for this project and I'd prefer not to hack core if I can.
  2. Hmmmmm.. the 2nd option is a good idea. although I know that the client (yes it's the client who'll be doing this regularly) will sometimes use an image both in the body and gallery. Will try it out when I get back home but if all images in all image fields come up in the editor then it should be all good. thanks adrian!
  3. I have a template with an image field. Some of the uploaded images in the page are used in the page body (via tmce editor). I'd like to have the option to show these images as a gallery after the page body content (I actually use started off from the blog profile). But, ONLY SOME of the images. Not all. I was thinking there could be a field that would list all the uploaded images on the current page, then, using asmselect or something similar, I could select images (or files) that I'd like to show up in the gallery/slideshow. ordering would be nice but not needed. but I can't seem to find what I need in the modules section. maybe someone already built one?
  4. I created this module http://modules.processwire.com/modules/page-edit-per-role/ exactly (almost) for this purpose. My use-case was that I needed to give users edit/add permissions on certain branches (sections) of the site - regardless of template. I believe this is also what you are looking for. There is also another module referred to by @soma http://processwire.com/talk/topic/3629-page-edit-per-role/?p=35510 which is another way of doing it. Anyhow, I hope these links will help you find what you need.
  5. You could also look at Piwik https://piwik.org/faq/new-to-piwik/#faq_47
  6. I too like it. Only one issue I find with it. The "W" inside the circle reminds me of WordPress. That's the first thing that popped to mind. And the blue color scheme doesn't help since it's also close to the WP blue color scheme. That's just me though.
  7. actually I thought it was custom made or something (not using a framework) or a cvs like wordpress repo didn't really think a repo would be powered by a forum app though but so cool to know modules dir is built on pw
  8. The module repository is built on ProcessWire?
  9. Maybe you'll want to describe the whole thing in more detail? Like the structure of the elements in the page, what the elements are for and such. If anything else, someone here might be able to help you *rethink* how to better implement things. who knows, maybe you don't need a repeater
  10. +100 likes. I've been developing on WordPress for 3 years both doing plugins and custom theme development. I found ProcesssWire while looking for another CMS to learn. What converted me was this page http://processwire.com/api/selectors/, the fact that almost EVERYTHING was derived from WireArray and the EVERYTHING as a *page* concept. This was something that I never found in other CMSs I've looked at.
  11. Just wondering what the Page Paths module does. Not really sure what this means in the module description
  12. try this for finding your $class. and you'll still want to pass $currentPage to succeeding calls to listChildren. and you probably don't need to figure out $subclass. I'm not sure though. if($child === $currentPage){ //this is if the $currentPage is on the first level right after home //OR if the $currentPage is 2+ levels down $class = "current"; } elseif( $child === $currentPage->rootParent ){ //this should only fire on the first level. //look for the rootParent of the $currentPage //this is if the $currentPage is 2+ levels down and we are on first level. //this should assign "current" to the rootPage - page nearest the home $class = "current"; } else { $class = ""; }
  13. nice @martijn this one is new to me. how do you *clean* the $config->scripts array?
  14. thanks @wanze and @applab. I do use $config->styles and scripts to add my stuff - unless I'm using "getThumb()" in the page (from the Thumbnails module). Here's one of the issues about using $config->styles/scripts to store your assets files http://processwire.com/talk/topic/4740-jqueryfancybox-script-loading-by-itself-in-frontend/ Basically, modules can inadvertently "add" styles/scripts to your frontend (especially autoload modules). In that thread above, I was pulling the body content (which used the getThumb() function) BEFORE the whole view template was loaded. Meaning getThumb() - which also instantiates Imagefield module which in turn loads the JqueryFancybox module - was run before the whole foreach($config->styles/scripts) thing. Anyway, this could probably be fixed with module creators doing something along the lines of: if(CHECK_IF_IN_ADMIN){ //load modules } but yeah, what I really would want is the dependencies thing. and also a way to specify whether the script should go in the *footer* or in the *head*.
  15. I don't know what the general stand is on this, but for me, I really like how in WordPress scripts and styles can be queued, and in the header and footer (via wp_head() and wp_footer() respectively) they are loaded with their dependencies sorted out. Then, anytime before the template is output, you can do a call to: wp_enqueue_script('script-name-id', '/url/to/script.js', array('dependency-script-id', 'jquery'), "version", true); and you can be sure that the script will be loaded AFTER "dependency.js" and "jquery.js" has been loaded. And oh, the last parameter specifies whether the script should be loaded in the <head> or in the footer (or wherever wp_footer() is in the theme). Now, I understand for many situations, this may seem like overkill especially if you are loading the same scripts/styles on all the pages. But there are situations where you need a script only for *that* page and don't want it loading on all other pages. if you're using only one view template to output your pages, then that means you'll need to create another view template which includes the specific script/style on this page.
  16. Thanks Ryan. Yup, you're right it's *sort of* coming from the Thumbnails module because the module is extending FieldtypeImage. As @apeisa as getThumb() inits InputfieldImage via call to _getInputFieldInstance() and InputfieldImage has this in it's init() function: $this->modules->get("JqueryFancybox");
  17. It was the InputfieldImage module which is extended by the Thumbnails module. See the rest of the discussion here http://processwire.com/talk/topic/4742-bug-maybe-thumbnails-module-using-getthumb-loads-jqueryfancybox-script/
  18. I can replicate this too. Also using dev version. I ended up styling for .No.Alignment
  19. Yup.. option 1 specifically points out the issue about user data sharing in the disadvantages section.
  20. From what I understand, you want to have 3 independent websites (4 if you count the umbrella site) while being able to *pull* content from the sites, yeah? Then, I think the built-in multisite support feature should work well enough for you http://processwire.com/api/modules/multi-site-support/ this is option #1 in that page. And no, you don't need to download the Multisite module unless you want to go the option 2 route. So, what you'll be able to have multiple sites use only one set of core files so a core upgrade would upgrade all your sites. RSS - I don't think sharing content/data via rss is a crutch solution since that's how a lot of sites share their content. It's a sort of api to the sites content when you think about it. Of course if you really want to go all nuts about it, you could probably build an api on each of your websites so you could do something like this: http://sub.gaming.com/api/posts/now - and have this return data in json or xml format but if all you want to do is to pull recent articles from each of the subdomains then I think serving via rss will get you there and it has the added benefit of being able to serve your users who want to read your content via rss as well
  21. Just discovered something weird with the Thumbnails module http://modules.processwire.com/modules/fieldtype-crop-image/ I'm using PW 2.3.2, Thumbnails module v1.0.3 Basically, I have this code in my template: <img src="<?php echo $page->thumbnail->getThumb('department-thumb'); ?>" > and in my <head> I have this code: <?php foreach($config->scripts as $file) echo '<script src="'.$file.'"></script>'; ?> I populate $config->scripts by doing the following in my init.php file: $scripts = array( 'modernizr' => $url.'modernizr.js' ,'jquery' => $url.'jquery.js' ,'masonry' => $url.'jquery.masonry.min.js' ,'fancybox' => $url.'jquery.fancybox.js' //,'bootstrap' => $url.'bootstrap.js' //,'main-js' => $url.'main.js' ,'responsive-slides' => $url.'responsiveslides.min.js' ,'main' => $url.'script.js' ,'placeholder' => $url.'placeholderfix.js' ); foreach($scripts as $key => $file) $config->scripts->add($file); Actually, you can recreate the issue without populating $config->scripts with your custom scripts just as long as jQuery Fancybox Plugin is activated. To recreate the issue, use this inside your template: <?php $output = '<img src="' . $page->thumbnail->getThumb('thumbnail') . '"> ?><!doctype html> <head> <?php foreach($config->scripts as $file) echo '<script src="'.$file.'"></script>'; ?> </head> <body> <?php echo $output; ?> </body> </html> In your <head> you should see something along the lines of: <script src="/wire/modules/Jquery/JqueryFancybox/JqueryFancybox.js?v=126"></script> Which we don't want loading in there. But, if you do the "getThumb()" call inside the <body>, meaning you do it after the scripts/css has been loaded, then JqueryFancybox of course won't be loaded.
  22. Just made some headway (sort of) and this seems like a bug or something. This is my template: MyTemplate.php function renderDepartments(PageArray $departments){ $t = new TemplateFile(wire('config')->paths->templates . 'markup/departments.php'); $t->set('departments', $departments); return $t->render(); } $headline = $page->get('headline|title'); $content = $page->body . renderDepartments($page->children); include('./default-archive.inc'); Inside "default-archive.inc" <?php include_once("./head.inc"); ?> <div class="row default-archive content <?php echo $classes; ?>"> <!-- CONTENT IS HERE --> </div> <?php include_once("./foot.inc"); ?> Take note of the included "head.inc" and "foot.inc". Right now I'm getting the JqueryFancybox loaded. As I was out of things to do, I decided to *move* the "foot.inc" and "head.inc" out and into my template: MyTemplate.php (new) function renderDepartments(PageArray $departments){ $t = new TemplateFile(wire('config')->paths->templates . 'markup/departments.php'); $t->set('departments', $departments); return $t->render(); } include("./head.inc"); $headline = $page->get('headline|title'); $content = $page->body . renderDepartments($page->children); include('./default-archive.inc'); include("./foot.inc"); Inside "default-archive.inc" (new) <div class="row default-archive content <?php echo $classes; ?>"> <!-- CONTENT IS HERE --> </div> and the result?? No more JqueryFancybox javascript loaded!!
  23. I can't quite figure out why the JqueryFancybox module js is loading in the frontend of the site. I have the following function in a file which I load before displaying the html: function ssd_add_scripts(){ $config = wire('config'); $url = $config->urls->templates.'scripts/'; $scripts = array( 'modernizr' => $url.'modernizr.js' ,'jquery' => $url.'jquery.js' ,'masonry' => $url.'jquery.masonry.min.js' ,'fancybox' => $url.'jquery.fancybox.js' //,'bootstrap' => $url.'bootstrap.js' //,'main-js' => $url.'main.js' ,'responsive-slides' => $url.'responsiveslides.min.js' ,'main' => $url.'script.js' ,'placeholder' => $url.'placeholderfix.js' ); foreach($scripts as $key => $file) $config->scripts->add($file); } ssd_add_scripts(); Then, in the <head> I load the scripts like this: <?php foreach($config->scripts as $file) echo '<script src="'.$file.'"></script>'; ?> Unfortunately, the generated html looks like this: <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title>Departments and Services</title> <meta name="description" content=""> <meta name="HandheldFriendly" content="True" /> <meta name="lOptimized" content="width" /> <meta http-equiv="cleartype" content="on" /> <meta name="viewport" content="width=device-width,minimum-scale=1.0,initial-scale=1,user-scalable=yes"> <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Montserrat|Merriweather"> <link rel="stylesheet" type="text/css" href="/site/templates/styles/jquery.fancybox.css"> <link rel="stylesheet" type="text/css" href="/site/templates/styles/style.css"> <link rel="stylesheet" type="text/css" href="/site/templates/styles/custom.css"> <link rel="stylesheet" type="text/css" href="/wire/modules/Jquery/JqueryFancybox/JqueryFancybox.css?v=126"> <script src="/site/templates/scripts/modernizr.js"></script><script src="/site/templates/scripts/jquery.js"></script><script src="/site/templates/scripts/jquery.masonry.min.js"></script><script src="/site/templates/scripts/jquery.fancybox.js"></script><script src="/site/templates/scripts/responsiveslides.min.js"></script><script src="/site/templates/scripts/script.js"></script><script src="/site/templates/scripts/placeholderfix.js"></script><script src="/wire/modules/Jquery/JqueryFancybox/JqueryFancybox.js?v=126"></script> </head> See the last loaded script. I've already grepped my files for "JqueryFancybox" on the offchance that I'm loading this module in my template.
×
×
  • Create New...