Jump to content

diogo

Moderators
  • Posts

    4,296
  • Joined

  • Last visited

  • Days Won

    79

Everything posted by diogo

  1. Works great Ryan! And no need for the redirect in this case. Thanks! I will update the code.
  2. Also Lithium looks interesting. You have a lot of work to do
  3. I heard good things of http://fuelphp.com/. I glaced at their docs, and they seem good. I also heard good things about http://kohanaframework.org/, but their docs and community have the reputation of not being very helpful. Anyway, I start suspecting that you can do everything with PW
  4. I was working over this code from apeisa http://processwire.c...t__20#entry1364 and wanted to share the result with you all. Basically, this allows you to mirror the admin form from a given page to the frontend. To give some flexibility, you can fill an array with the fields to exclude —or else, the fields to include— on the output. EDIT: I forgot to tell... this works well with regular fields (text, textareas, checkboxes, radios, multiple choice, etc), but didn't manage to make it work well with images, for instance. So, here is the code: <?php // Get the page you need to edit $mypage = $pages->get('/some/page/'); // Populate with the names of the fields you want to exclude OR include (see instructions below) // Leave empty to output all the fields $myfields = array('body', 'email'); $form = $modules->get('InputfieldForm'); $fields = $mypage->getInputfields(); // If array is not empty use it to filter the fields if ($myfields){ foreach($fields as $f){ // Output all the fields minus the ones listed in the $myfields array // Instead, to output only the fields that are in the array, remove the (!) from the condition if (!in_array($f->name, $myfields)){ $form->append($f); } } } // Else, include all the fields else { $form->append($fields); } // Add save button $field = $this->modules->get('InputfieldSubmit'); $field->attr('id+name', 'submit_save'); $field->attr('value', 'Save'); $field->label = "submit herei"; $form->append($field); // Process the form // (code replaced by a new one provided by Ryan) if($input->post->submit_save) { $form->processInput($input->post); if(!$form->getErrors()) { $mypage->of(false); // turn off output formatting before setting values foreach($mypage->fields as $f) { $mypage->set($f->name, $form->get($f->name)->value); } } } include("./head.inc"); // Render the form echo $form->render(); include("./foot.inc");
  5. diogo

    Avoine.fi

    I like it very much, good work! Avoine sounds like a nice company to work with (and to work in), and the site reflects it.
  6. store the page in a variable, and get the image only later: $randomPage = $pages->get("template=artworks-child, sort=random"); $image = $randomPage->artworks_thumb->getRandom(); $thumb = $image->size(550, 0); echo "<a href='{$randomPage->url}'><img src='{$thumb->url}'></a>";
  7. Bem-vindo ao fórum jedi I also think so, but it's certainly not the rule that has been applied to other PT translated applications. Take Drupal for instance: http://localize.drupal.org/node/664 I personally don't agree that everything has to be translated like they say, because it leads to confusion among developers that are used to the English terms (that's maybe all of them)... but should we just ignore what all the main applications are doing concerning this? We also have to establish where is the limit... would you translate "tab"? what about the verb "to link", it would be "ligar" or "linkar"? I don't know any Portuguese developer that would say "ligar", but, unlike "clicar, "linkar" simply doesn't exist on the dictionary ("lincar" looks strange)... I don't have time right now to complete, or change the PT translation, but I'm planning to review all of it based on these discussions. Any help is welcome
  8. There is an interesting discussion about this subject here: http://processwire.c...ic-permissions/ I think it would be nice to define a kind of per-page access by creating rules on the template access control... I will explain: Take this example http://processwire.c...on-per-userpage to create a possible scenario. We want user-x to only have access to page with same name "user-x", and all it's children. home -users --user-x ---page-x-1 ---page-x-2 --user-y ---page-y-1 ---page-y-2 Would be nice to be able to define some kind of rule on the access control of templates. In my example, we could define on the "user" template something like this. $user->name === $page->name I guess it would be possible to build a module that would hook into PageList and look if a page as a rule defined in the template before outputting it to the list. Edit: I attached a screenshot of how this could look like in the template editing. PS: just discovered that the developer tools in chrome (i guess firebug also) are much better than photoshop for these kind of mockups
  9. I have another simple request for the default theme. I thought this would be a good place for it, Can the debugging accordion be changed to close when the opened tab bar is clicked? At least for me, it's more natural to close the tab, and choose a new one, than scrolling to the end of the info, and then choose a lower tab. edit: like on this one http://www.p51labs.com/accordion/
  10. It's much better. Hope you had some fun playing the kerning game edit: a good way of adjusting kerning is to semi close your eyes while looking at the word, and see if the white spaces are balanced.
  11. You can also fight the spaces with other frontend techniques. I think this article might help you http://css-tricks.com/fighting-the-space-between-inline-block-elements/
  12. Ok, good to know. Much better! But it still needs some spacing in the last half of the word. I'm seeing it like this: T-e-x-til-e... try to turn it into T-e-x-t-i-l-e instead. Sorry, with these things, Graphic Designers tend to get picky
  13. Soma, I don't think raphaël can fix SVG when used like this <img src="logo.svg" /> (netcarver, sorry for the off topic conversation)
  14. In this case, I still think is more elegant an image than a bunch of spans in the markup. Even more elegant would be an SVG, but that's still not viable because of IE...
  15. Yep, that's the problem. Move all the content from this 'site' directory one level up, to the 'site-ajsdecorator' directory, and it should be fine.
  16. Ryan, I made a question on this thread that belongs better to this one.
  17. Still, it does look like the problem must be here. Somehow, the config is not pointing to the correct folder. This would be a consequence of the first problem. If PW doesn't know the way to the folder, it can't put any log there. You said you set up 'site-foldername', that must be the problem. The folder must be called 'site-something', 'site-' must be part of the folder name. Do you have it like this? EDIT: I even tested removing the "site-" part of the folder and also on the config, and it still works (@Ryan, is there any special reason for requiring this on the instructions? Or is it just for organizational purposes?)
  18. I also have multisite installed in my server, and did a small test now. I was able to reproduce the message you get on the browser "Error Exception: DB connect error 2005 - Unknown MySQL server host 'Config' (1) (in /srv/www/diogoo.com/public_html/wire/core/ProcessWire.php line 95)" by mistyping the name of the subsite folder on the "index.config.php" file. make sure that you have it like this: 'domain.com' => 'folder-name', the folder name should be something like "site-whatever" EDIT: I suspect the error log is older than this. Can you check the date?
  19. Apparently your db host is not well set in the config.php file. You have it set to "Config"?
  20. Here are three resources. I didn't test any of them yet: kerning.js lettering.js kern.js But in this case, wouldn't it make sense to just use a png?
  21. I like it! The kernings from the logo need some love
×
×
  • Create New...