-
Posts
4,054 -
Joined
-
Last visited
-
Days Won
67
Everything posted by Pete
-
Hehe, it's easy to set a group policy to update computers but a bit more hassle to get it to install FF or Chrome and set it up as default browser. Not impossible I know, but just not got around to it yet.
-
I think they take time to build up a lot of bug fixes and release the next incremental version every month or so. Whilst I prefer PW's style of being able to download the latest version of the repo to get almost instant fixes I can see why they do it like that. I just hope the next version resolves some of these issues.
-
How long was the text on the post?
-
I might see if there's another editor option but I doubt there will be as it's not as easy as PW to change things like that. The editor can be turned off completely via your profile settings and you can use BBCode instead, but that's not an amazing option - might be better for people used to other types of editors though?
-
Well tough Smileys/emoticons are an easy fix - we can manually add conversions so they will work, though it is not standard to have a hyphen in them and I've used a lot of forum software - more standard without. Like I say though this can easily be solved by adding more variations in the admin so that is neither here nor there. Indentation is an annoying bug. It's on their list of things to fix. Seriously though? Neither of these are showstoppers and no software is perfect (apart from PW). Various editor improvements are coming in in v3.4 so I suspect a lot of the little quirks will be fixed then. It's interesting to note that the editor that you guys don't like is ckEditor (I think - might be TinyMCE even) but there are indeed quirks with their custom implementation. Compared to the previous software though I think it's a lot more useful overall. In summary, it would be a huge pain to switch again and the alternatives all have their own issues, bugs and drawbacks so I don't think either issue is enough to even consider it.
-
I've used closest() a few times rather than parent()->parent() repetitively, or if there was ever a chance the layout would change slightly on the page but I knew that somewhere back up the tree a particular element would always exist in relation to the current one. It probably wouldn't be used all that much in PW since another layer of pages would rarely be added between the current page and the parent page, but saying that I'm sure I've run into this before myself so it may as well go i and I'll try and find where I've seen that code where I needed to do something similar. A bit off topic, but ryan: have you at any point emailed anyone at jQuery about PW? I think they'd be interested in the concept
-
Should be fixed now I keep forgetting what that was like - now I'm in control of IT at my current job so have IE auto-updating every time a new version comes out (fortunately we don't run any legacy web apps).
-
That is odd - looks like IE8 is stacking the buttons over each other. Any chance you can upgrade to IE9 in the meantime? I realise that's not always possible in a corporate environment and doesn't fix the problem for other IE8 users. I might have a chance to look at it later if I can find a PC with IE8 or if my Virtual Windows machine still runs IE8. Cheers for the report though!
-
There's another parameter for PW's redirect function if you're using that in module code or a template to make it redirect with a 302 instead. Is it in a module or template that you're redirecting or are you talking about PW in general?
-
My thoughts are she's going to catch a cold not wearing any clothes. Site looks good though. If anyone's wondering before clicking on the link it falls under art and not the the other internet pastime.
-
I'm sure I read that you can't nest repeaters - someone else may be able to confirm that though.
-
Your timing is beginning to get spooky lately ryan as I may need this on a project as soon as tomorrow! Get out of my head!
-
A single "=" will only work in PW's selectors like $page->find('something=something') and so on - you must have double == to compare values in normal PHP as per the link I posted. Strange that that's not working either though, but a single "=" is definitely wrong. Just a thought - what is the expected value of $page->project_url? If it's just a text field then you might want to check it's not empty with if (!empty($page->project_url as it would exist whether empty or not, so simply doing if ($page->project_url would always be true I think. If on the other hand it is a Page fieldtype, then try if ($page->project_url->id instead.
-
In what way doesn't she like thumbnails? If she means that she would prefer a gallery to open with just the first image showing and controls to get to the next one then it's not too bad - the first image will load first and the others will load afterwards, meaning that the load time is irrelevant as long as the user sees that first image pretty much right away. Does that sound more or less like what she's after? The issue then is the one you've spotted already - there would be an SEO hit because of the total page load time. Just to get a bit more info on the layour, how would the category list be displayed? Is it a set of text based links that, when clicked, open up the relevant category of images? A solution if that is the case would be to somehow (all theoretical ) have it load a modal window via Ajax that fetches the first image and displays buttons to load the next image in that modal window, also via Ajax. You're then also into other tricky SEO territory as whilst Google is trying to follow what goes on with Ajax nowadays I'm not sure how good the support is yet. You'd certainly get quick page load times for this idea though, as it would load the first image when it's requested, as with every other image, though I couldn't guess how you'd go about linking together multiple Ajax modal contents off the top of my head - maybe not the most helpful suggestion As for better advice, my choice of lightbox is almost always FancyBox and it's also used in the PW admin. Version 2 is worth a look as it's newer.
-
Wasn't aware that you could call a module path via config that way - you learn something new every day Ryan - MailChimp has it's pros and cons like any other email newsletter system, but the API is pretty good which makes doing things like what Arjen's building pretty easy. Since getting into ProcessWire I find it a chore if I have to use a system with an even remotely complicated API (you heard me LemonStand, I mean you among others - but I still love you ).
-
You can simply use the pipe character to separate them. I would do something like this: echo '<form action="./" method="post">'; // Change the action to the results page foreach ($page->children() as $category) { echo '<input type="checkbox" name="categorylist[' . $category . ']" value="' . $category . '"> ' . $category->title; // $category is the same as $category->id by the way } echo '<input type="submit" value="Submit" />'; echo '</form>'; Then your selector would be something like: $categories = implode('|', $_POST['categorylist']); // This is an array of the checkboxes that are ticked from the previous page $pages->find("id=$categories"); It's as simple as that - you can just use the pipe character: | to separate values you want to match against. More details are under OR selectors: matching one value or another about halfway down this page: http://processwire.com/api/selectors/
-
I like the idea of this, however have a few suggestions before I go too much further: I think it might make more sense to call it NewsletterMailChimpSync.module as I initially thought it was a full integration that could send out newsletters as well Specifying exactly what it does in the module name also allows other people to build MailChimp modules to perform other tasks too using a similar naming convention. What is this config setting and where does it come from? $this->config->urls->NewsletterMailChimp - that's not in a default PW installation. In relation to point 2, it would help if we had a copy of the MCAPI class too to test this out and provide more feedback Now I know what it does, it's still pretty cool. As for point 1 on your list, you should be able to add this to your init() function: include_once($this->config->paths->NewsletterMailChimp . 'mailchimp/MCAPI.class.php'); // Get mailChimpApiKey and set url $apikey = $this->mailChimpApiKey; $this->api = new MCAPI($apikey); Then you can call the api in any other function via $this->api $apiUrl didn't seem to be used so I removed it from that example.
-
A handy bit of info on comparison operators: http://php.net/manual/en/language.operators.comparison.php In your case you're making $page->show_url equal to 1 regardless of it's true value by setting it to 1 using just one '=' whereas you need two '==' to compare the field value against another value. Granted, PW's selectors only use one = but they're a bit special like that
-
Something like this should work: // First iterate through all of your categories (I'm assuming they all have a template called "category", but this could be changed to suit $categorycount = array(); foreach ($pages->find("template=category") as $category) { // Now I'm assuming that the portfolio pages have a template called "portfolio" and are tagged against a category using a field called "category" $categorycount[$category->title] = $pages->find("template=portolio, category=$category")->getTotal(); } And that should be it - an array of category titles and their corresponding portfolio page counts. In the above code, we're first iterating through the categories, then finding all pages in the portfolio with a category that matches the current category we're looping through. Note that it seems like you would have to use $category->id, but if you omit the field you are outputting for a given page object it will default to ID anyway Oh, and the above is untested but should hopefully work EDIT: It's also worth noting that I had to refer to the cheatsheet as I couldn't remember the correct method to get a total - turns out it was getTotal() The cheatsheet is an invaluable resource even to those of us who have been here a while so if you've not seen it yet then check it out.
-
$page->images would only work of your images field was called "images" otherwise as you say it would be "the_image_field" if that's what you called your image field. $page->image_field_name->url gets you the URL and ->description on the end instead of url gets you the image description if you entered one.
-
ProcessWire Conference 2013 / London / Cambridge
Pete replied to ryan's topic in News & Announcements
That's pretty epic. If there's one film you watch this year with Hulk in, watch the Avengers movie - Hulk steals the show! -
I think I hard-coded this into a module I wrote a while back so having an actual fieldtype for it is definitely handy
-
Yeah, it's alright I suppose @ryan - thanks for this as it's perfect timing for a few things I'm intending to do too
-
Images are tied to a page and repeaters are essentially special hidden pages, so I think that's expected in this case. Can I ask what the usage is in this case? It's just that for most pages you wouldn't have image fields inside repeaters in order to use images in the main page's body text - an image field attached to the main page could store as many images as you like to insert into the body text. If you let us know the fields in your page and the fields in the repeater we could possibly suggest some other ways of achieving what you're trying to do
-
How to troubleshoot: non-virtual folders returning PW 404?
Pete replied to MarcC's topic in General Support
Is there another htaccess inside Piwik's folder that might be interfering?