Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/03/2012 in all areas

  1. Not sure if this has already been suggested, but for the less php literate among us it would be great to have some sort of repository of php scripts on the PW website for formatting template data, i.e. the php snippets for outputting different kinds of menus, breadcrumbs, bloglists, etc. Similar to a database or list of modules, but specifically for the templating side of things, where you don't require a full-on module. Right now you have to scour the forums (or write your own code) if you're looking to do something beyond the basics that are included in the default templates.
    2 points
  2. I'm already loving it without trying! Awesome work Ryan, thanks for implementing this, diogo is right , this is playing in a whole new league.
    2 points
  3. It works great Ryan! I'm in love with this new feature! Repeated fields and field-template context, used in the right amount, are extremely powerful for creating a friendly edit environment. I really think this brings PW to a new dimension
    2 points
  4. Just tried it, it works well. easy and simple!
    2 points
  5. I was thinking it would be good if it was something people could contribute to fairly easily. I'm sure that a lot of ProcessWire users here have accomplished a lot of really cool things inside of their templates using the API, and if there were a central place that they could then submit those for the benefit of others, that would save people having to re-invent the wheel or ask on the forums. Which leaves more time for Ryan and others to work on the core and various modules Some kind of basic gatekeeping/moderation would probably be necessary to ensure a minimum quality standard for the scripts.
    2 points
  6. Below, I'll write how you can move your site from Drupal to ProcessWire. It's quite simple. In Drupal you will need: - Views Module, - Views Data Export Module, - Views UI Module (integrated with Views), - Chaos tools Module - required by Views. Install these modules and switch them on. In ProcessWire you need only: - CSV Page Import Process (Import Pages from CSV). Install this module. When you are ready, you have to create a new View (select: "Create a page") in Drupal with all fields which you want to export. Then, add "Data export" subpage and make sure, that format is CSV file. It's a good idea, to use Pager when you have lot of nodes (pages). You have to setup an url to download your CSV files. When you are ready - download your data. Next step: In ProcessWire, you have to prepare a template with your fields. When that's finished, you can import your data from CSV files using "CSV Page Import". That's all. If you have any questions, write them below. I can also write complete scenario for my website (if there will be anyone interested in that).
    1 point
  7. I was a little worried about making path() or url() hookable since they can feasibly be called hundreds or thousands of times in a request. I found a way to make functions hookable without adding any real overhead, except it requires defining two functions rather than one. But it'll be perfect for high-traffic function calls like this. So I've made Page::path hookable in this manner, and it's ready to go in the latest commit. Note that you'll want to hook the method, not the property. In the Page class, calling $page->path or $page->url resolves automatically to $page->path() or $page->url(), so if you are adding a hook, you want to hook the method. I'm thinking we really only need $page->path() hookable (?), since it is what is used by $page->url(). The only difference between $page->url() and $page->path() is that $page->url() calls $page->path() and then prepends $config->urls->root to it. So $page->path is relative to the PW installation root, and $page->url is relative to the server's web root. Though in most installations, the two are the same, as most don't run PW from a subdirectory. The only other difference is that $page->url() trims off the trailing slash if its template says it should (I don't ever use that feature myself).
    1 point
  8. This feature is now available in the latest commit. Please let me know how it works for you guys. You will see a new checkbox option available with page reference fields when editing them under: Setup > Fields > Edit: [your-field] > Input [tab] > "Allow new pages to be created from field?". It includes instructions on the required settings for it to be active.
    1 point
  9. The field-template context is now committed to the source, so it is ready to use. Please let me know how it works for you guys. You can access it from any template or repeater field by clicking on a field name in the asmSelect list. When you first add a new field to an existing asmSelect, the context option isn't yet available. You have to save the template before you'll see the option to alter its context. When editing a field (from Setup > Fields), you will also see a context pulldown in the upper right corner. This is just a shortcut when/if you want it. -- Edit: you may need to hit 'reload' in your browser once or twice if you aren't seeing the field context option at first (old files may be stuck in cache).
    1 point
  10. Nice stuff Ryan! I updated, but cannot get template field context working? Should they work by just clicking field title from template view? It was an cache issue. CTRL + R few times did the trick.
    1 point
  11. Stephen: check_access=1 is default, so you don't have to include that. If you don't want to check access, then you need to use check_access=0.
    1 point
  12. I like both of those. I'd seen Cloudflare a while back but never read enough to understand what the benefit was. Okay, so you can minify your JS and CSS yourself relatively easily enough, but one of the things Cloudflare seems to do is do it for you, as well as hosting all your JS, CSS and images in geographical areas closer to the end user. Whilst I agree there would be little point for most small sites, one site I have has over a hundred articles and most of them have screenshots with them. The new version of the site will also be a bit graphics-heavy in terms of the design. Therefore I can see the point there as you don't want a gallery to take a while to load and then have to wait ages from clicking on a thumbnail to seeing the larger version of the image. It does look like it could take some tweaking though so it doesn't cache things you don't want it to. New Relic also looks excellent for a different reason - if it works as per the video then it can help point out performance bottlenecks based on what content people are viewing most That certainly sounds excellent and takes a lot of the guesswork out of troubleshooting what can often be annoyingly hard to find issues. Kudos to both companies for providing a free version, though I can't immediately see what New Relic's free version offers.
    1 point
  13. Haven't touched CMS for 7+ years but now due to various needs and limitations I need to select a CMS and have it rolling in about 3 months. I, not a coder but OK with a few edits/copypaste scripts, wanted something that's simple for everyone yet capable for specific needs. It's popular knowledge that everyone can use WxxdPres, but I'm unsure how to make it work for me. Upon googling for comparisons and alternatives I ended upon a "10 Best" post (2009) on webdesignledger.com. ProcessWire wasn't on the list but someone comments it lastly in 2011. Thanks to the PW DEMO site (exactly what I need) , and videos: I'm glad that you made them pragmatical (not marketing butterflies) and thank you all for making this work. (currently instaling/learning/reading/forum digging)
    1 point
  14. I totally agree it would be great to have a modal dialog that then creates pages and all their fields. But there is a rather large difference in development time between that and what I've added. I added what I could afford to in the short term. Down the road, I'm sure we'll expand the capability to take the modal route when dealing with creating pages that have more than just a title field. But since I could add the title-only page additions in the short term, I figured that's a good place to start. Even when we expand with the modal dialog, I do want to keep the current method for when the template has just a title field. The reason is that this is a very convenient way to create large selects. Lets say you need a "country" select -- you can paste all 196 countries into that field and create all your select options in one shot.
    1 point
  15. I've made this site a couple weeks ago using ProcessWire. Once again, it proved as a right choice for my projects... You can check it out at: http://www.croatiabirding.hr P.S. I recently bought a book about PHP OOP programming so I could better understand the PW core and the modules themselves, maybe I'll come with my own plugin finally soon ...
    1 point
  16. function listChildrenTree($children, $current, $w) { echo "<ul>"; foreach($children as $page) { $class = ''; if($page === $current || $current->parents->slice(1)->has($page) ) { $class = "class='on' style='font-weight:bold'"; } $rootid = $w->pages->get("/")->id; echo "<li><a href='{$page->url}' $class>"; if($page->id == $rootid) echo "<img src='" . $w->config->urls->templates . "styles/images/home.png' width='24' height='28' alt='' />"; echo "{$page->title}</a> "; if($page->numChildren && $page->id != $rootid) listChildrenTree($page->children, $current, $w); echo "</li>"; } echo "</ul>"; } $children = $pages->get("/")->children(); $children->prepend($pages->get("/")); listChildrenTree($children, $page, $wire);
    1 point
  17. I added one simple line to more easily edit the current page, or add parent sibling and child pages. This way, I don't have to navigate through the admin every time I want to add or edit. I added into my head.inc so that its included on every page: <?php if($user->isSuperuser()) echo "<br/><a href='{$config->urls->admin}page/edit/?id={$page->id}'>Edit Page</a> | <a href='{$config->urls->admin}page/add/?parent_id={$page->id}'>Add New Child Page</a> | <a href='{$config->urls->admin}page/add/?parent_id={$page->parent_id}'>Add New Sibling Page</a> <br/><br/>"; ?>
    1 point
  18. Hi all, I have just 'finished' (well, to the extent that I can pretty much call it 'done' for now) my portfolio website. There are still a few issues with it - I have yet to make it fully responsive for mobile, I need to work on the footer area and I haven't uploaded all of my work samples yet. The brief I gave myself for this site was to come away from the usual 960, centered grid into something a little more fluid - breaking the usual mould for rigid layouts. I also wanted something very simple that hopefully allows the work samples to become prominent. I am SO PLEASED working with ProcessWire for this site!!! It has been an absolute pleasure and just before I came across PW I had a version on my localhost developed with Drupal. It was slow and cumbersome! I was so sick of Drupal and it's horrendous default markup that PW seemed a dream to work with in comparison. I am already working on another website with PW and I see this trend continuing with every website I do. Thanks for the great CMS! www.ray-dale.com
    1 point
  19. I created simple module to add these subsites. You need to use $page->subUrl or $page->subPath if you want working urls/paths. Not sure if it would be better to use $page->url and $page->path... and how that could be achieved? Anyways, I have this version up and running nicely: <?php class Multisite extends WireData implements Module, ConfigurableModule { public static function getModuleInfo() { return array( 'title' => 'Multisite', 'version' => 001, 'summary' => 'Allows multiple sites with different domains run from single PW-site and database.', 'singular' => true, 'autoload' => true, ); } public function init() { $subdomains = explode("\n", strtolower($this->subdomains)); foreach($subdomains as $subdomain) { $httpHost = strtolower(wire('config')->httpHost); if(strpos($httpHost, $subdomain) !== false) { $this->subdomain = $subdomain; // change path like /about/contact/ to /campaign.com/about/contact/ $_GET['it'] = "/{$subdomain}/" . ltrim($_GET['it'], '/'); // hook for path method to make path() and url() methods context aware $this->addHookAfter('Page::path', $this, 'modifyPath'); } } } public function modifyPath($event) { $event->return = str_replace("{$this->subdomain}/", '', $event->return);; } static public function getModuleConfigInputfields(array $data) { $fields = new InputfieldWrapper(); $modules = wire('modules'); $field = $modules->get("InputfieldTextarea"); $field->name = "subdomains"; $field->label = "Other sites running from same install"; $field->description = "Add each domain for their own line. Don't add http or https, just simple domain like: www.example.com tai campaign.example.com"; $field->notes = "IMPORTANT: create homepage for each of these domains right on the root. Name should be exactly same as the domain you use here."; $field->attr('value', $data['subdomains']); $fields->add($field); return $fields; } }
    1 point
  20. i'm not entirely sure but i think this might be it: http://processwire.com/talk/topic/5-how-do-i-retrieve-all-pages-within-a-certain-monthyear/page__hl__date__fromsearch__1 Also, this could be useful in relation to the above link: http://processwire.com/talk/topic/263-creating-archives-for-newsblogs-sections/page__hl__archive__fromsearch__1
    1 point
  21. You can just go to github download the zip file (button top left) https://github.com/r...ramerdesign/P21, nothing special. And then rename the wire folder in your install to "wire_old" and copy the new wire from the zip over. Repeaters aren't installed by default so it should be no problem. If you experience any problems you can roll back to the old wire folder. Also may report the issue you got in case.
    1 point
  22. If your not using git, yes. only the wire folder though
    1 point
  23. Alex: edit the home-template, access tab and see that you have allowed creating pages and add children for your custom role.
    1 point
×
×
  • Create New...