Jump to content

tiagoroldao

Members
  • Posts

    46
  • Joined

  • Last visited

Everything posted by tiagoroldao

  1. Very nice! I would only replace the 4 stripes symbol for pages with children with an arrow, maybe, to make it clearer that it is expandable.
  2. It seems a bit biased towards Foundation, this one... It's not that the author doesn't try to be objective, but the comparison seems at times to be between BS2 (and not BS3) and Foundation... For instance - BS3 is mobile-first. And it isn't just an add-on they glued to the 3rd installment, it is the main reason for v3 (and for how long it took). Also, the article implies that while BS3 has forceful fixed-width columns, Foundation doesn't, when it is the other way around - while BS3 gives you the choice between fluid and fixed rows (being that both respond to the same breaking points), with Foundation there is no fixed-width row option. It is relatively easily implementable but still.. --EDIT-- Only after writing this did I notice "Updated to Foundation 5 and Bootstrap 3" - Being that this was probably a comparison between older versions (and being that BS3 was a complete overhaul), it explains the biases I noticed...
  3. onjegolders: Bootstrap 3 levels the playing field on the grid thing - before I'd totally have to agree (even using bootstrap over Foundation). On these new versions, they are pretty much on par with one another - though I find Bootstrap (and specially Bootstrap 3) to be friendlier with 3rd party scripts and the like..
  4. It seems too much of a case-to-case thing here - if I was to use a "tag" Template, for instance, that had no template file (as I many times do, as I handle tag/date/search based page viewing on a parent template, generally), it would be terrible to have something like this enforced. If a flag is what is needed, a global boolean value would do the trick. But assuming any $pages->find() would not return file-less pages seems to me to do more harm than good.
  5. Well, yeoman is a pure client-side stack, meaning it isn't made for backend programming at all. It is pure JS. What I did was set up two distinct projects for the frontend and the backend, respectively: I set up my PW templates as RESTish servicessingle php file with GET based logic for simple items php file + same name folder of related assets if it is something more complex And my UI as a yeoman project, that exports to templates/ui Then linking the two is just a matter of calling it in home.php: <?php include("./ui/index.html");?> Remember, yeoman is strictly frontend, and in general only caters to single-page-app type projects. But for that scenario, it is amazing!
  6. Damn you, american projects that don't ship abroad!
  7. Ok, so I forgot to do the obvious, and test the original problem. (I never used repeaters much)... Why do you say repeaters can't have page fields? I just tested is and it works fine! (screenshot to follow, my dropbox is acting out...) eheh... What Apeisa said!
  8. Simple change in the InputField (InputfieldURL.module): public function ___render() { $rootUrl = $this->config->urls->root; if($this->addRoot && !$this->noRelative && !$this->notes && strlen($rootUrl) > 1) { $this->notes = sprintf($this->_("Start local URLs with \"/\" and leave off the \"%s\" part."), $rootUrl); // Instruction for local URLs displayed when site is running from a subdirectory } $out = "\n<input " . $this->getAttributesString() . " />"; $value = $this->getAttribute("value"); if(!is_null($value) && $value !== ""){ $out .="<p class='notes'>WebSite <a target='_blank' href='".$value."'>here</a>.</p>"; } return $out; } renders as: I had never thought of this, although there have been times where this would have been beneficial. This seems something worthy of adding to the core (maybe not done in 2 minutes like mine )
  9. You could allow for each sub-page to have "team role" pages as children pages. These would have a role (either by using a simple text field like their title or a page field) and a multiple page field of users. So: AboutArea PageRole page (title: "senior" or "role" page field set to a the "senior" page) with list of users in a page field Other Role page Alternatively, you could use something similar to the any role system, but regarding roles in different Areas. So you would have: AboutArea PageRole page Other Role page And Another And each user would have a page field allowing for "Area_role" type pages. This would be better to give users control, but not to manage the roles. Hope these are of any help/inspiration.
  10. The problem is that double spaces in html are meaningless - they are ignored completely. With good reason too - if whitespace in html code had meaning, you couldn't indent elements without impacting on the end result. Explanation here: http://stackoverflow.com/questions/433493/why-do-multiple-spaces-in-an-html-file-show-up-as-single-spaces-in-the-browser Why do you need to keep double spaces (without conversion to the html entity)? --EDIT-- Untested, but try something like this: <?php /** * If it works, Copyright Tiago Roldao * If it doesn't, I have no idea who made this */ class NonBreakingSpaceRemover extends Textformatter { public static function getModuleInfo() { return array( 'title' => 'Non Breaking Space Remover', 'version' => 100, 'summary' => "Converts html non breaking spaces back to normal spaces. ", ); } public function format(&$str) { $str = trim($str); if(!strlen($str)) return; $str = $value.preg_replace('/ /', ' '); } } Install it as a module, try it out, change it if it doesn't work. Again, completely untested, but a simple variant of the Newlines to List Textformatter, so it should work fine
  11. I never had troubles with any lack of examples (and to be honest, the forum is incredibly useful, which is very rare...) but I came across PW with some experience in php programming already, and didn't need them that much. But... Being mostly a Javascript dev these days, I came to like the concept of the cookbook which is popular in JS frameworks and such. Basically step-by-step development guides for basic or typical things (like the guide to doing the buildings site, or a guide to doing a custom field, module, or hook...) It could be a nice introductory step, actually.
  12. You could absolutely do a repeater, with the image field restricted to one image (so that each image corresponds to one text field in the repeater). But this problem has been tackled very well by Ryan, here: http://processwire.com/talk/topic/417-extending-image-field/ Also, I've been given this suggestion some time ago, and it has been very useful: the forum search engine isn't the greatest, but if you search in google, with something like "my search site:processwire.com" it can be a whole lot better
  13. Yes, I solved it with: $pages->find("parent=$page, tags=$tag, limit=1, start=0")->count() The "start=0" was just to make sure it went well, as PW 2.3, as far as I know, doesn't paginate queries with limit=1. I don't think that's it. But I may be looking at it wrong: Shouldn't $pages->count() not be paginated? And I find it strange that this scenario occurs: If I have 100 pages spread out across 10 pages, 50 "a's" and 50 "b's", and do a $pages->count("parent=theParentOfThe100Pages, tags=a") in one of the 10 pagination pages, if there is at least one "a" page, the $pages->count() returns 50, but if there is no "a" page in this particular set of 10, $pages->count() returns 0. One extra question: If all queries are paginated, imagining I'm in /page10 of the pagination, showing pages 91~100 of my list. If I were to do a $pages->find() on an unrelated group of pages, using the same limit=10, but on a group of pages with 50 pages (effectively having 5 pages of results), what would happen? would the result be an empty array, from page6 onward?
  14. I'm still concerned about this - I solved my problem, but I still consider the original issue to be a probably fixable bug.. Where should I submit it?
  15. Thanks for the reply I've simplified the markup for illustration purposes, yeah There is a difference between $pageArray->count() and $pages->count("selector") - for my purposes, $pageArray->count() and $pageArray->getTotal() are functionally the same, and they both work. The issue is with $pages->count("selector"), that works as a getTotal() call, without the need to actually return the array of pages (and thus, getting less overhead). But it seems to bug out in this instance.
  16. It's possible that I'm missing something, but I think I have found an small bug. I am doing a simple page list template (/photos) that is paginated and has url segments on, to allow for filtering through tags. As there are multiple different lists, and they all share the same tags, I need to list the tags that are relevant to this particular list (i.e. the tags that are in any of the list's pages). I attempted: foreach ($pages->get("/tags")->children() as $key => $tag) { if($pages->count("parent=$page, tags=$tag") > 0){ echo "<li><a href='$page->url$tag->name' $active>$tag->title</a></li>"; } } And it seemed to work... BUT it broke on my final page (on page 3 of a 3 page pagination). After doing some testing, I found that this selector, when using pagination, correctly counts all the pages that have the given tag, only if there is at least one in the current page. So: If tag A is in 10 pages, and in the current pagination segment there are any of them, the selector returns 10, as expected If tag B is in another 10 pages, but none of them are in the current pagination segment, the selector returns 0. If I change the selector to address all pages, removing the parent selector, the problem goes away but:Any parent selector pointing to the current parent (being paginated) break this, be it $page, $page->id, or the url or id entered manually The problem occurs without any url segments actually being used. Haven't tested thoroughly enough to be able to tell if it has the same behaviour with url Segments set (i.e. on a tag-filtered subselection of the pages) This was using a page field with multiple pages (as it was for tags) I solved the problem using: foreach ($pages->get("/tags")->children() as $key => $tag) { if($pages->find("parent=$page, tags=$tag")->count() > 0){ echo "<li><a href='$page->url$tag->name' $active>$tag->title</a></li>"; } } Which works well. I can only think of this as a bug, but I may be missing something.
  17. I would normally agree with @onjegolders, and I don't care much for slanting the type, changing from regular to Oblicua versions of the typeface, but having tested in chrome & firefox OSX, and ie9, it had no influence on element flow (probably because the types are the same - maybe prepared for this type of situation?)
  18. Nice one, simple. Also not a fan of the color scheme, but then again, I'm not the target audience My 2 cents - changing the language takes me back to the main page, and not to the translated version of whatever page I'm on. It's a small but many times important difference (specially when receiving a shared link, for instance). I don't know if you are using the language localized URL module, or creating two sets of pages - I hope it is the former, not the latter. If you are using the module, it is a simple matter of getting the page's url in the given language. If there are two sets of pages, it may be harder.
  19. This website is a very intentional misuse of technologies and tools. You are right that it could be done differently, in a easier and more effective manner.. By the way, for websites like this, I generally use isolated templates that create the html snippets for a postcard/blog post div, etc, and call them both within the "main views" (from the backend) and from AJAX calls, so you get a populated page when you land, using the same templates that serve AJAX requests. The thing is, this is an excuse to work with angularJS, which I use on a daily basis for what it is intended - full blown web apps. This way, I can tryout things like animation management (that are in beta testing stage), or different scaffolding schemes... All things that in my main projects, have little or no space. As an added "perk" I have these terrible issues of using it for things it was not meant to. Sure, in this specific instance, it is just plain dumb but they are issues that may arise in contexts where angJS is a requirement, and have to be resolved somehow. Things like SEO, navigation, url mapping, that would make me immediately choose a different strategy, are unfortunately things that on other contexts, can't be avoided. FYI, typical things I do with angularJS: GUI for a teacher performance evaluation app, where teachers can present their performance data (subjects given, papers written, etc) A line management UI (where you pick a numbered ticket and wait for your turn) - specifically the "frontend", with animations, a video box, and RSS feeds A form editor UI for the faculty to use (as there were a number of functions lacking in the available, commercial or open source solutions, such as a complex field dependency sistem (field or field group C appears if field B is x and/or field A is between x and y....)
  20. Thanks, @nfil! You are right - the content starts too far down. This is a requirement, as it stands, as the postcards go up when clicked (it simplifies the animations and positioning (divs get higher and higher z-indexes further down, and going up is a sure-fire way to have it stand on top. Ideally, they would open to their original position (something like going up and then back down, on top of everything else). This is one of the top items of a very, very optimistic list Although I have chosen to completely ignore caching/SEO problems (it is a completely js-driven website), one thing the website needs (or will need, soon enough, with a growing number of posts) is urls patters mapped to folders and/or postcards, so they can be shared and accessed.
  21. Just to throw a little stone in the pond: I know it is possible to define FieldTypes and InputFields and with that create our own hooks and validations.. Would it be reasonable to consider simplifying this approach? Allowing an core FieldType/InputField to be augmented by something like a specialized module (or even code added through a field) at the Field definition level?
  22. Thanks! Regarding 1) I already have the count loaded with each tab, but haven't figured out how to show the tops (the border color, for instance, is loaded after opening, so it only shows upon opening). As for 2) I have a timeout that starts on open and cancels on close (so as to not load all the pictures for the postcards you just browse through, via the arrows). It is currently 3 seconds long, and I've noticed that it is too much...
  23. More and more, processwire has become my personal haven... I do almost no commercial work with it (I work as a dev, and for payed side-projects I suffer the dread of joomla droppings ) Made this "thing": - http://www.lisboncorrespondent.com/ This is a blog (of sorts) for my father, with make-pretend postcards sent from Portugal. It is essentially a way for me to experiment with and learn a few techs/tools: css 3d transforms (and respective headaches, cross-browser issues, etc) The wonderful angularJS framework Yeoman (build system for js apps, with grunt + bower) Processwire, of course Processwire is amazing for every crazy thing I may ever think up, and using it as a simple RESTy service provider is incredibly simple. Gotchas: This will most likely be a perma-beta site - it is for trying stuff No history back/forward or direct urls - angularJS makes it easy, but it wasn't really my concern. Will have to happen someday, though No SEO whatsoever - I'm perfectly aware that a "blog" in a one page app is a no-no, but again, just toying around Tested with Chrome, Firefox and IE 10, OSX and Win - further compatibility (and mobile) to come Hope you enjoy. And thank you, Ryan, for the wonderful gift of processwire
  24. Thank you! Unfortunately my work ended with the implementation of the website. The copywriting and managing are beyond me.. and terrible Also, why is the "facebook" link pointing to the homepage? We will never know.
×
×
  • Create New...