-
Posts
4,054 -
Joined
-
Last visited
-
Days Won
67
Everything posted by Pete
-
Oh now this looks super-useful: https://github.com/ryancramerdesign/ProcessWire/commit/e5847d667aa200d050815acf73abaeeb30c96493
-
I just use my scroll wheel for scrolling, not clicking, so that will be where I'm going wrong. Still, it's one habit I'll never break I don't think as it doesn't take long either way.
-
When people say option+click are they talking command + click on a Mac? Not sure about other PC users but I always just right-click and select open in new tab... but then again I'm probably the only one still living in the 90's and not using that shortcut. Y'know, the forum software does allow you to create topics with polls so it might be a good way to gauge people's reactions to things like this. Trouble is I know things like this seem trivial when coding (been there myself) so it never seems that big of a deal at the time but afterwards everyone has an opinion - which is fine of course, just sometimes unexpected
-
Cool - I didn't even know about being able to set variables like that!
-
UserGroups module in development: groups & page based permissions
Pete replied to apeisa's topic in Module/Plugin Development
Great idea - love it I installed it though and I can't see where to add page permissions on each page yet. Am I missing something or is that bit not ready yet? -
I seem to have become hooked on Bastille the past few months: https://www.youtube.com/watch?v=F90Cw4l-8NY Also love this cover: https://www.youtube.com/watch?v=ZCTDKLjdok4
-
Where are you importing thousands of pages from repeatedly? Not on every page request I hope Also make sure you're not storing too many items in repeaters fir each page as this can slow things down. If you remove the repeater from the selector temporarily does it become much faster? I suspect it might but either way it could show you where the slowness is coming from.
-
I'd probably still do it as pages to be honest, just because it's easier and we're not talking about a lot if data by the sound if it. Any chance you can post the database structure? That would give us a better idea as to which way might be the more appropriate route
-
I think leoric's needs are better overcome by overriding that functionality in particular rather than working around it with something from this thread. In particular, leoric could do with simply having the option of removing those restrictions on characters in page names. Perhaps one for Ryan?
-
I finished "Rework" the other day - great book that I wished I'd read sooner. Don't get me wrong, so much of it is common sense, but a lot of common sense is things you don't think about until after it's been pointed out to you or after you've made your mistakes (basically common sense isn't always common ). It's over 200 pages, but none of the sections is more than a few pages and they've dropped illustrations in every couple of pages, so it's not a difficult read by any means and could be read easily over a few evenings or an afternoon. Currently reading "Remote: Office Not Required" by the same guys. I've not read "Getting Real" yet but I'll add it to my list. My family were a little confused as to why I was asking for work-related books for Christmas, but I knew these would be fairly easy-going.
-
As of February last year there was this workaround in TinyMCE itself: http://blog.room34.com/archives/5075 But since that would get removed every time the core TinyMCE is upgraded in ProcessWire then the solutions in the two previous posts would be preferable as they will stay forever.
-
That's explained in this post: http://processwire.com/talk/topic/4650-new-processwire-admin-theme-on-dev-branch/page-13#entry50950 though I'm not sure it's intuitive and can be mistaken for a bug. Surely if the menu opens on hover there's little time saved making the wrench act as the View Site button as well?
-
That sounds manic, but at least it's more interesting than painting a kitchen. Fortunately I have given in for the day and can now get back to doing web stuff. Hmm... maybe that should be my motto - "I do web stuff".
-
It seems the ratio code from the old post isn't what's used - the text above the table itself has the new code. Not wanting to sound like a sore loser, but it doesn't make a whole lot of sense to me, though I've not touched statistics since I was in school really so maybe it does? (($likes / $posts * 100) * $likes) Since it's a table of top posters, shouldn't it just be sorted by most posts, leave the "likes" column on and remove the "relation" column?
-
Hehe, I was here before ryan Nah, that number 1 spot is simply the member ID, and since I converted the forums from the old software it automatically made me number 1. I'm a bit confused by a lot of that. Sorting by member ID seems to return random members and I'm really lost as to what the Relation column is all about - I've not had that many relationships (or that many relations!). EDIT: Silly me - the member column sorts by name!
-
No problem. Not sure what you mean by "the syntax" though? The foreach loop is normal PHP code (more control structures here: http://www.php.net/manual/en/language.control-structures.php ), so you're unlikely to find that on the site docs purely because you could be doing anything with a set of pages, not necessarily looping through them to display them so the cheatsheet doesn't make assumptions. There are quite a few examples of this type of code in the default template (head.inc has a few loops and examples of urls and titles etc being echo'd to the page). On to your additional fields for your file field - you were right with repeaters, but you will want to edit your file field and set the max number of files to be 1 (it's set to zero by default which allows unlimited files to be uploaded). If you use your files field on other templates where you do want to allow multiple uploads in that field, you might want to clone the field and call it something else so you can have one file field with just 1 upload allowed for your repeater and another field for other uses that allows unlimited files.
-
Hi Helmut In ProcessWire everything is custom. I would suggest watching the overview video for starters: http://processwire.com/videos/ and perhaps playing with this tutorial to get an idea of what you can do with some of the different fields: http://processwire.com/talk/topic/693-small-project-walkthrough-planets/
- 1 reply
-
- 3
-
-
Welcome to ProcessWire! Assuming your file field is called "files" in the admin, you could do this in your template: <?php foreach ($page->files as $file) { echo "<a href='$file->url'>$file->name</a> }You could also substitute the name with the contents of the description field too.A pretty complete list of functionality can be found on the cheatsheet at http://cheatsheet.processwire.com
-
terry - your amended code would work with any array, it's not ProcessWire specific and is just a case of having a counter that increments as you iterate through an array. I would set $i = 0; before your foreach though just so it knows what $i is before you start incrementing it - with stricter error reporting turned on it would probably throw you an error otherwise. The code is puzzling though as it doesn't really relate to anything in the PageArray. Since you can sort based on date ascending or descending, by title asc and desc etc etc just having this counter doesn't seem to achieve much as $i doesn't relate to anything in the array - it's just a running count of how many items there are. Is it being used for anything in particular?
-
I was wondering if this could be part of the installer - an additional step to tick some additional, oft-used modules and choose an RTE? It's not making an assumption about how you're going to work that way, but some thought would need to go into the list of immediately useful modules (I generally always go with PageLinkAbstractor, Thumbnails and CKEditor nowadays before I do anything else). It wouldn't need to be an exhaustive list as there could be a sentence at the bottom saying there's more when you login. I think this goes along with another idea I had a while back about part of the install process involving asking what profile you'd like to install and it then going off and downloading that, but that depends on server capabilities - though I'm not sure I've heard of anyone having issues with the way modules can be downloaded in the admin lately?
-
I know it's only a Proof of Concept, but I'm 50/50 as to whether this is a good idea or not if it's auto-saving live pages, no offense intended, as it could be updating part-changed content on a live page if you're halfway through typing when it autosaves couldn't it? Some people write/edit loooooooong pages I think it would be better if it autosaved to another part of the site (under your process page for example) and if you leave the page you're editing and go back to it it could do a comparison of modified dates and ask if you want to edit the later, non-live version. Of course, that's quite a lot more code but it's just an idea (it's also leaning towards version control too in that case).
-
Thanks Soma - I knew it would be something easy like that - works perfectly
-
I've just noticed something with front-end logins - too many failed login attempts throws an ugly server error (since we're not logged in we don't see the nice too many login attempts message). Is there an easy way to intercept and display the appropriate error on the front-end instead of seeing a nasty-looking error page?
-
are there any programming experts on this forum?
Pete replied to franci77's topic in General Support
Your post has been up for less than 12 hours - if you are patient someone may help, but a lot of us were asleep for most of the time this has been up so far! -
I'm thinking about Caching and areas of a site where there is just ONE dynamic element to keep things fast for everyone. For example, any site that has member accounts. What would be the possible ways of approaching this whilst still having the rest of the page cached as much as possible? I was toying with the idea of an AJAX request to load the member-related menu items after page load. The up-side is a quick load time for the page and that you could theoretically keep using ProCache whether logged in or not (if you could configure it that way) but the downside would be a delay to loading the member-related page items. In the background of course, you've just gone and initialized ProcessWire as part of the AJAX request, so there's no savings to be made in terms of load on the server there, but I sort of like the idea of loading the content as quickly as possible. Another way to do it could be with an Iframe, but that feels soooo last decade The other option would just be to use MarkupCache on all sensible places on the page to keep things simple for the server when members load the page, use ProCache for guest users and make sure there's enough grunt in the server to serve pages as quickly as possible. Any other suggestions? Or am I trying to over-optimise things do you reckon?