-
Posts
16,772 -
Joined
-
Last visited
-
Days Won
1,530
Everything posted by ryan
-
I'd probably go for the 27" iMac too. It would just make everything feel better as it's kind of like adding a work of art to the room. A 15" Macbook Pro with Retina screen might also be worth considering. I use a 2008 Mac Pro with 30-inch + 24-inch Dell screens. The main benefit of the Mac Pro is that it's extremely upgradable and lets you get another few years out of the system that you might not be able to get out of Apple's other offerings. But I wish Apple was continuing to update the MacPro line more consistently, as the one they are selling today (4 years later) is not that much different than the one I have. it's kind of hard to justify a Mac Pro now. But I think this system will keep me going for another 2-3 years. If Apple ever puts a retina screen in the iMac at a good price point (as I'm guessing they will), that would be ideal.
-
New things get added too. Once 2.3 is out, I'm going to try and go through everything and track down what new stuff should be added to the docs and cheatsheet. I think eq() has been there since the beginning, though it's admittedly one I don't use often (easy to forget it's there).
-
10 hours to go here in the US (Eastern). Happy new year everybody!
-
I'm not sure what it could be, as I've not seen that before. But I'm wondering if a PHP cache (APC, eAccelerator, etc.) might have been interfering here?
-
Not sure, but I'll check in to it next time I'm working with the files/images inputfields. It is relatively easy to do from the API though, as you can call $page->images->removeAll(); for example.
-
Something else good to say about ServInt is that they've been routinely upgrading the capabilities of their existing accounts over time, without asking for more money. In my case I have an Essential VPS account I bought with them years and years ago. The account doesn't stay at the specs you bought it at. If the capabilities of your plan gets upgraded for new/prospective customers, then it gets upgraded for you too. You don't even have to ask. It just happens and they let you know after the fact that "you now have an extra 10 gigs of space", for example. ServInt is good at keeping the customer happy in the long run. This is different from other hosts I've dealt with, and am currently dealing with. I've had a account with PowerVPS for as long as I've had one with ServInt. It's also been quite reliable, but it is configured identically to when I purchased it years ago. The ServInt one is now much more capable than the PowerVPS one, despite the fact that they started the same and cost the same. Now I am at the point where I'm looking to get rid of the PowerVPS one just because it's no longer competitive.
-
Sounds like something is not quite right with the MySQL you are running, whether it's version related or something missing from MySQL (fulltext index support?). I think the first error reveals everything that we need to know: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\'\', PRIMARY KEY (`pages_id`), KEY `data_exact` (`data`), FULLTEXT KEY `' at line 2 If that is failing, then something isn't right with the MySQL server. Let us know what version, or you can PM me a link to a phpinfo file. If this is occurring at some specific webhost (rather than your own computer), let us know of that too.
-
Not a problem, I can update this soon. Has anyone tried this version of TinyMCE with PW yet? Just wondering if there's anything to watch out for, or if this is a fairly clean update.
-
GET param modal not preserved after adding new page
ryan replied to teppo's topic in API & Templates
No problem, I have added this and it should appear on the dev branch on the next commit. -
ProcessWire Concatenate Fieldtype Fieldtype that concatenates the values from one or more other fields at runtime. The value can contain additional formatting and/or words as needed, which you define in your Concat field settings. Example Problem: Your system has a first_name and last_name field, and you want to have a separate full_name field composed of first_name and last_name, without redundancy. Solution: You would create a new Concat field, click the details tab, and enter "first_name last_name" (the fields you want to concatenate) in the settings. Other Potential Uses Having a field that combines the value of two or more others, without the redundancy of separately stored data. Defining a custom “label field” for select boxes, like those used with the Page field. Defining a custom label for your Page List that includes your own formatting. Defining an alternate variation of a text field that uses a different text formatter. Considerations The value for this fieldtype is generated at runtime and thus no data is stored in the database. This is good because there is no duplication. However, it also means that you cannot directly query a Concat field from $pages->find(), for example. If you happen to change the name of a field being used in a Concat field, you will have to update the name in your Concat field settings as well. By design, Concat fields do not inherit the text formatters of the fields they concatenate. You define these separately with the Concat field. Because this is a runtime-generated field, there is no Inputfield associated with it. How to Install Install the module by placing FieldtypeConcat.module in /site/modules/. Check for new modules on the Modules screen in the ProcessWire admin. Click Install for the Concat Fieldtype. How to Create a Concat Field Under Setup and Fields create a new field using type Concat. After entering the new field name and label, click Save. Click the Details tab and enter one or more field names. Separate them with whatever spacing and punctuation is appropriate. Optionally choose one or more Text Formatters. If you are not sure which, “HTML Entity Encoder” is a good default to use. Save. Add your new field to one or more Templates. How to access the value of a Concat field This is no different than accessing the value of any other field. If your Concat field has the name “full_name” then you would output its value like this: echo $page->full_name; Download PW Modules Site: http://modules.proce...eldtype-concat/ GitHub: https://github.com/r...FieldtypeConcat
- 47 replies
-
- 20
-
Thanks for sharing this with us, looks good! Please post to the modules directory (under the site profiles category) when ready. As a small, though not really necessary optimization, that big switch statement might convert nicely to something simpler: $names = array(null, 'one', 'two', 'three', 'four', ...and so on); $column[$key] = $names[$value];
-
I agree those will also be useful down the road. Though from this side, those are a little harder to break, so the more immediate need is a test suite for selectors. This is also needed to maintain consistency between selectors that result in DB queries, vs. selectors that occur in-memory. Because they are handled by two totally different things, this is a common point of inconsistency. They aren't even 100% consistent right now, but I'd like to aim for it, and tests are necessary prerequisite for this. Thanks! I'm not particularly experienced in this area either. But I think our needs for a test suite are different than those of traditional TDD. We need something like what you and I were originally working with, but taken a lot further. It needs to be a site profile built for the needs of running these tests. It would contain a diverse range of pages and fields, and the template file(s) would perform the tests, looking or anything unexpected. One thought is that we might build it on top of the existing skyscrapers profile since that already contains a good number of pages and fields, along with intelligible test cases to work with.
-
Exceptions are catchable, not hookable. I could probably add a hook to manually trigger in PW's main exception handler. Though if a DB exception occurs at bootstrap time (which is when you'd likely see it, if it occurred), then any modules wouldn't yet be loaded. This would also introduce the potential of infinite loops, like if any of the hooked functions themselves triggered an exception. It would be more likely to occur in this case (the last resort exception handler) since an exception at this point is a fatal error and means something about the system isn't working.
-
How to automatically create a bunch of child pages when saving?
ryan replied to titanium's topic in Module/Plugin Development
Change this: foreach($titles as $title) { if($page->children('title=' . $title)->count() !== 0) break; ... } to this: $children = $page->children("include=all"); foreach($titles as $title) { if($children->has("title=" . wire('sanitizer')->selectorValue($title))) continue; ... } That "include=all" in the children call ensures that the children are included even if in the trash. It's also better to just do one $page->children() call here, because every time you pass in a unique selector to children(...) it executes another query. This way, it's only executing one query. The wire('sanitizer') call isn't technically necessary for the page title's you've given, but I put that there just in case your actual page titles might contain commas in them. But honestly it would be better to use the page "name" property rather than title, since it is limited to a small set of characters, guaranteed to be unique for the parent, and more appropriate for this type of thing. If you use $page->name, you could optimize it further by changing the first line to: $children = $page->children("name=" . implode('|', $names)); You could do this with title too, like Pete was mentioning. But it's a little harder to account for the page titles in OR selectors since there is such a broad set of characters allowed in titles. -
The tooltip() is something that's part of the most recent jQuery UI versions. We're using the latest jQuery/jQuery UI in 2.3. I don't think that there is a tooltip() in the version of jQuery UI used by PW 2.2.
-
I am just as interested in the supercache as you guys, so will be continuing to work on it and hope to have this ready by the time 2.4 rolls out. 22ms vs 160ms -- I'm actually surprised the difference isn't greater. There is a lot more difference in what is actually happening then those numbers indicate. But there are also a ton of different things that can affect those numbers, so am thinking it depends where and when you test. If performance optimization is key, you want to make sure you are using a PHP cache like APC or eAccelerator, etc. You'll also want to use PW's built in template cache and MarkupCache where appropriate. Making sure that PHP has enough memory to do it's just and that MySQL is optimized for your traffic situation is also going to make a difference. A supercache can't be used on any page that needs to consider GET variables, session variables, cookies, randomization, etc., so it's not a substitute for a well tuned server. But it's a great addition either way.
-
What about it? Sorry, I have no idea what you mean, so am trying to determine if there is something I need to fix.
-
Antti is correct that it is assumed as the default template when you only allow one. If you select more than one, then it will allow any of them to be used, but will select a default for new pages based on whatever the last child used.
-
Another way to approach the modal option is to just add an extra class to your body tag when it detects modal: <body class="<?php if(input->get->modal) echo "modal"; ?>"> Then just hide the elements you don't want on the modal view: body.modal #sidebar { display: none; }
-
I think this makes sense to do it the way renobird suggested, with an asmSelect. It should be easy to do, so I've put this on my list for when I get back to the office.
-
Thanks Antti, I'll get this fixed here early next week. For now, replace filter("template=organization") with filter("template.name=organization");
-
Thanks for sending the database. This helped me to track it down quickly. The issue was that you've got a role named "edit". Because roles themselves are just pages in the tree, that name is overriding the URL segment "edit" used by the module that lets you edit roles. It's attempting to literally load the page living at URL roles/edit/ rather than the role editor. I will find a way to prevent these from getting mixed up in the future. But for now, your best bet is to either delete or rename your role that is currently named "edit". The way to do this is to go edit the role from your Page List tree, rather than from the Access tab. i.e. click Pages > Admin > Access > Roles > edit, in the Page List tree. Rename it from "edit" to "editor" or something else if you prefer.
-
Nico, one other minor point. I'm having a little trouble differentiating the numChildren quantities in the Page List from the page titles, just because the font and color appear to be the same between them (as in your first screenshot). As a result, I'd recommend a minor tweak of making the quantity number visually different in some way. Usually, I've just made this number appear a light grey to differentiate it.
-
I actually did something similar on one of those villa sites, so that I could randomly pull from pages having the highest quality images. I have a Pages::save hook that saves the average width of all the photos on the page to a hidden integer field. That way I can use $pages->find() to find villas with best image quality (or at least, largest images) and sort by that, etc. In your case, you might want to do the same thing, except store the height. If all the pages have the same number of images, then you could do combined height. If they are differing numbers of images, you'd probably want to do average.
-
Very nice Nico. I like how clean it is, and the background color relative to the white inputfield boxes is pretty. My first thought was "where are the breadcrumbs?", but then I figured out it was in the footer. It's a nice variation and actually looks great. Though I'm having a little trouble with it in Chrome just because Chrome uses that space to display live messages (loading type messages, etc), which initially masked that the breadcrumbs were there. Still it might just be a matter of getting used to it. But I'd probably find it more usable to have the breadcrumbs at the top rather than the bottom. I'm not suggesting you change it, because that's just subjective on my part. However, the one thing I ran into that you may want to change is the foreground color for when rolling over an asmSelect list (see attached screenshot). Also, please add to the modules directory when you get a chance. Thanks for the nice work here.