Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/14/2014 in all areas

  1. Well I have to admit that I was near to a heart collapse for like 117 minutes. And then: ★★★★ Afterwards I was on the Ku'damm and it was like Silvester with hundreds of thousands of people on the streets:
    4 points
  2. Yes I will - once it is finished and I am sure it is working (and that I can display the example)
    4 points
  3. Well redirects only working for "real" urls like "yoursite.com/home.html". Not for IDs in queries (the part behind "?"). What you could do is to add a switch to your index page (probably home.php in the templates folder): <?php switch($input->get->pid) { case '1': $session->redirect('http://thenewpage.com/newpath/'); // this will happen if pid in URL is 1 break; case '8': $session->redirect('http://thenewpage.com/anotherpath/'); // this will happen if pid in URL is 8 break; }
    3 points
  4. Maybe javascript is turned off? It seems that only TinyMCE fields do not work. They should fallback to textarea, but check anyway.
    3 points
  5. Hi ivy, You have to change the Theme of the guest user to "Ergo". If a user is not logged in, ProcessWire knows him/her as "guest". Cheers
    3 points
  6. I am having a lot of fun today (having worked out a game throttling kink with Soma last night - thanks mate) I have about 900 plus pages all about car manufacturers, models, servicing, prices and the rest. So what? Well, it is the way I have been able to put them together with PW and PHP So, I have a function that lists all the services like gearbox rebuilds, or body work repairs. On its own, on a normal page, it just links to the pages about those things. On a car manufacturer page it changes from Gearbox Rebuilds" to "Audi Gearbox Rebuilds" with an extra URL segment in the URL that adds /audi/ The function gets two extra arguments to work the magic: rightMenu($page->title,$page->name); Now on the gearbox rebuilds page it is suddenly all about Audi gearbox rebuilds with text changes all thanks to hanna code. Also on the manufacturer page it lists all the models for audi and gives servicing prices for each model. Prices are set globally (since most cars cost the same) but can be overridden individually if the client wants. Now I just need to add Ryans clever linking thingy for text and suddenly I will have everything cross linking all over the place. The Really, Really, Really amazing thing about this is that I have been able to code all this from scratch with so little knowledge that it is frightening, but there I am, staring at a 900 line functions file, stuffed with php and PW API, and I did it all. And it works! The reason is the API - to code this fully would be so overwhelming that I would not even consider it, assuming I even knew where to start. But the API wraps up so many complications is such brief statements, that suddenly it is not only easy, but clean, clear and understandable - even for an old has-been, burnt out, media bloke like me. The only down side is that the client is being so undercharged for this that it is criminal - but then, it is not his fault that I decided to get carried away and add 900 pages to his site.
    3 points
  7. I'm no SEO expert but i think none of the major search engines pays attention to the meta keywords tag anymore. Can't look it up right now but there should be plenty of resources, including videos from Googles Mat Cutts. In fact, if you abuse it (intended or unknowingly) it may hurt your rankings. In most cases it's probably best to focus on adequate meta titles and descriptions and don't bother with keywords. -- EDIT For future reference; some info here: http://www.metatags.org/google_ignores_meta_tags_in_ranking
    3 points
  8. I'm currently on creating a module. What I want is, on a certain user, their publish post must be accepted by some author before going to live. In order to do this, I will put save the revised content on child page of that page then redirect them to parent. I want to put a message like "Revision saved. Waiting for publisher confirmation.". My question is, how can I show custom message on ProcessWire. Is it via session (PW wiil detect certain session then displayed)?
    2 points
  9. When trying to resize this image it seems to have a transparent color at index 126. But it hasn't one. To avoid an errormessage with those inconsistent gif images we can suppress errors from the ImageColorsForIndex function by precede them with an @ char: $transparentColor = $transparentIndex != -1 ? @ImageColorsForIndex($image, $transparentIndex) : 0; Calling ImageColorsForIndex with an inconsistent $transparentIndex returns FALSE, so with the next line in code both cases, FALSE and 0 (zero) work as needed: if(!empty($transparentColor)) { I will send have sent a PR to Github. @Can: commenting the line is not necessary
    2 points
  10. Ah okay. Now go out and have fun with PW
    2 points
  11. I'm doing this now. I have 10-12 partners who are businesses and freelancers. We are all on each-other's websites and white label our services so the client is billed under one business. It's a very scalable way to do business. Not only can you get prices down for your client, but you can grow your business on a moments notice to support larger clients/jobs. The key is finding reliable, honest people who can trust implicitly. They also need to share your values, because they are representing you and/or your business. In terms of pricing, we generally offer each other wholesale pricing (50% discount) for hourly work. Sometimes the project is managed by the professional who's providing the work and we don't deal directly with each-other's clients. Other times we deal directly with the client, which sometimes mean extra overhead and an increase in hourly rate. Generally I try to pay as much as I can, so I like to also do percentages on higher profit jobs. For example, if it only costs $500 dollars to pay someone hourly to complete a project, but I'm billing the client $10,000, then I would offer a percentage of the contract price based on the amount of value or time the partner is providing. In this case (using the example above) half of the contract price would go to biz expenses and labor, 30% to marketing, and 20% or $2,000 would go to the partner for their labor. The percentage I offer depends on the project and the health of my business. I also like the percentage pricing, because it's generally what I can afford, while also being the highest amount I can pay my partners. When business is good, I can offer more, when it's not good, I have to spend more on marketing so my offer is less. I go down my list of contacts, starting with the best match, until I find someone who's interested in the work at the price I can afford. Send me your website or work samples. If I can utilize your talents I'll start offering you work. -steve.
    2 points
  12. I am really sure that we should be able to make those E-commerce solutions in PW without the need to add some 3rd party software (exept for the payment processing). PW is the best for creating custom fields, so we know we can make the catalogue part of a store the best. Apeisa made the cart and checkout modules. We should figure out what modules have to be added and do so. I made a couple of online stores with Joomla, but cannot say I know the architechture of those type of sites well enough to coordinate a project like that. But am willing to take part at least testing. As I can see now the result of a work like that would be a site profile (pretty much like Drupal Commerce in Drupal world). If we could find a way to easilly add online store functionality to an existing site (like features in Drupal), that would be even better. I know I am probably dreaming, but isn't PW a dream come true? What do you think? Is it possible to make ProcessWire the best E-commerсe solution for ProcessWire?
    2 points
  13. Hey, I wrote a little tutorial on how to add dynamic meta tags to your page: http://supercode.co/posts/processwire-best-practice-meta-tags/ Any questions left? -- nico
    2 points
  14. Congrads to all german fellows over here!
    2 points
  15. Well done Germany, congrats! Best team of the tournament, all round very good team. See you in 2018!
    2 points
  16. BTW, you could do this: <?php echo $page->meta_title ?: $pages->get('/')->meta_title; ?> instead of this <?php echo (($page->meta_title) ? $page->meta_title : $pages->get('/')->meta_title); ?>
    2 points
  17. Did you know you can probably do $page->parents->count() to get the depth from the homepage? The other scenarios are a bit trickier of course. I think that you probably don't need to have a hidden fieldwork storing this unless you were having dozens of comments deep in your scenario. Even then it's reasonably cheap resource wise. I would instead make savings by caching the comment output using MarkupCache whenever a new comment is made - that way people just viewing the comments don't incur any overhead, plus you can cache whether or not a reply button exists at a certain depth for your threaded comments.
    2 points
  18. The great thing about ProcessWire and all the great tools/modules associated with it is that I have been motivated to relearn PHP, HTML, CSS and Javascript. I have never had so much fun as in the last year. Hanna Code specifically with Ryan's original Foundation 4 profile made learning too easy. I have now gone on to other CSS Frameworks with no fear. I still got the API, functions, modules and many other things to learn in ProcessWire. I can't say that I am bored with ProcessWire. From my point of view, It's great to be an old geezer. I embrace it because it doesn't keep me from learning new and exciting things.
    2 points
  19. This is already old news to many of you here, but I finished writing up the full announcement today so figured I should post it (click the link below). Numerous upgrades and refinements make ProcessWire 2.4 our most friendly and powerful version yet! ProcessWire 2.4 is focused on listening to the feedback from of our users and answering with the best CMS experience for web designers/developers and their clients. Read the full announcement. For those upgrading from a previous version of ProcessWire, please read all of the upgrade instructions. Hope that you enjoy this new version! A huge thanks to Avoine for sponsoring the Field Dependencies feature new to ProcessWire 2.4!
    1 point
  20. I just finished this article and wanted to post it here as I'd love to get some feedback from you guys in the comments of the article explaining why you work with ProcessWire. There's a great chance here to help spread the word a bit more for this awesome CMS we all love. If you have five minutes, please share your thoughts in the article comments. I'd appreciate it. ProcessWire vs WordPress
    1 point
  21. Another way to do this would be to pack all the infos in one template and use url-segments. Could be sorted in four tabs (main / review / comments / actor) with a checkbox to enable comments and/or actors. The code would be quite similar to nico's switch example. So you don't need to check, that there aren't duplicates, because it's all one page in the backend. <?php switch($input->urlSegment(1)) { case 'review': include 'page-apage.php'; break; case 'comments': if($page->comments_enabled) include 'page-anotherpage.php'; break; case 'actors': if($page->actors_enabled) include 'gallery.php'; break; }
    1 point
  22. Edit: Not sure if it works with PageTable but it works with the traditional way. Should work: <?php class SingleUseTemplate extends WireData implements Module { static public function getModuleInfo() { return array( 'title' => 'Single use template.', 'summary' => __('Single use template.'), 'version' => '100', 'author' => 'Nico Knoll', 'singular' => true, 'autoload' => 'template=admin' ); } public function init() { $this->addHookBefore('ProcessPageAdd::execute', $this, 'validateTemplate'); } public function ___validateTemplate(HookEvent $event) { if($this->input->post->submit_save) { $chosenTemplate = $this->config->input->post->template; $parent = $this->pages->get($this->input->post->parent_id); // enter the template for the "parent" page. Like in your example "movie" if($parent->template->name != 'movie') return false; // check if a sibling (same depth level) already uses this template foreach($parent->children as $child) { if((string)$child->template->id == $chosenTemplate) { throw new WireException('Template already used. Chose another one.'); } } } } } SingleUseTemplate.module
    1 point
  23. Very sad indeed totoff. I miss Opera/Presto ever second I'm online. Nothing else comes close. I've done my best to replicate most of the functionality with numerous plugins and PaleMoon (Firefox), but I just can't achieve the same contented, secure feeling I always had with Opera/Presto. Opera/Presto was solid and they just threw all away in favour of a re-badged Chrome. Opera ASA never gave a single thought for it's devoted user base. It's a tragic waste. Don't let me get started.
    1 point
  24. Hello Processwire, First of all thank you for a wonderful CMS. This would be my first question to the Processwire community as I started with it. I am trying to create module which can keep site logo as a configurable input field. I use following code to create InputFieldImage and still no luck. public static function getModuleConfigInputfields(array $data) { $field = wire('modules')->get('InputfieldImage'); $field->name = 'siteLogo'; $field->label = "Site Logo"; $field->maxFiles = 1; if(isset($data['siteLogo'])) $field->value = $data['siteLogo']; $inputfields->add($field); return $inputfields; } Any advise will be greatly appreciated. Thanks again.
    1 point
  25. this is, btw, true and sad at the same time.
    1 point
  26. Thanks Nico, I already am
    1 point
  27. Just to tie things up.... The lack of editing options was due to127.0.0.1/ProcessWire/wire/modules/Inputfield/InputfieldTinyMCE/tinymce-3.5.8/plugins/inlinepopups/editor_plugin.js prevented from loading. The culprit was the following badly implemented regex in my custom adblock script: .popup.*\.js Either a typo or accidentally left in place after some testing. Removed it and everything is dandy! TinyMCE editing returned to normal. Now I can get on and enjoy PW. Thanks again all I take full responsibility for my clumsiness.
    1 point
  28. Thanks - that works but will this be considered as 301 redirects? Never mind, I see that $session->redirect is a 301 redirect. Thanks again for the quick response and help. This will work fine for this site.
    1 point
  29. Tried in Opera - an old Presto build ironically - and et voila So it was a browser issue all along. Why didn't I check that? Many thanks Nico. I shall now try to work out why this was the case at localhost, but not at the PW online demo, which rendered perfectly. For future reference my main browser - since Opera committed suicide - is PaleMoon, a custom build of Firefox. Though that in itself is clearly not the sole cause. I Many thanks to everyone for being so helpful. Glad I don't have cause to blame PW for this initial glitch, because it appears to be the ideal bloat-free, common sense CMS solution I've been searching for.
    1 point
  30. It's like Ivan said: Looks like a TinyMCE problem. Do you tried different Browsers? Which OS are you running (looks like windows 2000)? Have you tried to use another computer?
    1 point
  31. I agree and think it is something that is possible if the time and effort is put into it. For me this is one area and advantage that other cms's such as Wordpress with Woocommerce have over Processwire. Maybe something like woocommerce could be taken as an example of how to do it. I dream of the day that Processwire has such an E-commerce solution so I don't have to look outside of Processwire.
    1 point
  32. Did you already disabled the Admin Theme on the core? I think you must need to disable it to take effect
    1 point
  33. Fixed. Just have to add curly braces. foreach( $page->fields as $field ) { if( ! in_array($field->type, $ignore_field_type) ) { $field_name = $field->name; $revise_page->{$field_name} = $page->get($field->name); } }
    1 point
  34. There is a way to add those meta fields to all templates at once, bit I couldn't add the whole group. I guess that would be a usefull thing to be able to do as metatags are usually used for all accessible pages on a site. Do you have any ideas how it can be possible? If you have time and desire to extend that very useful tutorial I would be very interested in learning ways to implement actually "Dynamic Meta Tags" (those shown here are custom, but not really dynamic). Maybe with Hanna Code or something like that. Of cource we can easily add that "dynamics" in the template, but that is not a good thing if you got someone doing SEO who is not so much into development. By "dynamic" I mean generated by template from other fields and the logic is configurable via GUI.
    1 point
  35. Stolen from the web :
    1 point
  36. Well done Germany. Well deserved.
    1 point
  37. Let's break this down The name of the repeater: mp3_repeater Having iterated the repeater (foreach), each single repeater instance is assigned the variable: $mp3 $mp3 contains various fields one of which is a file field called: file The field file has its own 'internal' fields such as name, description, etc... Putting this together... $mp3->file->description ...should work. You had a typo in your syntax ($file). Btw, why are you using this? data-src='/processwire/site/templates/audio/$mp3->mp3_url' This should work... data-src='$mp3->file->url'
    1 point
  38. Well you just set the fields from the other page, and the $page will still be the same page object just with new content (on runtime). $p = $pages->get("/somepage/"); foreach($p->fields as $f){ $page->$f = $p->$f; }
    1 point
  39. I'm interested as well, but what about Munich? It's great to reach and in terms of travelling there and accomondations, it's a lot of cheaper than Switzerland Here are some coworking spaces you can rent quite cheap for conferences: http://www.combinat56.de/ http://www.werk1muenchen.de/
    1 point
  40. I agree this is a cool idea. But what's wrong with using mysqldump to migrate the database and just copy the site over to production?
    1 point
  41. Tested. This should work... $p_user = wire('user')->name;// set user name $p_page = wire('pages')->get("title=$p_user");// try to get page with the same with user name $p = $this->modules->get('ProcessPageList'); $p->set('id', $p_page->id);// setting the parent page to user name page Edits: Edited code above to show class/module use context... Also edited some typos in your original code (which I also subsequently copy pasted )
    1 point
  42. Hi Alex, Welcome to ProcessWire and the forums... Not sure what error you are getting but I am guessing the problem is the ->id part. A $pages->find will return and array of pages (i.e. there will be multiple ids); so, you only need $pages->find("age>$minAge"). You can then iterate through them. See examples here: http://processwire.com/api/variables/pages/ Secondly, nothing to do with your error, but you need to sanitize your input values first. In this case, you need to do at least this: $minAge = (int) $input->get['minAge']; The above are quick examples...you might need to sort out your double versus single quotes in the selector...I often forget which is which ...I might have missed something....others will correct if I did
    1 point
  43. it work for willyc and.mom if u add.page-publish perm user need page-publish perm .to edit alreadey publisheded page user w/o page-publish only.create or edit.unpublishedd pages cd ..
    1 point
  44. Ok. We just launched our new website today, of course now running on ProcessWire. A long journey with many iterations and somewhat experimental. Still a work in progress, as much as never finished. There's a lot of inter-linkage going on between content news, projects and competence pages. Modules worth mentioning: TextformatterAutoLinks Markup RSS Feed http://update.ch (IE < 9 not supported, sorry. Old Androids may experience strange things)
    1 point
  45. Interesting link that. I have made similar points with main stream advertising. For instance with music: if an advertiser has a piece of music created by someone who has no artistry, then even if all the messaging is perfect, the advert will completely undermine the brand. The biggest mistake any company can make is to underestimate their audience. It is not uncommon for a company to think they can throw any rubbish at potential customers because "what do they know?" What is forgotton is that every listener to adverts or users of the web use thousands of websites and most of those will be by huge companies like Google; what ever you think of them, these companies will have websites that work perfectly for what they are doing. The result is that even if the customers cannot appreciate what the technical or design differences between a good or bad site, or a good or badly produced piece of music, never the less, they will sense that it is cheap and nasty, and that is how they will judge the company. If you want to completely undermine a brand, even a well established one, commission something that people will view as being "amateurish." Always remember the lesson of Gerald Ratner. During a conference, he remarked, "People say, "How can you sell this for such a low price?", I say, "because it's total crap." Although customers knew his stores sold low quality goods, at least they had been treated like good customers. His statement completely undermined the brand and the customers simply stayed away. It knocked £500 million off the market value of the company. An imaginative, or clean, clear and well written website does not need to cost more money that a crap one - but the damage that can be done by a site that is badly made, poorly written and pays no attention to the brand could cost a client a fortune. Maybe their entire business.
    1 point
  46. There is another issue here, one that applies to CMSs in particular. I think it is really important for small companies (5 people or less, perhaps) to be able to update their website themselves - for many small companies, a monthly fee is not realistic for the amount of value they are going to get from the site. However, I have been stunned by the number of company owners who simply cannot put together two words in any meaningful way, or even in a grammatical way. We seem to be in a situation that being able to use Facebook or some communication app is seen as more important than actually being able to write; it is as if the software will somehow make you a great communicator without you having to try. I just don't get this. Thanks to the way the internet works by default (text on screen), people read more than ever, even if it is just a chat message. And yet, their communication skills, the ability to use words clearly and nicely, seems to be getting worse and worse. And then businesses wonder why they don't get work? All a bit sad, really.
    1 point
  47. Thanks Soma and RJay. This would be my module script: class SiteSettings extends WireData implements Module, ConfigurableModule { public static function getModuleInfo() { return array( 'title' => 'Site settings', 'version' => 0.01, 'summary' => 'Store general site settings', 'author' => 'Gayan Virajith', 'singular' => true, 'autoload' => true, ); } static public function getDefaultData() { return array( 'siteLogo' => '', ); } public function __construct() { foreach(self::getDefaultData() as $key => $value) { $this->$key = $value; } } public function init() { //do it later } public static function getModuleConfigInputfields(array $data) { $inputfields = new InputfieldWrapper(); // ask site logo image $field = wire('modules')->get('InputfieldImage'); $field->name = 'siteLogo'; $field->label = "Site Logo"; $field->maxFiles = 1; if(isset($data['siteLogo'])) $field->value = $data['siteLogo']; $inputfields->add($field); return $inputfields; } } I have attached module preview as well. According to Soma's advise, I have to give up. Thanks every one.
    1 point
  48. Welcome to the forums abe.izar. Seems like they should make json_encode at least attempt to typecast an object to a string (which would convert to IDs here). Maybe I can update wireEncodeJSON (a front-end to json_encode) do that. However, if you really want to export pages and all their data to JSON, here's how you can do it: function pagesToJSON(PageArray $items) { $a = array(); foreach($items as $item) { $a[] = pageToArray($item); } return json_encode($a); } function pageToArray(Page $page) { $outputFormatting = $page->outputFormatting; $page->setOutputFormatting(false); $data = array( 'id' => $page->id, 'parent_id' => $page->parent_id, 'templates_id' => $page->templates_id, 'name' => $page->name, 'status' => $page->status, 'sort' => $page->sort, 'sortfield' => $page->sortfield, 'numChildren' => $page->numChildren, 'template' => $page->template->name, 'parent' => $page->parent->path, 'data' => array(), ); foreach($page->template->fieldgroup as $field) { if($field->type instanceof FieldtypeFieldsetOpen) continue; $value = $page->get($field->name); $data['data'][$field->name] = $field->type->sleepValue($page, $field, $value); } $page->setOutputFormatting($outputFormatting); return $data; }
    1 point
  49. For any PageArray, count($pageArray) returns the number if items present now, but $pageArray->getTotal() returns the number of items total without pagination. So if you specified a "limit=n" in your selector when loading the pages, you can always call upon that $pages->getTotal() to tell you how many matched in total. There is also a $pageArray->getStart() method, which tells you the index of the first item. So if you had specified "limit=10" and you were on page2 in the pagination, then getStart() would return 10. I use these two functions to output a summary of results that tells you were you are. So if you wanted a headline that said this: You'd do something like this: $firms = $pages->find('parent=/firms/, num_staff>100, limit=10'); $start = $firms->getStart() + 1; $end = $firms->getStart() + count($firms); $total = $firms->getTotal(); echo "<h1>Firms with more than 100 staff</h1>"; echo "<h2>Showing firms $start - $end of $total</h2>"; foreach($firms as $firm) { echo "<p>{$firm->title} has {$firm->num_staff} staff</p>"; } // output the pagination links echo $firms->renderPager();
    1 point
×
×
  • Create New...