Leaderboard
Popular Content
Showing content with the highest reputation on 06/18/2013 in all areas
-
Hello All, So we redesigned our company website (finally!!!) that was under redesigning for over a year. And I'm very excited to present it here. My initial (very firm) decision was to make the new site using Textpattern as it fulfilled almost all our requirements and developing a site using Textpattern would have only taken a day or two for me. But ever since I've found ProcessWire, I can't think of using Textpattern anymore. It's like cheating on your wife for a new girl you met just a while ago who's slimmer, sexier, fulfills all your demands & most importantly, never restricts you from doing anything that you wish, unlike your wife who has already set rules & restrictions. Not that I'm criticizing Textpattern in any way, it's a great reliable CMS which is easy to use & customize, but like I said, PW's making me cheat on Textpattern. Coming back to real topic, here I present our website: www.adveti.com This is the very first PW site made by me that's gone live, few more are in queue. About the site, it's a responsive mobile friendly website, for that we use a tiny CSS framework which I had made a while ago, we call it Tiny Grid. It's still under construction. We've to upload many of our projects. Just to get the site launched, I've added only about 6 projects that we did recently. There's a lot more work to be uploaded. It's a very simple & basic site which mainly focuses on displaying our work, so we've tried to keep as simple as possible, minimal you can say! FormTemplateProcessor module proved to be very useful in making project planner which helps in providing clients rough estimate of the project cost, thanks to Ryan for that. So I'd love to hear your feedback, if you like it, hate it, have suggestions,everything & everyone's welcome. Thank you all, and sorry for the long post6 points
-
It seems like a generally good review, and very glad to see it. This is just the sort of exposure that really helps the project, so I'm very thankful for the review. Though it also seems like the review may have been based on a very brief experience with ProcessWire (maybe the demo?), as there's nothing to indicate the author(s) used it to develop anything, or know the system particularly well. I think this was primarily a good surface review (and nothing wrong with that). ProcessWire may be fine when you look at it on the surface, but it really shines when you actually use it, know it and develop in it. I think this is something most ProcessWire reviews miss. (CMSCritic.com is the only one I know that really gets it and has put ProcessWire through its paces). For example, the comment about global variables, among other things, seem a little out of left field to someone that knows ProcessWire well. I'm glad they thought our API was interesting, but I'm not sure they understood they understood the extent to which this is the driver of the system. The review stated the documentation was lacking, but I bet the author(s) didn't read the docs. People that do commit and read the docs tend to get a ton out of it. We probably wouldn't have nearly as active of a forum if everyone read the docs… for the record, I prefer having an active forum and getting people involved in the community, even if many questions can be answered in the docs. If we have a docs problem I think it's one of digestibility and structure rather than one of documentation scope. Outside of these things I think the author did a good job with the review and got a lot of points right. In fairness, if I was reviewing another CMS, it's unlikely I'd go develop a full site in it or read all the docs, etc. ProcessWire is a system where it's really about what's underneath rather than what's on the surface, and I think that's something very difficult to capture or communicate in review.3 points
-
Every find will return a PageArray already, no need to explode to get the page id as array you already got them... My guess is that most people try to echo $p, and see that there's something like "1002|1230|2130" ... but that's not what's really behind $p and seems a common misunderstanding of non-coders. It's the magic toString() method of PageArray that returns the id's in that way. See https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/core/PageArray.php#L407. So what you trying to do an extra step to explode something that PW implodes. This stringification is handy if you want to use the result $p in a selector. "id!=$p" will result in "id!=1002|1230|2130". But in your case you already have an PageArray and simply can loop the pages inside $p. $p = $pages->find("images.tags~=$tag") foreach($p as $onepage) { echo $onepage->title; }3 points
-
What funny title.. I lol'd. It should be "WP got hacked need PW 2.0". I almost got a heart attack.2 points
-
If you want an url structure that is not mapped 1:1 with the pages-hierarchy, you should use url segments: http://processwire.com/api/variables/input/ You need to enable url segments in the template of the pages man/women. When viewing site.com/products/man/brand1/, your first urlSegment contains brand1, so you could filter your products according to that: // In template of men/women... if ($input->urlSegment1) { $brandName = $input->selectorValue($input->urlSegment1); // Get the brand $brand = $pages->get("template=brand, name={$brandName}"); // Brand does not exist, throw 404 if (!$brand->id) throw new Wire404Exeption(); // Brand exists. Get all the products with the brand $products = $page->children("brand={$brand}"); } else { // No url segments... display normal page content e.g. all products under men }2 points
-
This can get really creative, as Ryan would now maybe come with something like: $nav = ''; foreach(array("prev","next") as $dir) { if($page->$dir->id) $nav .= "<a href='{$page->$dir->url}'>$dir</a> | "; else $nav .= "<span class='inactive'>$dir</span> | "; } echo trim($nav, " | ");2 points
-
if ($page->id==1) {echo "you are on the home page"};// if the ID of this page is 1, then it is the homepage OR if(!$page->parent->id) echo "You are on the homepage";//Means, if this page has no parent, then it must be the homepage Actually, there is a lot of useful information in the documentation: http://processwire.com/api/variables/page/. It's worth having a look at2 points
-
This is an exciting announcement for me to make! After having selected ProcessWire as our 2012 Best Free CMS winner in our Critics Choice CMS Awards, we decided it was time to put our money where our mouths are and make the move ourselves. I'll get into more detail soon but for now, I'm excited to present the new CMS Critic (developed by the illustrious Ryan Cramer). Note that it is still propagating so if you don't see a site that looks like the screenshot below, DNS hasn't fully updated. I'm just too pleased to wait the full 24 hours to make the announcement ;P I also did this write up on the experience: http://www.cmscritic.com/cms-critic-is-now-powered-by-processwire/ Check it out: CMS Critic1 point
-
@Horst: I thought he was using a PHP file outside the PW system (i.e., I didn't know it was a template file). @Svitcov: What is $slide? How does your other code look like just before what you have shown us above?1 point
-
@kongondo: I think this is not right. The images reside in the site/assets/files/ folders, and they can be accessed directly. This is normal behave. @svitcov: your img-urls have no filename, something like myimagename.jpg!1 point
-
You know that you can define 'allowed template(s) for children' and 'allowed template(s) for parents' in the Family config from your template?1 point
-
Very nice, informative and clean design you've built on your company website. I really like it. It goes straight to the point without unecessary informations, just to make the company "cooler". I like the way you've managed the contact form, where red borders means required fields to compile...on top of that the "100% width" submit button looks good on desktop too. Ahhahahahah, I totally agree!1 point
-
If you allow multiple images with your 'logo' field, then the code must work - assuming you have at least one image uploaded on the page viewing. I'd try again If it does not work: Enable debug mode in /site/config.php ($config->debug = true) and check for any errors. Btw when you allow multiple images, why not calling your field 'logos' - would be more logical1 point
-
1 point
-
Nobody? Ok, since the tags introduced to the image field is just a plain text field, there's no other way than to loop all pages that have images loop all images to grab all tags, parse them to array and merge them. This gets you there but doesn't scale well. (Would those tags be page relations it would make it very easy to output all tags. I'm more of a fan of using page fields for tagging, but there's no image field with page tags and I use different image system if there's a lot of images with tagging and galleries. My ImageManager is one of the tools to have a page as image and you can attach as many fields to the image template to get those things done.) I often thought about what would be the best ways, with words in text fields all over the site, to collect them and I think you have two possibilities. Raw SQL query, or the above loop all pages and make that a markup cached snippet, if the amount and time to generate the list takes long, that runs every other day or hour. Also have as many restrictions, for template or parent, as you can get to make the query a little more efficient. To show what would be the API way you already got a good start and intuition with 2 foreach. The following collects all tags and makes a unique array to create a link list. EDIT: You can use url segments or GET parameter for the links. Since PW urls doesn't allow special chars there's a workaround inside the code now. /** * collect all tags * ====================================== */ $alltags = array(); // container $use_urlsegments = false; // find all pages that have images with tags $parray = $pages->find("template=basic-page|gallery, images.tags!=''"); // loop pages found and collect tags from images foreach($parray as $p) { // find all images that have no empty tags, yeah you can // also use find on Pagefiles array! $images = $p->images->find("tags!=''"); // loop them and add tags to array foreach($images as $im) { $tags = $im->tags; // convert "," and "|" to space and create array using explode if(strpos($tags, ',') !== false) $tags = str_replace(',', ' ', $tags); if(strpos($tags, '|') !== false) $tags = str_replace('|', ' ', $tags); $tags = explode(' ', $tags); // convert tag value to a page name using beautifyer, ü => ue, ö => oe // since special chars are not allowed in PW urls foreach($tags as $tag) { $alltags[$sanitizer->pageName($tag, Sanitizer::translate)] = $tag; } } } /** * generate links with tags as urlsegment * ====================================== */ // make the array unique and create a tags nav from it // add tags to the url of the page to later read it and // render a list of pages echo "<ul>"; foreach(array_unique($alltags) as $key => $tag) { if($use_urlsegments) { echo "<li><a href='{$page->url}$key'>$tag</a></li>"; } else { echo "<li><a href='{$page->url}?tag=$tag'>$tag</a></li>"; } } echo "</ul>"; /** * find all pages with the supplied tag * ====================================== */ // enable url segments on the template if using url segments if($input->urlSegment1 || $input->get->tag){ if($input->urlSegment1) { $tagvalue = $input->urlSegment1; // get the original tag value text from the cached array $tagvalue = $alltags[$tagvalue]; } if($input->get->tag) { $tagvalue = $sanitizer->selectorValue($input->get->tag); } // find pages with images having the requested tag $pa = $pages->find("images.tags~='$tagvalue'"); if(count($pa)) { echo "<h2>Pages found</h2>"; echo "<ul>"; foreach($pa as $p) echo "<li><a href='$p->url'>$p->title</a></li>"; echo "</ul>"; } } What was the other question again? And of course also found in my ever growing gist archive https://gist.github.com/somatonic/5808897 I'm too lazy to brew a SQL that does the collecting part. But there's people more clever than me that can help.1 point
-
virgintribesa.com Created for Virgin South Africa Employee engagement - they're yet to have much content up there but the site is pretty much finished.1 point
-
That's by far my most favorite website made with ProcessWire, really good job!1 point
-
Today I just want to show a new page build with ProcessWire. It's nothing fancy but the client is more than happy. http://www.rv-heidenheim.de (german content) The local horse club had an old ugly Flashwebsite which we relaced with a fresh and modern PW site. The goal was to create an easy system to maintain content and to inform people about the club. Behind the scenes: Processwire with ProCache let the site run faster than any horse in the barn. Using the PageLink Field to create a menu structur. Skeletton 960px grid but right now we removed the mediaqueries. We will add the mobile view later. The weater widget uses this jQuery plugin. All widgets in the sidebar are pages and fully configurable by the backend user. A year ago, this was my first Processwire page. But it was never released and we made a complete new second version last month. First time I've used an icon font. Try fontello.com to build your own icon font. The site was designed on a friday evening and only 24 hours later the whole site was done. Using PW it's just a charm to build such small sites and let people insert their content.1 point
-
Ah, forgot to mention, that there's also a way to add team members which are displayed on the Company page. Since right now, team's photos are not available, I've kept the team section hidden. I am hoping to unveil it soon (provided the photographer shows up soon). Later on, I'm planning on adding a way for team members to log in & maintain their own bio page on the site. This page will act like a social profile for team members. Also, there will be a private section for each user to log into & maintain his/her task sheet on daily/weekly basis. This will help us in tracking individual & project progress. The reason behind thinking all this is, just because I know ProcessWire allows me to do all this. I'm gonna do it cause I can do it And also, it'll be very helpful for the upper management. Hope you guys ain't bored.1 point
-
1 point
-
1 point
-
If products are assigned directly to the brand or collection (rather than being assigned to the product) you could query it very easily… $brands = $pages->find("template=brand, products.count>0"); // $brands now contains all brands that have at least 1 product …but I'm assuming that each page under /catalog/men/suits/ has a "brands" and "collections" page reference field (rather than brands and collections having a "products" field). If that's the case, you can't query brands or collections directly since they don't have any field in their template that tracks what products they contain. You'd have to check them individually: $brands = array(); foreach($pages->get("/catalogue/brands/")->children() as $brand) { $numProducts = $pages->count("brands=$brand"); if($numProducts > 0) $brands[] = $brand; } // now the $brands array contains only brands that have products Another, potentially more efficient way (depending on quantities) would be to compile the brands from the products: $brands = new PageArray(); foreach($pages->find("template=product") as $product) { $brands->add($product->brands); } // $brands now contains all brands that have at least 1 product Lastly, I've solved this problem on the large scale by having an after(Pages::save) hook that calculates and stores (caches) the quantity directly in the brand, making it possible to query very easily. This is surprisingly easy to do, if you'd like more instructions let me know.1 point
-
I've wanted to add this myself. While a big highlighted word may be distracting (right Dave?), finding the particular reference you searched for in a big page of text is equally frustrating and some form of delineation of the search term is helpful. However, since the search results page only displays the title and summary, often the search term itself isn't present on the search results page and the highlight doesn't actually get a chance to work. It helps to be able to pass the value of $q onto the page the user clicks in the search results. As Soma suggested, the easiest way that I found to do that (although there may be a better way) is to add: foreach($matches as $m) { $out .= "<li><p><strong><a href='{$m->url}?q={$q}'>{$m->title}</a></strong><br>{$m->summary}</p></li>"; } Which then passes $q onto to the next page so it can be accessed by .highlight. Works for me. Simple and easy on my brain. I should add you then need to add the following to the script at the bottom of the page: <script> $("body").highlight("<?php $q = $input->get(q); echo $q; ?>"); $(".highlight").css({ backgroundColor: "#FFFF88" }); </script>1 point
-
Three times I started to post my comments after the review but gave up. If you can describe PW API as only "decent" then you clearly haven't used the system! Anyway, could be a matter of language. Wanted also to comment on the issue of pages which we know is an abstract term. Also, wanted to say you can save other stuff in db if you don't care about urls. In addition, there are PW projects that have >100k pages! It's not just for small projects. Was tickled by "updating PW requires tinkering with the system" . Anyway, I'm now preaching to the choir . You are right though; the exposure's good. There have been many re-tweets about the post.1 point
-
1 point
-
Assuming 1 product => 1 brand Brands Armani (child pages of brands) Canali Magee Lambretta Men Suit 1 (child page of Men) Suit 2 Suit 3 Suit pages will have a single Page Reference Field referencing their brand, e.g. Suit 1 => Armani Suit 2 => Lambretta, etc. Is this what you want? I'm not sure I got you correctly. You then want to search and display, e.g. all men's suits by, e.g. Armani? Not tested but I think either of these should work $pages->find("template=suittemplate, parent=123, brand=armani");// brand is the Page Reference Field; 123 = ID of men page // OR $pages->find(123)->children("brand=armani");//123 = ID of men page Edit; Selector above, is of course wrong, brand=armani...will not give you what you want. You will want to create a variable that can reference armani (title of the value of the brand page reference field.)1 point
-
I've pushed an update that fixes this issue: https://github.com/ryancramerdesign/ProcessWire/commit/9e1f46d3d1c69bebbd0415f58baad627a0d194d2 It was also a fairly simple matter to make it identify the language from the URL, when present. So I added that too. Meaning, if something about the URL points to a language (like /it/ at the beginning, for example) then it'll deliver the 404 in Italian rather than the default language.1 point
-
Well no reason behind I think, all core Process modules execute() are hookable whether useful or not. I this case you could replace the add form with your own, what else But to be honest it would be better if buildForm() would be hookable, but nobody needed it so far so it's not. The thing is the execute() returns the form rendered already so you can't manipulate it using OOP.1 point
-
1 point
-
This is great! Thinking loud here: If you add tags to images, (lets say: cars, beaches or skyscrapers) then you could easily create albums. [[gallery tag=skyscrapers]]1 point
-
I wasn't actually looking for this at all, but it just shows how far you can go with Google Maps and a chunk of custom code! http://www.splitbrain.org/blog/2009-02/01-a_pirate_map_with_libgd_and_google_maps Very cool!1 point
-
Well I lost the parrot sometime around when I was last being a pirate: But I found him again when I went to a fancy dress party as French Polynesia (the theme was countries): What? How is that French Polynesia? French (beret) polly (parrot) knees (I'm showing mine) ear (Spock ear). French-poly-knees-ear. No, nobody guessed it on the day1 point
-
Nico, just updated the theme, cosmetic changes as requested by "woop". Pull request at github. * give the hidden pages an italic style and a lighter shade * lighten the shade of the children page count * Added active state style for the submenu buttons1 point
-
I don't think categories is the way to go here. 1. Nested Structure This is a good example where the date structure could be used to create the articles. Then you would a) have the urls already and b) an easy way to create lists and such. Additionally add a date field to the article template so you can choose the date and use that for additional searching. /dagboek/ /2008/ /januari/ // or use "01" as name whatever you like /article14012008/ /article15012008/ /februari/ /article01022008/ /2009/ /januari/ Then loop the years and months in a simple nested php script using API. You don't need to check if there's a year or month with articles if you create months manually. $years = $pages->get("dageboek")->children(); $out = ''; foreach($years as $year) { $out .= "<ul>"; $out .= "<li><a href='$year->url'>$year->title</a>"; if($year->numChildren) { $out .= "<ul>"; foreach($year->children() as $month) { $out .= "<li><a href='$month->url'>$month->title</a></li>"; } $out .= "</ul>"; } $out .= "</li>"; $out .= "</ul>"; } echo $out; Then on the years or months template file, you simply render out their children in any fashion you like and may add pagination using the built in Pager module. You'll have urls like /dagboek/2008/01/page1, dagboek/2008/01/page2 2. Flat The other route would be to use a flat structure and add articles to the /dagboek/ parent. Then add a date field to the article template you can define the day this article is for. Then use a script that checks for articles (oldest, newest) and generate a menu with virtual urls for each year and month that has articles. The URL then can be resolved using urlSegments to show a list of articles for the selected month. You'd have to enable url segments on the dagboek template to make this work. This is a script I created for generating a year month nested menu only for the ones that articles are found. $datefield = "mydate"; $template = "article"; $url = $pages->get("/dagboek/")->url; $newest = (int) date("Y",$pages->find("template=$template, $datefield>0, sort=-$datefield, limit=1")->first->getUnformatted($datefield)); $oldest = (int) date("Y",$pages->find("template=$template, $datefield>0, sort=$datefield, limit=1")->first->getUnformatted($datefield)); $out = ''; for($y = $oldest; $y <= $newest; $y++){ $out .= "<li>"; $out .= "<a href='#'>$y</a>"; $month_out = ''; for($m = 1; $m <= 12; $m++){ $month_start = strtotime("$y-$m-1"); $month_end = strtotime("$y-$m-1 +1 month"); $selector = "template=$template, $datefield>=$month_start, $datefield<$month_end"; if($pages->count($selector)) { // use count instead of find for fast query $month_out .= "<li><a href='{$url}$y/$m/1'>$m</a></li>"; } } if(strlen($month_out)) $out .= "<ul>$month_out</ul>"; $out .= "</li>"; } echo "<ul class='menu'>$out</ul>"; Then, on the dagboek template something like: if($input->urlSegment1 && $input->urlSegment2) { $year = (int) $input->urlSegment1; // 2008 $month = (int) $input->urlSegment2; // 02 $start = strtotime("$year-$month-01"); $end = strtotime("$year-$month-01 +1 month"); // find the articles for within that current month $articles = $pages->get("/dagboek/")->find("template=article, date>=$start, date<$end, sort=-date"); foreach($articles as $article) { echo "<h2>$article->title</h2>"; echo $article->body; } } Just rough examples.1 point
-
Hello Igor, you have lots of questions there. All that is doable with ProcessWire, and answered already to the most simple question: PW is not to heavy for shared hosting, it's even much lighter than most known CMSs. Because you have so many questions, I will answer with links. After reading those, you will be able to to narrow down your questions a bit so you can get some really useful answers: categories: http://processwire.com/talk/topic/3579-tutorial-approaches-to-categorising-site-content/ comments: There is a built in comment system (same as in PW site pages), you just have to activate t in modules: http://processwire.com/api/fieldtypes/comments/ eCommerce http://processwire.com/talk/topic/1732-shop-for-processwire-apeisa/ (lots of suggestions besides Apeisa's module) http://processwire.com/talk/topic/3756-shopify-integration/ (most recent discussion) Contact form: http://modules.processwire.com/modules/form-template-processor/ http://processwire.com/talk/topic/59-module-want-form-builder/#entry343 or http://store.di.net/products/processwire-form-builder group/permission http://processwire.com/api/user-access/roles/ multilanguage URLs http://processwire.com/talk/topic/2979-multi-language-page-names-urls/1 point
-
The site's been live for about 2 months now, but I thought I would share the first of many projects I plan to build with Processwire. http://romania-meubelen.nl is a site I designed and built for a small Dutch company specializing in Teak furniture. There's a lot of complex logic built into the calculating of the prices when combined with different sizes and finishes, but Processwire definitely made it a whole lot simpler to build.1 point
-
You can add a page field to the user template and a role parent. Then you can give them access to their children pages with (all code written in the browser): if ($user->hasRole("parent") && $user->kids->has($page)) { //show the page } else { // redirect to a general page or show 404 } and to the room page like this: if ( $user->hasRole("parent") && count($user->kids->find("parent=$page")) > 0) { // <- tricky hein? here we had to check if any of the kids of this user has this page as parent //show the room page } else { // redirect to a general page or show 404 } To link to the pages from the entry page you can: // show the kids pages and room foreach($user->kids as $p) { echo "<a href={$p->url}>{$p->title}'s page</a>"; echo " and "; echo "<a href={$p->parent->url}>his room</a>"; } Doesn't help that we are talking about real children and real parents while writing PW code1 point
-
Although I know and sort of understand the wish of clients to be able to do so, from a designer's/developer's point of view, these “free form” content types are not necessarily a good choice. (Disclaimer: This might be a very subjective point of view, and yes, I admit to being kind of a control freak.) I don't know what kinds of clients you guys have, but a lot of my projects are websites for people who don't really know much about building web sites. Those clients can actually benefit from a “rigid” approach because it does not only limit their possibilities, it also limits their margin for error, bad layout choices and basically anything which makes designers pull out their hair, as arrogant as that may sound. Then again, as long as this is implemented as a module or an option, keeping the flexibility we all love about PW, this probably is a “why not?” feature. (Just my 2 cents.)1 point
-
1 point
-
Adam Alan, my ST2 suggests text-decoration out of the box.1 point
-
Okay this was very short notice so it is incredibly rough! But this is for Diogo and all those others wedded to PW http://21stcenturyblues.co.uk/pwdream1.mp3 (Organized, try listening at less than 120db!)1 point
-
1 point
-
Don't use images in text wysiwag. Seriously. I think u can avoid a lot of issues. Think if you replace img with a different size and ratio. I stoped doing it and use other ways a long time ago. You just give away control, and editors start to think they need to do design. All websites we done with free images in text are horrible after 1 month in hand of a client and lots of maintenance needed. Use repeater to make blocks with images and a option to align or size. Or intext tags where to put image. Theres even a module. And your back in control. And other nice effect.1 point
-
here is what I did. I removed the output formatting on my field in the admin under fields > date Output Format > none. Then in my template I just formatted the date with the PHP date() method like so: <?=date('F j, Y',$post->publish_date)?> (note: $post->publish_date is a custom field I added.) Hope this helps someone.1 point
-
If you use jquery theres some easy way and do it client side. If you add ?q=searchword to the search result links it's easy possible. Some helpful links To get a url parameter http://stackoverflow.com/questions/1403888/get-url-parameter-with-jquery An lightweight plugin to highlight the word on page http://bartaz.github.com/sandbox.js/jquery.highlight.html1 point