-
Posts
1,489 -
Joined
-
Last visited
-
Days Won
43
Everything posted by gebeer
-
Hello Larry, this is great. Thank you for putting the Yeoman genarator together. Would you mind elaborating a little more on this, maybe in a new Yeoman generator thread? I think this can drastically improve our workflow with PW. Cheers Gerhard
-
Thanks for pointing me to these options. I use these already and tried many other kinds of similar services. But none of them are like the real thing. I also like http://www.responsinator.com/. The name is just too cool. Especially when it comes to iOS-Safari specific bugs, Chrome device emulation doesn't reproduce them, like this one. When using device detection scripts, Chrome emulator doesn't return the correct user agent strings, see for example here I do test things with Chrome Dev tools but always on the real device, too. This seems the only way to make sure it is really looking as expected. Too bad, there is no real emulation for iPAd/iPhone available on Linux/Windows. Cheers Gerhard
- 11 replies
-
- 2
-
Thanks again. I see your point but don't have iPad available for testing right now. Will have a look at that next week. Cheers Gerhard
- 11 replies
-
Thanks for that. I'll give it a try. It resizes for screens 1024x768 (IPad), but not optimized for lower than that. Guess thats why the viewport meta tag is in there. Cheers Gerhard
- 11 replies
-
Hello totoff, thank you for taking a look at that site and taking your time to comment. I agree with what you are saying. But the design, images and structure of the site all came from the agency mentioned. I'm merely the guy who does the programming stuff. So, unfortunately, I have no influence on the contents of the site. If it was me, I would have placed "Im Notfall" under "Behandlungszeiten". Different people, different logic, it seems. If people ever read the welcome text on the homepage, I think they can associate the dentists name with the image. And she really is looking like a dentist, isn't she?
- 11 replies
-
- 1
-
Hi there, I just saw totoff's new doctor's site and thought, I add my dentist site here: http://zahnarztpraxis-wunschik.de/ Credits for design and concept go to http://www.gruenklee.de/grkl/ They did a great job on the design and photography. This is my first PW project where I learned my ways around. It is running on v2.3. I used the default site and married it with H5BP and added a sass framework for the styling part that I used in good old Joomla days. From the PW side of things, this wasn't a great challenge thanks to this great forum. I was very happy about the Gmaps field. Only had to tweak it a little to display the info bubble. And FormBuilder. Didn't want to spend too much time on the form coding in a new environment. Tricky part here was to get the datepicker to display in German. There are some Animation features. The three info boxes at the top are slidable. And there state (closed/open) is remebered across the site. That was tricky, too because I had never worked wit jQuery cookies before. Gave me some headache but finally worked out fine. There are also some image slideshow features in the header on the "Praxis&Philosophie" page and on the start page. I used cycle2 jQuery plugin which is absolutely great. And some slide-in effects on the team page. All in all I learned really a lot from setting this up. It gave me a good base to explore PW further and work on more challenging projects with even more Animations AJAX etc. that shall be presented here in the near future.
- 11 replies
-
- 10
-
That's what I actually did before. But then I wanted to get rid off the extra periods and single quotes to make the code shorter and more readable. I have this code and it is working well: note that $image->url is not in curly braces. This seems to prove your assumption wrong (no offense intended). Definitely
-
What confused me in connection with curly brackets is the different behaviour when using single or double quotes. Starting with double quotes, e.g. $carouselId = 10; $carouselMarkup = "<div id='carousel-{$carouselId}'>" Result markup <div id="carousel-10"> BUT, starting with single quotes $carouselMarkup = '<div id="carousel-{$carouselId}">' Result markup <div id="carousel-{$carouselId}"> I just spent an hour until I realised that starting with double quotes is important when using variables inside a string (no matter if curly brackets or not).
-
Thanks to Soma's teaching, I got this solved very quickly. And here's the code of my Bootstrap 3 carousel render function as gist. $carouselId = $images->get('page').$images->get('field')->id; is doing exactly what I wanted to achieve.
-
@Soma thank you very much for taking your time to post this very informative lesson on how to do things in PW! Obviously, I'm still pretty new to PW and a self-taught PHP fiddler who is just emerging from the rookie stage. From this forum, I've already gained a lot of new insights. Love PW
-
A different way of using templates / delegate approach
gebeer replied to Soma's topic in API & Templates
Hello Horst, thank you for that link. Very helpful, indeed. Actually, I found the solution to my problem through a link in that post to Ryan's post here. I can pass my own variable in the options array of $page->render(). On the page that gets rendered I check for the variable. If it is there, I don't include main.php. Love PW -
Hi all, I'm working on a function that outputs markup for a bootstrap 3 carousel. I'm passing the $page->images object to the function argument $images. To have an individual id for each carousel on a page with multiple carousels, I want to use the image field id and the page id of the page were the image field sits. I can get the image field id with: $images->field->id But I can't seem to get the page id although it's there in the var_dump of the $images object: object(Pageimages)[203] protected 'page' => object(Page)[206] protected 'template' => ... protected 'settings' => array (size=10) 'id' => int 1013 //this is the id I need ... protected 'field' => object(Field)[72] protected 'settings' => array (size=5) 'id' => int 100 //this one I can get with $images->field->id ... When I try $images->page->settings->id I get null. When I try $images->page->id I get 1012 instead of 1013. 1012 is nowhere to be found in the $images object. It is the id of the page from which I'm calling my function. But I'm not passing the $page object to my function. So where does it come from and how can I get the correct page id? Thanks for reading through this!
-
Thank you for clarifying.
-
For my case this seems not to be the case. Or it doesn't apply to the children of the page you get. I tried this code to retrieve children, including hidden ones, but it doesn't work. It only gets non-hidden children. foreach ($pages->get($page->id)->children as $child) : Before I had foreach ($page->children as $child) : which does not get the hidden children, either. Only this gets hidden children for me: foreach ($page->children('include=hidden') as $child) :
-
A different way of using templates / delegate approach
gebeer replied to Soma's topic in API & Templates
I just start explorin different templating approaches. Ryan's main.php method appealed to me so I converted my template structure from the good old head.inc, foot.inc to the main.php structure. Everything is working fine. Just one thing I cannot get my head around: I have basic-page.php: <? // Template basic-page if($page->numChildren) { foreach ($page->children as $child) { $page->outMain .= $child->render(); // list the children } } include("./main.php"); ?> This renders all children, all of which have basic-sub-page.php as template: <article class="article row"> <h1 class="col-md-12"><?= $page->title?></h1> <figure class="figure col-md-4"> <?= $images; ?> </figure> <div class="text col-md-8"> <?= $page->body; ?> </div> </article> <? include("./main.php"); ?> $images is irrelevant for my question, it just outputs img code. You see that I include main.php also in the basic-sub-page.php. This is fine when I call the page directly. But when calling it through $child->render() in basic-page.php, then I don't want to include main.php. How can I conditionally include main.php depending on whether the page gets rendered directly or through $child->render() ? Any ideas would be much appreciated. -
The image name gets changed because PW makes a cached version of your image that gets the dimensions appended to the name. Why is the different name of the thumb image a problem? Do you want to use it on the page as a caption? Is the PW version of the example image a resized output, like bathroom.1000.0.jpg? This is because you are using $photo->size(1000,$options) As adrian said, with size() you will have to use width and height (sorry for giving you wrong example code above). If you change this to $photo->width(1000,$options) and your options array to $options = array( 'quality' => 100, 'upscaling' => false ); Then you get the desired effect. Please have a read through: https://processwire.com/api/fieldtypes/images/ It's all in there. It can't be responsible because it's code is not executed if you don't call the photoSwipe plugin in your template. You most likely get a JS error in your console.
-
OK, so in Craigs photos.php and photos_index.php add this at the top: <?php include("./head.inc"); $options = array( 'quality' => 100 ); ?> And change every instance of $photo->size(1024)... $photo->size(260,260)... to $photo->size(1024,$options)... $photo->size(260,260,$options)... This ensures that the thumbnails are generated in the best quality possible. If the resulting quality is not good enough (you said you were picky about that) you still have the option to generate the thumbs through Photoshop and include a separate thumb-images field into your page template where you upload them. You only would have to make sure then, that both thumbnails and images are in the same order. Maybe you can attach a screenshot of the resulting page or, even better, one of the generated thumbnails on that page so we can see what you mean by "blurry".
-
Hi Max, can you provide us with a link to the page or source code of the page, including css? The images might be blurry because their actual proportions don't match the displayed proportions. By default, PW doesn't change anything about the uploaded images if you do not tell it to do so. In your images field setup in the backend, do you have any dimension restrictions there? You can adjust the quality of your thumbnails with an options array that you pass on to the resize function: $x = 100; $options = array( 'quality' => 100,// adjust quality here 'upscaling' => false, ); $thumb = $image->width($x, $options); For more info see here. For fast page loading I suggest using a jQuery lazy load plugin.
-
frankensteining - hahaha - hope you won't need too much power to bring it to live ;-) It took me a while, too, to get my head around the setup. What helped me to finally find the right setup was the section "Working with Existing projects" in the Foundation 3 docs here.
-
I'm using vagrant on a Linux box and am quite happy. Only drawback is that file operations on the nfs mounted directory where my sites live are slow sometimes, especially when extracting archives through php. Other than that I love it because I work on different boxes and have the same dev environment. I stumbled across a vagrant box that has PW preinstalled but haven't used it yet.
- 28 replies
-
- 1
-
- vagrant
- virtualbox
-
(and 1 more)
Tagged with:
-
Hi Russel, you can also take a look at the directory structure of my Foundation 5 profile at github. I have the config.rb inside the scss and adjusted the paths accordingly. You could basically put your scss stuff and config.rb anywhere as long as you have the right paths defined in the config.rb.
-
Site Profiles from Modules Directory as install option
gebeer replied to Roope's topic in General Support
That makes the idea attractive again -
Hi there, today I was playing around with Bootstrap 3.1 and PW. I downloaded a boilerplate template for Bootstrap3.1 from initializr. Then I took a virgin PW 2.4 install and merged the initializr files with the files in PW template folder. I didn't touch any of the content and tried to replicate the site-default template as close as possible with Bootstrap markup. Only thing I added is a carousel instead of the random image. The result is a default PW install with Bootstrap look. For the main menu, I took Damienov's rendering function from here. To install my template: 1. Do a default PW 2.4 install 2. Unzip the attached file 3. Replace the original site/templates folder with the one from the attached zip file. The result can be seen here: http://pwboot.webseiten-fuer-alle.de/ templates.zip
- 3 replies
-
- 8
-
- template
- bootstrap 3.1
-
(and 1 more)
Tagged with:
-
Site Profiles from Modules Directory as install option
gebeer replied to Roope's topic in General Support
At first glance I thought this to be a great idea. But thinking about it twice brings up a major question for me: What profiles do you want to offer on first install? Suggestions here were: What about Foundation5 profile or Bootstrap profile or...? It all depends on personal choice which profile/framework to use. Many of us are building there own starter profiles. So in order to satisfy most people's needs, there would have to be at least 5 different profiles to choose from which would blow up PW initial install files size considerably. As Pete said it should not be too difficult to copy some extra files over the original ones before installing PW. Finally, the great thing about PW is that it doesn't make any assumptions about how you want to code your template. And I think it should stay that way. -
@bwakad my template is also on github: https://github.com/gebeer/pwfoundation5 You find instructions for installing and also for update of Foundation on github in the Readme.md.