Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/23/2013 in all areas

  1. I trink maybe imageTags.title%=$q if the tags are pages, not? And also maybe add the template of the image pages to the selector just to make it more explicit.
    3 points
  2. I put back the download link with 3 more glyphs ... have fun
    2 points
  3. Joe, I think I read your original post slightly wrong; I thought you meant that there would be a limit on how many pages can be created with each template -- while you probably meant a limit on how many children could each page with given template have. Considering this you can pretty much forget that template part in my first reply.. Also, I said that in ProcessPageAdd you could use "some hard-coded limit or a value of a field in some custom-created setup page (or a custom setting in site config, whichever you prefer) to see if a page can be added below given parent based on the number of existing children." If I'm reading your post correctly now, you'd find the template of the parent page of the page currently being added and get that limit from there, then count existing children for that parent and only then add the page. Makes sense, actually. One more thing I forgot to add to my original reply is that even if you checked in ProcessPageAdd if a page could be added, you'd still definitely want to add additional check at Pages save() just to make sure that two users weren't adding pages at the same time via ProcessPageAdd..
    2 points
  4. To interact with the images field. Create a new field (under Setup > Fields) and call it whatever you want, like "images" for example. Set the field type as "image". Add this field to a template (under Setup > Templates). Then edit a page using that template and upload some images. In your template code: ProcessWire will create your images at any size on the fly and then keep a cache of them. For instance, lets say we want to cycle through all the images, create a large image at 500 pixel width with proportional height, and a thumbnail at 100x100, and then have the thumbnail link to the large: <?php foreach($page->images as $image) { $large = $image->width(500); $thumb = $image->size(100, 100); echo "<a href='{$large->url}'><img src='{$thumb->url}' alt='{$thumb->description}' /></a>"; }
    1 point
  5. Hi guys, so I am a huge fan of composer. PW is missing one of the good parts of composer. So here is a new installer to install the modules of PW via composer. If you have created a module for PW, what you need to do is add a composer.json file in your github repo and add it to packagist. An example composer.json is { "name": "vendor/package-name", "type": "pw-module", "description": "Your module what it does", "keywords": [ "keywords", "comma", "seprated"], "homepage": "https://github.com/harikt/Assets", "license": "BSD-2-Clause", "authors": [ { "name": "Assets Contributors", "homepage": "https://github.com/harikt/Assets/contributors" } ], "require": { "php": ">=5.3.0", "hari/pw-module": "dev-master" } } Note the minimum requirement is PHP 5.3 for composer is 5.3 . An example of a module that works with this is https://github.com/harikt/Assets ( Move the index.php to any where ) You are welcome to read the post at http://harikt.com/blog/2013/11/08/assets-for-processwire/ Installing modules How do you install the PW modules and the 3rd party dependencies ? Assuming you are in the PW folder. First download composer from http://getcomposer.org/download/. Hope you have composer.phar now. php composer.phar require vendor/package-name Will install if the vendor/package-name is of type "pw-module" and you have added the "hari/pw-module" in require section. { "name": "vendor/package-name", // more stuffs "type": "pw-module", "require": { "php": ">=5.3.0", "hari/pw-module": "dev-master" } } to `site/modules/PackageName` . php composer.phar require hari/assets Try the above and see where it is installed. Please add a composer.json if you are a module maintainer, for there is more things we can do with composer .
    1 point
  6. This is mostly just for Ryan, but anyway. Something I asked myself a couple times and I think others too. The module repository on PW site shows a Last Updated date on a module page which seems to be always updated randomly or not sure how. Thing is it has nothing to do with the module being updated nor the module page itself. Could we have this date being only updated when there's a new version? For example my ModulesManager shows "November 21, 2013" and I haven't done anything to it. Confusing. Further it looks like the date coming from the json feed is different than the one on the module repository page. For ModulesManager it shows me 2013/11/22 . I think it has to do with caching, but definately something that we should look into. Thanks
    1 point
  7. When calling rename() on a file where the same filename already exists in that pagefiles array, the unique name given to the target file doesn't follow the same convention used when uploading a file using WireUpload. Is there a reason or was this just a carryover from old version of PW that never got revised? For example, I have two files in a file field. The first being called "los_angeles.jpg" and the second called "new_york.jpg". If I rename "new_york.jpg" (using rename() via the API, of course), the file ends up being called "1_angeles.jpg". If I were to upload a duplicate of "los_angeles.jpg" to the field normally from within ProcessWire, the file ends up being called "los_angeles-1.jpg" - which is arguably the better result. To fix this, I tweaked the cleanBasename function in Pagefiles.php in the core (gasp!). I replaced the following: while(is_file($path . $basename)) { $basename = (++$n) . "_" . preg_replace('/^\d+_/', '', $basename); } With: $p = pathinfo($basename); while(is_file($path . $basename)) { $n++; $basename = "$p[filename]-$n.$p[extension]"; } I don't think there are any negative trickle-down implications for doing this. Is this something we can get changed in an upcoming build? Side note: just had to share that by inspecting the code, I learned about the pathinfo() function - which for some reason, I never knew about. What an amazing little function! Whenever I have needed to get a file's name and extension before, I'd do something that now seems embarrassingly amateurish (and now laughable): $filename = 'myfilename.jpg'; $name = substr($filename , 0, strrpos( $filename , '.') ); $ext = end( explode('.',$filename) );
    1 point
  8. I've just been playing with upgrading the Foundation 4 profile to version 5. Here are my extensive steps for anyone that wants to attempt them: Overwrite all the .js and .css files Change <nav class="top-bar"> to <nav class="top-bar" data-topbar> in _main.php Fin! The Orbit slider works fine, and I wholly approve of the updated styles as they seem more refined in v5. I think it helps that the ProcessWire Foundation profile doesn't use much more than the grid, Top Bar and Orbit so upgrading wasn't too tricky.
    1 point
  9. That's a good observation. That must have started when I added the version checking code to GitHub. It now updates each module page with the date of the last time it checked the version. The problem here is that it's also updating the 'modified' timestamp of those pages, which is in turn appearing in the feed that ModulesManager uses. The good news is that an option was recently added to the core (on dev) that can prevent this: $pages->save($page, array('quiet' => true)); That 'quiet' option tells it not to update the modified date or user, which will be perfect for this particular situation. I'll plan to get the modules directory updated with this option soon.
    1 point
  10. I am thinking that Google News provides some other options here. We had to setup a custom XML news feed that adhered to Google's sitemap-news format. In addition, the feed could only show news articles posted within the last 48 hours. There were no requirements about 3 digit numbers.
    1 point
  11. I've got my version of the Minify module set to minify only when $config->debug == false. This is one of the updates I was going to submit a PR for.
    1 point
  12. Pete, so nice to see you are awake and sober! Joss
    1 point
  13. Okay, nearly there! Actually, now you have given unique variable names, it is much less confusing! I can almost get the workflow, despite my aged brain. In the code below I am outputing the year as an H2, then the month as an H3 (just for convenience). The code is happilly listing the years and the associated months. However, when it comes to outputting the actual event, it is only outputting the most recent event for the most recent month and not the others in the other months. Note: This code is set up as a function and I have corrected the variable names since I accidentally gave the wrong ones in the original post - sorry! Thanks guys, we are definitely getting there! <? function events() { // get all of the events $events = wire("page")->events; //gets the repeater field $years = array(); $out =""; // find the array of years for all events foreach ($events as $event) { $years[]= date("Y", $event->getUnformatted("event_start_time")); // change the format of the year in memory for later comparison $event->event_year = date("Y", $event->getUnformatted("event_start_time")); } $years = array_unique($years); asort($years); foreach($years as $key => $year) { // Output the year $out .="<h2>{$year}</h2>"; // find the array of events this year $year_events = $events->find("event_year=$year"); $months = array(); // loop through the events for this year and add the months to the array foreach ($year_events as $year_event) { $months[]= date("m", $year_event->getUnformatted("event_start_time")); $event->event_month = date("m", $event->getUnformatted("event_start_time")); } $months = array_unique($months); asort($months); foreach($months as $key => $month) { // Output the month as a number $out .="<h3>{$month}</h3>"; // Set up a variable for the next loop of events $month_events = $events->find("event_month=$month"); foreach($month_events as $e) { $out .="<p>{$e->event_who}</p>"; // output the table here } // end foreach events for this month } // end foreach months } // end foreach years echo $out; } ?>
    1 point
  14. @Soma great addition ps, There's a notice on line 80: Array to string conversion.
    1 point
  15. You could definitely use PW to build Facebook (feature wise). There is absolutely no reason to worry about being biggest and most active website of all, before you haven't written a line of code for the project. I have build websites for over 15 years (8 of them professionally) and there have been very few scalability issues. But oh boy I have worried. The very same question that epreston asked: does it scale? After these 15 years I am pretty sure it is much harder to build service that will be so popular that actually needs to be scaled - than the actual scaling.
    1 point
  16. wow - thanks diogo i didn't know you could do that, i.e. set a new property for the page array... so this would be an altered version based on that.. <?php // get all of the events $events = $page->events; $years = array(); // find the array of years for all events foreach ($events as $event) { $years[]= date("Y", $event->getUnformatted("event_start_date")); // change the format of the year in memory for later comparison $event->event_year = date("Y", $event->getUnformatted("event_start_date")); } $years = array_unique($years); asort($years); foreach($years as $key => $year) { // find the array of events this year $year_events = $events->find("event_year=$year"); $months = array(); // loop through the events for this year and add the months to the array foreach ($year_events as $year_event) { $months[]= date("m", $year_event->getUnformatted("event_start_date")); $event->event_month = date("m", $event->getUnformatted("event_start_date")); } $months = array_unique($months); asort($months); foreach($months as $key => $month) { $month_events = $events->find("event_month=$month"); foreach($month_events as $e) { // output the table here } // end foreach events for this month } // end foreach months } // end foreach years ?>
    1 point
  17. Greetings, Thanks dragan for starting this discussion! I've been doing web design since... well, since there was such a thing as "web design," and so I guess I've accumulated some pet peeves. Violating Core Principles Generally speaking, I dislike anything that ignores core principles. It may at times seem that "everything has changed," but when you look at the whole history of the web, it's interesting that certain data/design principles have been constant. Failing the "Concept-First Test" Related to your point about lazy loading: my biggest peeve is applications that start with a visual/design standpoint instead of an information/content/conceptual standpoint. Take a look around, and you can easily find lots of apps that "look cool," but what is the underlying concept? As a test, I like to strip away all visuals and put into simple words what an application does. Then I add in visual/transitional effects, in service of what an application does. It seems to me that too many apps start with the visuals first. I call this the "concept-first test." Overloaded Visuals It feels to me that we are starting to overload our workflow with libraries that simply make superficial visuals work better. I know that Angular.js (for example) can do more than just make things look pretty, but it seems to me that a lot of the applications listed here fail the "concept-first test." I don't mean to pick on Angular.js. It's just an example. (I don't think this direction is sustainable, and we are in for some kind of revolution some point soon.) To make the subject more relevant, I think all this relates to ProcessWire. I have a lot of respect for Ryan and ProcessWire, specifically because Ryan clearly understands the idea of "core principles." CMSs come and go, but the reason Ryan's concept has been around so long and keeps going steady is because Ryan adheres to the principles that govern the ways in which the web works. As the web advances, ProcessWire will continue to be more relevant. I'd definitely like to hear what others here have to say! Thanks, Matthew
    1 point
  18. New site launched today: http://www.katonahartcenter.com/ Thanks to everyone in the forum who answered my posts over the last 8 weeks of developing this site, including adrian, teppo & ryan. modules so far that were essential: After Save Actions Color Picker Admin Custom Pages DataTable Redirects Template Decorator Form Save Reminder Hanna Code Hanna Code Helper Twitter Feed Version Control for Text Fields Form Builder ProCache Forum Threads that helped: http://processwire.com/talk/topic/4849-search-rar-and-tar-result-in-404/ http://processwire.com/talk/topic/4866-time-field/ http://processwire.com/talk/topic/3745-hanna-code/ http://processwire.com/talk/topic/4816-set-field-value-globally-if-null/ http://processwire.com/talk/topic/4602-flexible-downloads-using-pages/ http://processwire.com/talk/topic/1648-ok-to-change-page-name-path-after-save/ http://processwire.com/talk/topic/3987-cmscritic-development-case-study/?p=36867 http://processwire.com/talk/topic/3812-htaccess/?p=37295 using custom admin pages:
    1 point
  19. Almost If there is a page found, a Page object is returned, which always has an id > 0. If there is no page found, a NullPage object is returned, which always has the id = 0. the id is either equal to zero or greater, but never empty.
    1 point
  20. Change your if to: if ($fwd->id) { //... } Because if there's no page found, Pw returns a NullPage object (with id=0). Your current if is always true, because $fwd is an object. Edit: nik 1, wanze 0
    1 point
  21. Hi Alejandro! That else-block is never executed, that's why the page does not get created and rendered. This is because $pages->get() "Returns a Page, or a NullPage if not found.". So $fwd is always an object (either a Page or a NullPage) and "if($fwd)" is always true. Test for the page id to see if you got a real page, like this: if($fwd->id) { ... } else { ... } (And remember to sanitize $transaction_id if it's part of user input.)
    1 point
  22. It will save fields but you can't publish page.
    1 point
  23. I asked me the same some time ago. Reason being that it would have no id yet which is required by some fields like images. They're stored for the page and uploaded using ajax.
    1 point
  24. Regarding http://ready.mobi/ : I followed up on this and got this reply from them: Thanks for getting in touch. We're actually planning an upgrade to this service at the moment. We haven't yet announced dates for the availability of this but we're committed to getting this done because we think testing tools like this are very important. While I agree that the tool is somewhat out of date right now, bear in mind that much of its advice is still relevant if you want to reach the widest audience possible (people with no access to 3G/4G and people without smartphones). So keep an eye on our sites at http://mobiforge.com and http://deviceatlas.com. We'll post updates there as soon as we make our plans. Regards, Ronan dotMobi
    1 point
  25. [...] You may not use conversion or editing tools on the Licensed Web Fonts. [...] it say fonts not character font=all the characters make pw logo in font no diffrent thans pw logo in png or eps
    1 point
  26. Thanks Ryan, that's what I did but not using $_POST[name] but with $field->attr("value") and it was already stripped out. Lots of confusion. Testing around and looking at database revealed the real issue. It's that there's a "stripTags" option setting for textarea fields. It looks like that was checked before it was changed to TinyMCE. Changing it to TinyMCE hides that setting but is still save in the config in DB. So kinda mean. That also explains why changing it to multilanguage field and back to textarea makes it work again. So it's a bug that must be harder to find than fix. It was tricky because I wasn't aware that much that there's a stiptags option on textarea fields that is hidden once Wywiwyg is enabled.
    1 point
  27. You could do a lot worse than having a good read here - http://moz.com/blog/category/on-page-site-optimization, then, if there's anything you need help with implementing in PW, come back here and ask.
    1 point
  28. If your course template has the fields "title|body|sidebar", they should be searched too. If these "sub-pages" are hidden, you need to add "include=hidden" to your selector string. For the results: foreach($matches as $m) { $outMain .= "<li>" $url = ($m->template == 'course') ? $m->parent->url : $m->url; $title = ($m->template == 'course') ? $m->parent->title : $m->title; <h2 class=\"h4\"><a href='{$url}'>{$title}</a></h2> </li>"; } Note that the parent page may be listed multiple times with this code.
    1 point
  29. Hi, I have send a PR to https://github.com/ryancramerdesign/ProcessExportProfile/pull/3 . If you have a private repo or you find a repo which has no composer.json , you can send a PR. And for the current time you can do like below { "minimum-stability": "dev", "repositories": [ { "type": "package", "package": { "name": "ryancramerdesign/process-export-profile", "version": "1.0.0", "source": { "url": "https://github.com/ryancramerdesign/ProcessExportProfile", "type": "git", "reference": "master" }, "type": "pw-module", "require": { "hari/pw-module": "dev-master" } } } ], "require": { "ryancramerdesign/process-export-profile": "1.0.0" } } and now you need composer.phar . Hope you have downloaded composer else please get from http://getcomposer.org/download/ and run php composer.phar update It will install the ProcessExportProfile module in site/modules/ProcessExportProfile . When you created a patch for the module, you can change the settings in composer.json , so you get that patch also until Ryan merged it or can switch between branches. See http://getcomposer.org/doc/05-repositories.md#loading-a-package-from-a-vcs-repository Thank you.
    1 point
  30. Just read the message, I'll try with the new module, btw i'm using regular cron right now
    1 point
  31. I'm not quite sure what you mean by "present it streamlined in forms", but I think the gist of your request is about getting some data into ProcessWire in order to sort/display it based on a search/filter. The CMS Critic case study post has some great examples of importing from a WordPress site using the ProcessWire API, so it'd be a great example to look at to see how it's done. Once the data is in the site as pages, you are good to go.
    1 point
  32. I have just built a shop using Prestashop and I had to create many little modules and overrides because the shop owner has very specific ways of working and also a unique customer type (food clubs). The documentation of what I had to build or copy/modify from others now consists of 10 different sections. Working with the database structure was tiring as always (hunting where everything is stored). Maybe I should post the documentation on the PW forums sometime so you can evaluate, if all of it would have been possible already with PW + Antti's module.
    1 point
  33. ryan, thank you for examining it in various ways. In the case of Japanese, A blank is not put between a word and words, and, the sentence is divided in "、", and "。" is put in the last of the sentence. "、" is equivalent to an English comma, and "。" is used like a period. In addition, the sentence may be over in "。" without being divided entirely in "、". Therefore, the phenomenon that $summary is not generated at all is caused with the original cord. In the case of Japanese. The process of "mb_strrpos" thinks whether one not to use goes well.
    1 point
  34. The module Antti has been working on is actually pretty nice, as you can see from this site. It has most of the basic shop features, including cart, different payment methods (and support for adding new ones), variations etc. built-in already, so I'd argue that it's really much further than an alpha release. I'd still advice treading careful here if you're serious about those shop features. This is an area where you don't want to develop your own solution unless you're ready to invest a lot of time in it or only need it for small-scale / personal use. Just take a look at the feature list of some of the more robust solutions, such as Magento or Bigcommerce, and try to guess how hard they've worked putting all that together For the record, I'm not saying that you'll actually need all of those features or that ProcessWire + Antti's shop module wouldn't already include many of them, just pointing out that there are lots of full-featured alternatives you could just grab and start using now if you don't mind not having everything built with one system (i.e. building a site with PW but integrating shop from another platform). Just my five cents. @einsteinsboi: +1 for legendary dev.
    1 point
  35. This will need more work. Load audiojs: <script type="text/javascript" src="<?php echo $config->urls->templates; ?>scripts/audiojs/audio.min.js"></script> Create js for controling player <script> $(function() { //Setup the player to autoplay the next track var a = audiojs.createAll({ trackEnded: function() { var next = $('ol li.playing').next(); if (!next.length) next = $('ol li').first(); next.addClass('playing').siblings().removeClass('playing'); audio.load($('a', next).attr('data-src')); audio.play(); } }); //Load in the first track var audio = a[0]; first = $('ol a').attr('data-src'); $('ol li').first().addClass('playing'); audio.load(first); //Load in a track on click $('ol li').click(function(e) { e.preventDefault(); $(this).addClass('playing').siblings().removeClass('playing'); audio.load($('a', this).attr('data-src')); audio.play(); }); //Keyboard shortcuts $(document).keydown(function(e) { var unicode = e.charCode ? e.charCode : e.keyCode; //right arrow if (unicode == 39) { var next = $('li.playing').next(); if (!next.length) next = $('ol li').first(); next.click(); //back arrow } else if (unicode == 37) { var prev = $('li.playing').prev(); if (!prev.length) prev = $('ol li').last(); prev.click(); //spacebar } else if (unicode == 32) { audio.playPause(); } }) }); </script> In your template you can do something like this. if (count($page->audio) > 0 ){ $outAudio = "<audio preload></audio>"; $outAudio .= "<ol class='playlist'>"; foreach ($page->audio as $song) { if ($song->description != "") { $songName = $song->description; } else { $songName = $song->name; } $outAudio .= '<li><a href="#" data-src="'.$song->url.'">'.$songName.'</a></li>'; } $outAudio .= "</ol>"; } echo $outAudio;
    1 point
  36. Let's say the user submits a form. If I then process the form and return a page, and the user reloads that resultant page, they are hit with the famous "Are you sure you want to resubmit the data" dialog. In other apps I've written, I've avoided this by using the http://en.wikipedia.org/wiki/Post/Redirect/Get (Post Redirect Get / PRG) pattern. Essentially, I handle the CRUD or other database work when processing the POSTed page, then save any necessary values in session and redirect to the same page via a 302 redirect GET. That way the POSTed page doesn't appear in the browser history, and they can reload freely with no side effects, and if they hit BACK they go back to the form and aren't prompted to re-post the data. I'm wondering if others do this and if anyone has any neat processwire-ish ways of handling it. In particular, is it acceptable to save the posted data in session with $session->PRG = $input->post; $session->PRGPAGE = $page->id; so that any values needed in the following screen (to generate a confirmation message, etc) are available from session. In my system Template Files are controllers derived from a base class, so on each subsequent page, if the page doesn't match PRGPAGE, I'd clear the $session->PRG data so it doesn't hang around as the user moves around on the site. Does this make sense? Anyone else doing something like this to avoid POST resubmits?
    1 point
  37. Hi, maybe a bit OT but worth to mention I think: PHP has a nice function to create and open a pointer to a temporary file - but with the advantage that it first write to memory and only flush content to the disk if a specified amount of memory is reached: $mb5 = 5 * 1024 * 1024; $fp = fopen('php://temp/maxmemory:' . $mb5, 'rb+'); // then add content to the pointer ... fputs($fp, "hello\n"); // At the end rewind and echo out the content: rewind($fp); echo stream_get_contents($fp); The first 5 MB will kept in memory and if the content hits the limit it gets written into a temporary diskfile. see: http://www.php.net/manual/en/wrappers.php.php
    1 point
  38. Welcome to PW. I think the approach most people take with ecommerce is get a third party cart and integrate it with Processwire. A good example of this would be something like Foxycart or Lemonstand, or Shopify, etc. One of the legendary devs here (apeisa) has been working on a shop module (http://modules.processwire.com/modules/shopping-cart/) which you could play with, but as it states on the page it's still in alpha stage and not ready for production environments.
    1 point
  39. Agree with ryan here. Having no space between tags has an other advantage. Take the following ul li example I created on jsbin. Here you can see we don't have the annoying whitespace gap between li items. Normally for static positioned elements the white-space or a multitude of whitespaces is converted to a little space between inline elements.
    1 point
  40. Hi Ryan, thank You for the code example! Great to see how it should be done with PW! Without subcategories something like that should be work/ used? foreach($pages->get('/categories/')->children as $category) { echo "<h1>$category->title</h1><ul>"; $items = $pages->find("categories=$category"); foreach($items as $item) { echo "<li><a href='$item->url'>$item->title</a></li>"; } echo "</ul>"; } I'll try both soon. Thanks *UPDATE* Successfully tested the code above without subcategories.
    1 point
  41. The forum here uses IP.Board (look at the right bottom of the page). A simple module for PW is Discussions.
    1 point
  42. @leftblank: I know you kind of ruled this out already (at least I think you did, based on the comment that it wouldn't be very user friendly), but I'd still suggest taking a look at Hanna Code module. To improve it's usability a bit I created another module called Hanna Code Helper, which (even in it's current, barely finished state) makes selecting tags easier and removes the need to remember which tags (and with what params) were available. You should also take a look at some other textformatter modules available, they already provide simple ways to embed things like YouTube videos within text content.
    1 point
  43. First of all, there's one issue page limit won't solve: you'd also have to limit page name (or whatever you're using in your top level navigation) to make this even remotely useful. Otherwise users could simply create pages with names long enough to break your navigation anyway Template approach would be feasible only if you want to limit pages on your top navigation but not after that. Otherwise you'd run into huge problems, such as having to create new template for children of each top level page (and another for each of their children etc.) It would make more sense to enforce a child limit for each (direct) parent page. The way I'd probably start digging into this would be by creating a module that hooks into ProcessPageAdd execute() method and adds additional check, either based on some hard-coded limit or a value of a field in some custom-created setup page (or a custom setting in site config, whichever you prefer) to see if a page can be added below given parent based on the number of existing children. Problem with that approach is that you'd also have to prevent user from moving pages in some situations, or they could simply avoid this limit by creating page elsewhere and then moving it where they want it. This could probably be solved by hooking into Pages save() method, but that would be somewhat ugly; giving user some kind of clue about this limit within UI (i.e. before they attempt to move a page) would be optimal, but I'm not quite sure how to achieve that without a lot of custom code. Hope this helps a bit. If you want to do this properly, it'll require some work, and personally I don't think it would still be optimal solution.. but that's just my opinion
    1 point
  44. Hi motionmindz and welcome! PW gives you ultimate flexibility to handle SEO however you would like, but it does do a lot of great things to help you along, including excellent clean and SEO friendly URLs to all pages. It also has the ability to handle custom URL segments, rather than using GET variables: http://wiki.processwire.com/index.php/URL_Segments You should definitely make use of the sitemap module to generate a sitemap that can be submitted to search engines through tools like Google's webmaster tools: http://modules.processwire.com/modules/markup-sitemap-xml/ Remember that one of the key components of SEO is good content and proper use of html tags, which is, and should be, up to you and your content creators. Hope that helps, but let us know if you have any more specific questions.
    1 point
  45. Hi motionmindz and welcome to PW. Are you referring what tina is doing starting at around 1:46 in the video? If so, she is simply using a repeater field (http://processwire.com/api/fieldtypes/repeaters/) to store the type, ID, and title. The code she has used in the template to display the video is probably something as simple as: foreach($page->media_items as $media_item){ echo '<iframe width="560" height="315" src="//www.youtube.com/embed/'.$media_item->media_id.'" frameborder="0" allowfullscreen></iframe>'; } Some other tools you might find useful for media types are: http://modules.processwire.com/modules/textformatter-video-embed/ http://modules.processwire.com/modules/process-get-video-thumbs/ http://processwire.com/talk/topic/4580-video-fieldtype/ http://modules.processwire.com/modules/textformatter-soundcloud-embed/ http://modules.processwire.com/modules/audio-mp3/ http://modules.processwire.com/modules/local-audio-files/ Hope that helps.
    1 point
  46. Hi Melissa, I am guessing it's probably an issue with the the Maximum Files Allowed setting on the details tab of your left_images field settings. You should either set this to "1" or use the following to get the first of the images in that field: $image_left = $about->left_images->first(); If you haven't already, have a read of these: http://processwire.com/api/fieldtypes/images/ http://processwire.com/api/fieldtypes/repeaters/ EDIT: I saw you lurking over here: http://processwire.com/talk/topic/2188-solved-repeaters-with-images/ but thought I'd add that link here as well anyway, in case others come across this post first and would like more info.
    1 point
  47. Sure it makes sense, especially the redirect part. And there's nothing wrong with saving something to the session either. This is pretty simple stuff and I'm not sure there are too many ways to do it - so no ProcessWire tricks to share. Looks like you've nailed it already, nice and simple. Only thing I haven't tried is saving the whole post data at once into session. And if that didn't work, you could always save individual values instead of the whole structure. So nothing much to say, but didn't want to leave your question unanswered either .
    1 point
  48. I generally try to use as little echo lines as possible. My code will be more like this <ul> <?php foreach($some as $else): ?> <li><?=$else;?></li> <?php endforeach;?> </ul> that way i don't have to worry about indention ...
    1 point
  49. I like to share Simple gallery in ProccesWire i use for popup ( rel='lightbox' ) lightbox.js CSS for gallery .gallery li { list-style: none; float: left; margin: 0 20px 3px 0; } .gallery { display: block; padding-left: 1px; padding-top: 1px; } #dropshadow { border: 5px solid; border-color:white; -moz-box-shadow: 4px 4px 9px #000000;; /* Firefox */ -webkit-box-shadow: 4px 4px 9px #000; /* Safari/Chrome */ box-shadow: 4px 4px 9px #000; /* Opera and other CSS3 supporting browsers */ -ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#000')";/* IE 8 */ : progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#000');/* IE 5.5 - 7 */ } and in your template u will put like this, PS. images is fields <ul class="gallery"> <?php foreach($page->images as $img) { $t = $img->size(140, 100); echo "<li><a href='{$img->url}' rel='lightbox' ><img id='dropshadow' src='{$t->url}' alt='{$t->description}' width='{$t->width}' height='{$t->height}' /></a></li>"; }?> </ul> example is in attach, this is not so good but for beginner maybe will help,
    1 point
  50. Giovanni, This is possible. The examples below are simple examples that exclude the container markup (like header/footer, etc.) but focus on just the parts you are asking about. Your main album index page would use template code something like this: /site/templates/album-list.php <ul class='albums'> <?php foreach($page->children() as $album) { // assumes your field with images is named 'images' if(!count($album->images)) continue; // skip if no images $image = $album->images->first(); // get the first image $thumb = $image->width(150); // make a thumbnail 150px wide echo "<li style='width: 150px; float: left; margin: 10px;'>"; // use stylesheet instead of inline styles echo "<a href='{$album->url}'><img src='{$thumb->url}' alt='' /></a><br />"; echo $album->album_description; echo "</li>"; } ?> </ul> <br style='clear: both;' /> Then your template that is used for each of the album pages would look something like this: /site/templates/album.php <h1><?=$page->title?></h1> <h2><?=$page->album_description?></h2> <ul class='images'> <?php foreach($page->images as $image) { $thumb = $image->size(100, 100); // specify your own width/height echo "<li style='width:100px; height:100px; float:left; margin:5px;'>"; // better to use a stylesheet echo "<a href='{$image->url}' class='lightbox' rel='gallery'>"; echo "<img src='{$thumb->url}' alt='{$thumb->description}' /></a>"; echo "</li>"; } ?> </ul> <br style='clear: both;' /> The details of how this loads into your lightbox script will depend on what lightbox script you are using. I have used jQuery Fancybox most recently, which requires a class attribute on the <a> tag containing the image ("lightbox" used in the example above), and a common "rel" attribute on that tag that relates it to the other images in the gallery ("gallery" used in the example above). The point of the "rel" attribute is so that you can have next/prev buttons in the lightbox.
    1 point
×
×
  • Create New...