Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/04/2013 in all areas

  1. Just another one finished. Cygal - Art Deco furniture Big amount of images, a lot of different templates and responsive of course. Not my taste regarding the furniture but as long the client has good images...
    7 points
  2. Now you've got me confused. I think there's an error in your logic that can't be solved - not with a generic solution anyway. At first you said: And then later on: So, you'd like "harry" to return all pages with "harry" in any of your search fields. This could be interpreted as one of the following: give pages with all words in any of the search fields ​$ret = find("title|author*=$q") // exact phrase actually, but #1 isn't the right one anyway OR give pages with any of the words in any of the search fields $ret = find("title|author*=" . str_replace(" ", "|", $q)); // first solution by diogo OR give pages with at least one of the words in all of the search fields (not necessarily the same word matching all the fields) $q = str_replace(" ", "|", $q); $ret = $pages->find("author*=$q, title*=$q"); // what I proposed earlier Now, if I've understood you right, making a search "rowling potter": should not give all pages with "rowling potter" in any of the search fields (#1) should not give all pages with either "rowling" or "potter" in any of the search fields (#2) should not require "rowling" or "potter" in all of the search fields (#3). Instead, you'd want it to give, hmm, all pages with one of the words matching the title and another one matching the author, unless there aren't any when it should give all pages matching any of the words in any field - or something like that. And we're talking about two words and two fields in this example, while your code example mentions actually four fields already. Looks like an impossible job for a generic selector/code solution. Now looking again what Wanze said I feel like he's been right all along: if you need anything more than a trivial match (one of #1..#3 given above), your only option may well be multiple search fields. One for each search field you need to handle in a special way that is. Then the search would be for example author:"rowling", title:"potter" and you could even give an option to choose whether AND or OR should be used (author: "rowling" AND title:"potter" <--> author:"rowling" OR title:"potter"). Now you actually could build a generic handler. Multiple fields lets the user define more precisely what they're after but then again they also require the user to understand which field to use for different searches. Maybe a generic search field + solution #2 for those who just want to find what they're looking for and an advanced search for those who need to refine their search to get only the results they're really after? If there's lots of data and giving some extra matches along with the exact ones (#2) really is a problem, then an advanced search could be the way to go. My personal preference is one single search field giving properly ranked results instead of a monstrous hard-to-fill form maybe giving me only the one match I'm after, but I see there's a place for the latter as well. Sorry for the (too) long post. I got a little carried away.
    5 points
  3. Here is our website using ProcessWire, still work in progress: http://www.mokkivertailu.fi/ The site is a search engine for rental cottages in Finland. Cottage owners can register and add their information while users can search and browse the database.
    2 points
  4. This is a bit more complex but works really well (for pw dev version): Create one custom template without fields following my module's instructions and paste this code in the template's file: <dl class="nav"> <?php foreach($page->children as $child) { echo '<dt><a class="label" href="'.$child->url.'">'.$child->title.'</a></dt>'; echo '<dd>'.$child->headline.'</dd>'; }?> </dl> Create a second custom template with the fields "querystring" and "headline" (give them the name you want, but update them in the code above), and paste this code in the template's file (if changed, update "querystring" to the real name of the field) <?php if(!$input->get->q) $session->redirect($page->url.$page->querystring); $page->process = "ProcessPageSearch"; require($config->paths->adminTemplates . 'controller.php'); Create a page under "Admin" and give it the first template. This will list all the children pages of that page using the info from the above fields of each. Create some pages under this page and give them the second template. Copy the query strings (including the "?") from the search pages that you want to recreate and paste them in the querystring field of these children pages. Don't forget that you can remove the sidebar by deleting "show_options=1". Maybe you will also want to update the "children" tab of the first template to accept only pages with the second template as children.
    2 points
  5. There's a 'more' link at the bottom of a paginated list to load more children.
    2 points
  6. Greetings, One other point to make here, which I hope would make the client think very carefully... It's far more difficult to re-make a site than to make it right the first time. I always emphasize just how frustrating it is to take a site from Joomla to another proper system like ProcessWire after it has already been built up significantly. Earlier this year, I moved a large site from Joomla to ProcessWire, replicating existing plugin functionality and data, and it was a horror. Right now, I am working on a project where the client has an existing Joomla site, but they let me start with a clean slate in ProcessWire. The second one is developing far more rapidly, even though it appears to be more work to start over from scratch. Making this kind of "do it right the first time" argument can be a good entry point to your discussion with the client, for two reasons: 1. The client's natural follow-up question will be, "Why would it be a mistake to use Joomla?" That gives you an opening to explain the specifics. 2. You can argue on the level of time, money, and efficiency -- rather than preference. Just some more thoughts to consider. Again, more specifics about the project can help! Thanks, Matthew
    2 points
  7. Great work! A perfect example case for ProcessWire: rich content, fast performance, multilingual, fully editable.
    2 points
  8. We've got something on the roadmap for providing this alternate view into pages. I think there are a lot of situations where it will be helpful. For instance, seeing a list of the most recently updated pages, regardless of where they are in the site structure. Or viewing all unpublished pages (like you indicated), or viewing all pages that match a given selector, or have a specified field, etc. The list goes on. So just wanted to let you know this is part of the plan. It will be an alternate tab off of the Page List view, where you can choose that channel-type view when it suits your needs better than the map view.
    2 points
  9. Create custom admin pages easily without having to build a Process Module especially for that. ☞ This module makes it easy to create simple admin pages but you can also create them in much more powerfull way without the need of a module. Have a look at this post written by Bernhard Baumrock to know how it's done https://processwire.com/blog/posts/building-custom-admin-pages-with-process-modules/ ------- I just updated the module, I kind of merged the two versions and now it works with both stable and dev versions of PW. Only difference is that with the stable version you still need to create the child pages and with dev version that is not needed. The instructions are on Github. Enjoy ---- Download or clone from Github https://github.com/ocorreiododiogo/pw-admin-custom-pages Module page is here http://modules.processwire.com/modules/process-admin-custom-pages/
    1 point
  10. I found (after 2-3 Projects using PW) that it's a good technique to use templates in a way I think hasn't been thought of yet really by some. (Although the CMS we use at work for year, works this way.) I'm sure I'm maybe wrong and someone else is already doing something similar. But I wanted to share this for everybody, just to show alternative way of using the brillant system that PW is. Delegate Template approach I tend to do a setup like this: - I create a main.php with the main html markup, no includes. So the whole html structure is there. - I then create page templates in PW without a file associated. I just name them let's say: basic-page, blog-entry, news-entry... but there's no basic-page.php actually. - Then after creating the template I make it use the "main" as alternative under "Advanced" settings tab. So it's using the main.php as the template file. - This allows to use all templates having the same php master template "main.php" - Then I create a folder and call it something like "/site/templates/view/", in which I create the inc files for the different template types. So there would be a basic-page.inc, blog-entry.inc ... - Then in the main.php template file I use following code to delegate what .inc should be included depending on the name of the template the page requested has. Using the TemplateFile functions you can use the render method, and assign variables to give to the inc explicitly, or you could also use just regular php include() technic. <?php /* * template views depending on template name * using TemplateFile method of PW */ // delegate render view template file // all page templates use "main.php" as alternative template file if( $page->template ) { $t = new TemplateFile($config->paths->templates . "view/{$page->template}.inc"); //$t->set("arr1", $somevar); echo $t->render(); } <?php /* * template views depending on template name * using regular php include */ if( $page->template ) { include($config->paths->templates . "view/{$page->template}.inc"); } I chosen this approach mainly because I hate splitting up the "main" template with head.inc and foot.inc etc. although I was also using this quite a lot, I like the delegate approach better. Having only one main.php which contains the complete html structure makes it easier for me to see/control whats going on. Hope this will be useful to someone. Cheers
    1 point
  11. Maybe it makes sense to expand the search process to allow keeping common searches as links that you can use on the search page and even pass to other pages. Meanwhile you can achieve something like this quite easily. Just use the search page and adjust the searches until you get the results that you want. Then copy the url of the results pages and create an admin page with those links. You can adjust the links further by refining the url, remove "&show_options=1" for instance, or turn it to 0, and the sidebar will be hidden. For creating the links page I would suggest using my admin custom pages module () with this code that will style nicely in the admin: <dl class="nav"> <dt><a class="label" href="link">all pages with X template</a></dt> <dd>See all posts</dd> <dt><a class="label" href="link">all pages with tag y</a></dt> <dd>See all posts with tag y</dd> <dt><a class="label" href="link">whatever else you want</a></dt> <dd>Do whatever</dd> </dl> You can also add some fields to the template. A repeater where you paste the links, for instance, and change the code to something like: <dl class="nav"> <?php foreach($page->searches as $search) { echo '<dt><a class="label" href="'.$search->link.'">'.$search->title.'</a></dt>'; echo '<dd>'.$search->description.'</dd>'; }?> </dl>
    1 point
  12. Hi! I have found some mistakes on your site in russian. 1. In the main menu you need to change "Чаевые" to "Советы" (multiple meanings of the word, "чаевые" - this is what you give to the waiter) 2. H1 home-top-header - change "коттеджей в Финляндии" to "Коттеджи в Финляндии" 3. In the first selectbox "целая Финляндия" to "Вся Финляндия" 4. Main menu "Add your cottage" will be "Добавьте свой коттедж" or "Добавить коттедж" If I find more, I'll let you know.
    1 point
  13. Your second screenshot shows the same distorted "e" in "Seiten" I get with my Firefox and Chrome. I don't know why your Firefox renders it differently compared to mine. However one thing that messes this up is definitely Window's ClearType. Turn it off and particular the Arimo font looks partly better but also partly worse (in Windows Chrome browser). By no means turn off ClearType permanently. But this proves that there is an annoying flaw in Window's own smoothing algorithm. I couldn't find any solution yet. Some people suggest using FontSquirrel's webfont generator but the results still look quite ugly. EDIT: Ok, I found out that the different rendering in Manfred's Firefox is the result of hardware acceleration. My acceleration option is turned off because of some graphics card bugs, but If you turn it on Firefox uses DirectWrite for font rendering. DirectWrite + ClearType does a bit better job than GDI + ClearType.
    1 point
  14. Using the latest dev branch, it still renders badly on Windows in Chrome and FF (but FF being the better of the two), particularly the bold sections. If the CSS is changed so that the SVG file is referenced before the others (I think this was mentioned/linked to earlier in this thread) then Chrome handles it a bit better; but with the side effect of the text not quite as clear as it should be. See the screenshot attached. On the left is the "Edit" page with the SVG font reference at the top in the CSS, and on the right is the same page, but with all of the webfont references removed from the top of the CSS - falling back to the default system fonts. In my opinion, there's nothing wrong with Arial, Helvetica, Sans-serif CSS example: @font-face { font-family: 'Arimo'; src: url("fonts/Arimo-Regular.eot"); src: url("fonts/Arimo-Regular.svg#Arimo") format("svg"), url("fonts/Arimo-Regular.eot?#iefix") format("embedded-opentype"), url("fonts/Arimo-Regular.woff") format("woff"), url("fonts/Arimo-Regular.ttf") format("truetype"); font-weight: normal; font-style: normal; }
    1 point
  15. This should do it: ^(?:0?[0-9]|1[0-2]):[0-5][0-9] [ap]m$
    1 point
  16. How about using text field and simple pattern to keep it like date? If you put this into pattern setting of your textfield: [0-9]{1,2}:[0-9]{2} it will only allow values like 9:15, 14:20 etc... Of course that regexp could be tweaked to US friendly if pm / am etc are needed. I find all the timepickers clumsy compared to clear and simple text input. Oh, and if data needs to be 100% valid, then this is no good of course, since this allows values like 99:99. Regexp could be tweaked though...
    1 point
  17. @fokke & @totoff I suspect rounding issues are the cause - the problem only appears at certain widths, so far as I can tell. (Doesn't detract from an excellent site, even so. )
    1 point
  18. I would say that lots of us are running the dev version for production websites. Key thing is to check that all the functionality you need is working fine, especially any multi-language features as there have been some recent changes there. If it all works as expected, go for it
    1 point
  19. In defense of totoff, he did say this: Edit: Still, there is Open Source and Open Source, the fact that a project is Open Source doesn't mean that it should be immune to criticism. There's no doubt that the fact that some big Open Source projects are so widely used hurts the growth of smaller and much more competent projects, and comparisons should be made to combat this, and also to make those projects be aware that they can't stop getting better. Those are my two cents...
    1 point
  20. Since you are comfortable with using the MVC pattern, this may be the way you want to go in ProcessWire too. ProcessWire is very much supportive of the MVC pattern, it's just that it doesn't require it. ProcessWire is providing your models, your template files provide your controllers, and you provide the views with the TemplateFile class (or some other view loader of your own if preferred). You can also choose to target some template files/pages as views and call $page->render() on them. If you are interested, the Blog profile does use an MVC-style approach and would be worth looking at. But after you spend some time with ProcessWire, I recommend finding the approach that best suits a particular situation rather than locking yourself down to using the same one all the time. ProcessWire is giving you a lot more in some areas than a typical MVC framework does, so you may find even faster and more maintainable ways to structure your code, depending on the situation.
    1 point
  21. I added this to the dev branch last week, so that you can now pass additional things to $page->render(): https://github.com/ryancramerdesign/ProcessWire/blob/dev/wire/modules/PageRender.module#L212 One of the things I wasn't thinking about before is that $page->render() was already capable of accepting an array of options (though not commonly used, mostly internal). So we weren't starting from a blank slate, and had to make something that was compatible and complimentary to what was already there. In terms of API calls, you can now do any of these: $page->render($filename); // $filename assumed in /site/templates/ $page->render($pathname); // $pathname is full path, but must resolve somewhere in web root $page->render($options); // array of options and/or your own variables $page->render(array('foo' => 'bar')); // same as above $page->render($filename, $options); // specify filename and options/vars, etc. The $options variable was already something that $page->render() accepted before. Only it was used to specify some little-used modifiers to render(). Those are still there (and they are necessary), but now the utility of $options has been extended. When you want to specify options (outlined in the link above) you only need to specify the ones you want to change from the defaults (of course). Typically you don't need to change them, so I'm guessing that most would use $options to specify their own variables. Every rendered template now receives a copy of that $options array locally scoped. That $options array contains any variables you passed to $page->render(). It also contains PW's default options, should you want to examine any of them. If you made this render() call: echo $page->render('myfile.php', array('foo' => 'bar')); myfile.php could access the 'foo' variable like this: echo $options['foo']; // outputs "bar" One other addition that I'm thinking people might like is $options['pageStack']. That is an array containing a stack of pages that called render(). So if you are doing any recursive rendering of pages, any template can access $options['pageStack'] to see what page is rendering it, and any others before it. Previously this was not possible, and the only way a template could tell what other page was rendering it (if any) was for that renderer to tell the renderee, via $mypage->caller = $page; or something like that.
    1 point
  22. Well.. I think one thing why people lean on frameworks (at least I do) is that when framework is strict and well documented - it is nice to code knowing "I am doing this in a way it is intended". Things like "Because I use this DB class from this framework, it does take care of this and that security issue". So when you are not that seasoned developer, it is nice to have something to guide you. I think pretty similar use case is when company uses one framework to get coding standards from framework. Since PW is pretty open and non-strict (and should be), I guess many people are looking for "best standards". Partly this is probably because we are used to "this is how you should do thing X when using framework Y" - and PW answer usually is: "Well, since we are using PHP here, you can do that in many ways." But to answer more directly to your question Ryan: what I have used and found beneficial over the time on frameworks I have used: forms, input validation, file uploads, pagination, cache, authentication... I think pw already has pretty good balance on this and I haven't had need to use any other frameworks or helpers when using pw, so probably best answers comes from people who have used flourish and pw for example. But maybe validation class is something I would like to see in PW.
    1 point
  23. Considering that Processwire is a framework itself, in my humble opinion the most beneficial way would be to use PW with decoupled framework that can be used as a component library as well, so one could pick and choose useful components without the need to load the whole framework. So my choice would probably be somewhere among Symfony2, Zend and Flourish (though nobody prevents from using all of them). The problem is that when different components get involved, the coding style becomes less unified and readable. What do you, guys, think? Would be really cool to get a couple of tips here. Edit: onjegolders, also look at this article.
    1 point
  24. Don't worry about lack of time or resources - I personally use ProcessWire on all my client projects, so it's something I've been working on steadily for many years and will continue to. My business depends on it! Sometimes I get blocks of time where I can focus on it a lot, and other times I have to focus more on my client projects, but PW always moves forward because I use it almost all day every day. Though something I'd like to be able to do is less client work and more ProcessWire work. One thought that crossed my mind is to maintain another version called ProcessWire Pro (or something like that) that would basically be the same but include faster support by e-mail and several of my modules that I use in commercial projects. It might also include a separate support board geared for your clients, so they would also have a support resource should they ever need/want it. I was thinking something like this might appeal to the EE crowd that is looking for the guaranteed support and services beyond the typical open source project. The audience here would be the web designer/developer that does this for a living and wants something extra that they can't currently get from PW or other open source projects. But that in turn would help to open up more time for the project as a whole. Not everyone needs or wants this, but it might be nice to offer it for those that do.
    1 point
  25. I will put some thought into this and come up with a more official roadmap to place on the site. Thanks, Ryan
    1 point
×
×
  • Create New...