-
Posts
4,632 -
Joined
-
Last visited
-
Days Won
55
Everything posted by apeisa
-
What? More details fellows, no more coughing!
-
That is very common mistake, I remember making it many times. I actually think it might be more clear to image field work always the same on the api. So it would return imagearray even when only 1 image is allowed. I don't like that changing "max no of images" setting might break your site.
-
No, there isn't, currently at least. Never found the need myself. You can "clone" the templates and that is pretty common workflow for me.
-
Didn't understood about the animation you were talking about first. For me there is "close" button visible, clicking close makes the white header a bigger. Clicking "open" makes it smaller. Only after reload the animation is visible. (Chrome / Win7). Happened twice (at work and now at home too). Now that I see it, I agree: animation is super cool!
-
I actually tried to put my bullet list to wiki... didn't realize that wikimedia is that awful to use
-
Few things that are "nice to know" when building PW modules: Autoload and non-autoload modules: autoload ones are loaded on every page load. So if you need to hook into core, then you probably need autoload. Non-autoload modules are run only by request: $modules->get("myUberModule")->doSomething() When you need hooks? Well.. common things are "do something when page is saved", "alter the output that is generated", "do something before page is accessed" etc.. Actually there is quite a many hooks and best way to find right hook for you need is to ask for it here. Building modules is pretty similar to working with templates. Nothing "special" there. Few notes though: You cannot directly access the PW API variables like $pages, $session, $input etc.. Those are available at $this->pages or wire('pages'). If you have static method(s) in your modules then you need wire('pages') there - so if you want to play it safe always use that (it works on command line scripts also) Modules can have settings - those are very easy to implement (just look examples from other modules that have settings) Modules are cool. init() is run before page is loaded, so if your autoload module needs to know the current page, that is available at ready() method. Forums is your friend, just ask and someone (probably Soma with his quick editing skills) will surely help.
- 29 replies
-
- 14
-
-
I would probably do it other way around: I would choose projects from categories. Usually I would do otherwise, but since your projects is just a "data reporsity" and categories are on different domains that would make more sense for me). But that is just a matter of preference.
-
Not totally sure what you are looking for. Your page structure looks just fine for me. If I follow you correctly you choose categories from project page, and then you want to show those projects in different domains? Something like this should work: Create a new template called "view_project" Add page called "project" under each your sites and give those pages a template "view_project" Allow urlSegments for your view_project template And code that goes into your view_project template should be something like this (written in browser): <?php if ($input->urlSegment1) { $projectName = $sanitizer->pageName($input->urlSegment1); $project = $pages->get("parent=/projects/, name=$projectName"); echo "<h1>$project->title</h1>"; // Or just echo $project->render(); } else { echo "No project found"; } And when linking to your projects you should use urls like these: www.site1.com/project/projectname/
-
I always check for $page->id. Short and clear in my opinion.
-
Soma is faster than Teppo.
-
<?= and <? will be always enabled from PHP 5.4+ so if you don't need to support some rare shared hosts where shorthands are disabled then those are perfectly safe to use.
-
Everything you find from processwire.com is valid. Version 1 was closed source system and Ryan only references it on his "background articles". Curly brackets work only inside php tags already. Your first example should be: <?php echo "<li><a$class href='{$child->url}'>{$child->title}</a></li>"; ?> If you are writing pure html then simplest way to output variables is: <li><a <?= $class ?>href='<?= $child->url ?>'><?= $child->title ?></a></li> Curly brackets are necessary when going deeper than one level on your objects, like this: <li><a <?= $class ?>href='<?= {$child->related_page->url} ?>'><?= {$child->related_page->title} ?></a></li> Hope this helps. PW uses pure PHP as a templating language.
-
Changing the admin access value from "processwire"
apeisa replied to Gazley's topic in Getting Started
Did you move the hidden .htaccess file also? -
You still want to create a local user account for each user. You can do this behind the scenes. I think each of those services offers a unique identifier for each of their accounts, so you want to save that data into your local accounts. When someones logins through 3rd party service you check if he has already logged in (you have user account with it's google/fb identifier saved on) and just log it in. If not, then you proceed to create a new account (either behind the scenes or something like "Choose your username", up to you of course). Password is by no means "required" - you can just generate some unique 1-time hash and set it as a password and then login by using it.
-
Basically you can put the PW anywhere. But if you want "clean" domain (no subdirectories) then just make sure you point your docroot where your index.php is (and wire and site directories). You can even "nest" pw installations. You can run one site at www.cooldomain.com and yet another at www.cooldomain.com/subsite/. It just doesn't care. Coolest part of that: http://processwire.com/api/include/ I would but it this way: /var/www/htdocs/coolsite.com/ /var/www/htdocs/anothersite.com/ etc.. (also you might want to make the path simpler, like /www/coolsite.com/ etc..) This way it is clean and simple, and allows multiple domains/sites from your server.
-
Have you checked the Apache error log yet? (not sure how to access that in your shared hosting - maybe by contacting the hosting company?) Also you might want to try clean install first to see if the server fills all the requirements for PW.
-
Great! WireTabs are super simple and work just like those other wrappers. Also simpler solution might be to just collapse others than first section.
-
Checkboxes are always nice One reason might be that as a programmers we do think it as a property of a object, or a "feature of that page" etc... But the editor is looking the frontpage and wants to change something there. Also if there can be more than one featured items, then using page reference allows choosing their position etc. And removing items is much simpler also.
-
My mind also likes to put "featured" checkbox to actual items... but editors seem to be more comfortable to edit the homepage and choose the featured stuff from there. So now I usually go with the page reference on homepage.
-
Soon 15000 posts and 500 members. Nice growth fellows! Do we get some neat statistics from the IP.Board Pete?
-
I was joking of course (about the copying part - quick editing is still true)
-
I'm not sure, but are you copying the answers as well from the later posters? First quick draft with total nonsense, then Teppo (or some other poor fellow) comes with careful examples... some copy & paste magic (with few edits of course) and voila! And final nail in the coffin is that "Sorry dude, I was first here"
-
Teppo is way too slow, always second FORUM PROTIP that I spied from Soma: quickly post something, then edit it few times. You'll win every time!
-
Out of interest, who's using Less/Sass vs plain old CSS
apeisa replied to onjegolders's topic in Dev Talk
This is actually pretty interesting topic, started googling for more: http://blog.millerme...pre-processors/ Then there is this from 2009: http://nathanborror....0/sass-isnt-me/ and in comments Jeff Croft says: Forward few years and from Jeff's own blog (http://jeffcroft.com...eature-of-sass/):