-
Posts
1,011 -
Joined
-
Last visited
-
Days Won
8
Everything posted by SiNNuT
-
Up until recently the dev branch was way behind master. Lately, new stuff is added to the dev branch, and i think rightly so. Can we expect master to be pretty much the stable/production branch? Dev and possibly other branches for new stuff?
-
There is a lot more to (CSS) performance than sheer filesize. In theory, a 20kb css file could perform worse than a 200kb css file. This has to do with the way that you craft your css rules. Some time ago i saw some very interesting videos about modern web app/site performance testing that also detailed some common css pitfalls. Unfortunately those bookmarks are AWOL.
-
For those interested in text editors: http://net.tutsplus.com/articles/news/perfect-workflow-in-sublime-text-free-course/ Pretty neat for those looking into Sublime Text.
-
I'm thinking it's best to create the "overview links" as pages in your tree. You would assign a template with first-child-redirect behavior to those pages. An example is here. Easy and flexible.
-
I know Ryan, hence the PHP 5.2 has been in EOL status as of 16 December 2010. It still amazes me that almost two years later apparently more than 50% is still on 5.2. And yes, i know how things work, at my workplace we are still on Windows XP and Office 2003. I just thought that the 'webworld' would be faster to adopt new things. Are the (cheap) hosting companies to blame? Anyways, if we go strictly by percentages it will be another 2/3 years before 5.3 becomes possible. Still, i think it would be good thing to pick up the pace on this; is it too much too ask new PW users to use 5.3? It will become much easier to use third party components via stuff like Composer and the Packagist site.
-
Properly namespace Joomla and PW, problem solved
-
You know what they say right: "Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems." Just kiddin, seems like a useful tool. An ex colleague of always spoke highly of RegexBuddy, but this seems to be paid software (not that this is a bad thing per se).
-
It's pretty obvious because of diogo's code comment but just in case you're wondering; he's using a so called ternary operator. Which is basically the same as this If/Else statement: if($feature->thumbnail) { $thumb = $feature->thumbnail->size(244,244)->url; }else{ $thumb = "[url to the placeholder]"; }
-
Maybe you're right and we should let CSS do what it's good at. Come to think of it i like letting old IE versions slowly die. I didn't know selectivizr and that should suffice for old IE support. Still, if it's not hard or expensive to let the pager module have first and last classes (maybe optional) it can't hurt to put it in.
-
A whole lot of text but sometimes some examples work better to see what you want. Haven't worked with the pager much so i looked at the pager at http://processwire.com/blogtest/page6, thinking this probably is the default output of the pager: <ul class='MarkupPagerNav'> <li class='MarkupPagerNavPrevious'><a href='/blogtest/page5'><span>Prev</span></a></li> <li class=''><a href='/blogtest/'><span>1</span></a></li> <li class=''><a href='/blogtest/page2'><span>2</span></a></li> <li class=''><a href='/blogtest/page3'><span>3</span></a></li> <li class=''><a href='/blogtest/page4'><span>4</span></a></li> <li class=''><a href='/blogtest/page5'><span>5</span></a></li> <li class='MarkupPagerNavOn'><a href='/blogtest/page6'><span>6</span></a></li> </ul> I think i see what you mean. It would be nice to have this: <ul class='MarkupPagerNav'> <li class='MarkupPagerNavPrevious'><a href='/blogtest/page5'><span>Prev</span></a></li> <li class='MarkupPagerNavFirst'><a href='/blogtest/'><span>1</span></a></li> <li class=''><a href='/blogtest/page2'><span>2</span></a></li> <li class=''><a href='/blogtest/page3'><span>3</span></a></li> <li class=''><a href='/blogtest/page4'><span>4</span></a></li> <li class=''><a href='/blogtest/page5'><span>5</span></a></li> <li class='MarkupPagerNavOn MarkupPagerNavLast'><a href='/blogtest/page6'><span>6</span></a></li> </ul> The First and Last types seem to be in the code but just no way to get them in the output. Maybe we are overlooking the obvious but if not consider this a feature request.
-
User ID selector sometimes work, other times doesn't.
SiNNuT replied to Harmster's topic in API & Templates
Harmster, for future reference; I'm guessing you're talking about the "Dereference in API as" setting for page fieldtypes? You've now set it to Single page? Not sure what to make of it. If you had 3 id values (PageArray) it means that you've had selected 3 users on the transaction page? I can understand that the result would be unpredictable with some of the code you posted. Actually, i'm surprised that you got results some of the times. -
When you enable url segments on the home template it will also render, ehm...non-existing pages from the docs: So we only allow urlSegment with the value "contact" and throw 404 when we try to go to any other non-existent page e.g. www.mysite.com/hahanothinghere/
-
ProcessWire doesn't translate real well into the MVC pattern but at some points : Model. Represented in PW by a Template. Here you define your datamodel by adding Fields to the template. You can have as many models/templates you like. In PW 'pages' are modelled by the template that you choose when creating a page. View and Contoller. This is where a Template File come in. ProcessWire doesn't enforce a strict separation of output presentation (the view part) and controller logic. It gives you freedom to set things up to your liking and project needs. We've had discussions before about the slightly misleading nature of the term 'Page', and what it represents in other popular cms tools. Just think of Pages as data objects or Entities. An entity has one or more named properties (fields available via the page template), each of which can have one or more values. The value(s) a property can have depends on the field type (integer, date, text, page etc.) + what Ryan said
-
Ah ok, sorry that i misunderstood. From the TS i got the impression you needed an up to date full postcode list to work with regularly. Still don't understand the use case here, but nvm.
-
And how will you do this maintenance? Re-run the csv import and update every now and then using a csv from here via this? I haven't had to do this but i would rather setup a cronjob using MySQL's LOAD DATA INFILE to import the CSV into it's own table. In this case it doesn't seem so clean to me to have all of this data as PW pages. Depending on what you want you could make a module to work with your postcode table. A bit different but modules like this also set up separate tables.
-
How to hide the admin (backend) login from bots and most people
SiNNuT replied to alan's topic in General Support
The PW admin pages all have <meta name="robots" content="noindex, nofollow" /> in the head section. Though no guaranties most search engines respect this. Changing the admin url is basically security through obscurity, but it's fine to do. Of course, if you then link to it on the public facing website you are making it 'public' So maybe just tell clients to login at mysite/mysecretadmin -
And i thought i was being ambitious the other day while importing 13.000 rows/pages! In step 2 the csv file is opened and it's contents read. Maybe some memory_limit issues? Googling for something like 'php fgetcsv timeout' gives some results like this which describe similar issues. Interesting. On a side note: wouldn't it be better to store this data is a separate/custom table?
-
You do this in between saving in fear of losing your work? There are browser extensions for that, such as https://addons.mozil...-form-recovery/ I'm not sure i would want PW to have this kind of facilities in the core. For example WordPress has auto save and page revisions but i generally dislike how they work. Revisions or page versioning can be useful but imo only on a small percentage of sites.
-
Getting all fields in a list or array from a page.
SiNNuT replied to Harmster's topic in API & Templates
Harmster, have you already seen the cheatsheet? It's really helpful for figuring out stuff like this. For example $page->fields is in there. Clicking on the items give a small description of what it is. Also, if your doing some 'custom' user stuff it might be worth noting that you can edit the user template just like other templates. You can add your own fields. A user is a page object, see Admin->Access->Users. -
For everyone new to javascript/jQuery i thought i'd post a link to what is imo a great intro: http://jqfundamentals.com/ (Maybe we could use this topic to post more references; CSS, PHP etc.)
- 3 replies
-
- 3
-
-
- 101
- javascript
-
(and 1 more)
Tagged with:
-
Maybe you've already seen it but this thread might be helpful in some ways. http://processwire.com/talk/topic/1716-integrating-a-member-visitor-login-form/#entry15919
-
I would first check if the username/email isn't already taken. If it is not taken continue with creating a new user. public function check_username($username) { $u = $users->get("email=$username"); if($u->id) { return "Already taken!"; } else { $nu = new User(); $nu->name = $username; $nu->save(); //continue with the new user and further code } Dammit! You gotta be quick on this forum! Pete beat me to it.
-
No problem, Study the docs section; maybe do the Small Project Walkthrough and just read through the code in the files of the templates dir. They are well commented and you really see what's going on. When you become more comfortable with some basic PHP + ProcessWire's API it's time to have the cheatsheet standby. You'll be flying in no time.
-
You want to check after some kind of form submission? Not sure but something like this? $u = $users->get("email=$email"); if($u->id) { echo "Already taken!"; }
-
It's important to remember that in ProcessWire a Template and a template fileare two separate things. In Setup->Templates you create and manage Templates. You can add fields to a template, do some access settings etc. The fields you add to the template are shown in the admin when you create a new page with that template. The order in which they appear is controlled by the template settings (drag and drop). A template most of the times has a template file associated with it, but it isn't necessary. In a template file you have complete control over the output and logic. If you have no need for a sidebar field at all you could go to Setup->Fields and remove the 'sidebar' field. (ofcourse, you then probably would want to remove references to that field in your template codes.