-
Posts
2,769 -
Joined
-
Last visited
-
Days Won
31
Everything posted by Martijn Geerts
-
Automatic logo resizing. (Solved)
Martijn Geerts replied to Martijn Geerts's topic in Module/Plugin Development
Tnx for your responce DaveP. The use case for this is exactly what you describe. And it's true that thin lined logo's with cross shapes won't work very well the automated way for example. The theory you have is the same theory I have, but's its only theory on my part . I can calculate the percentage that the logo takes in comparison to the box. So the biggest possible image = 100%; This one should scale the most. A landscape image, who's only taking 30%, should be made smaller but just a tiny fraction. Here's where my poor Math skills can't work it out. Maybe I just go for an ugly switch for every 10 percent or something. -
New ProcessWire admin theme on dev branch
Martijn Geerts replied to ryan's topic in Themes and Profiles
I do agree on lot's of things you mentioned, but there's a greatness in the admin (theme). The structural look of ProcessWire hasn't changed for years, this is a sign of good design decisions. Take the comparison between Apple vs Microsoft. Apple didn't changed the positions of fundamental elements in their OS, Microsoft on the other hand, arranged buttons, shift structures and given it visualy a whole new experience every single version. The PW elegance theme, very well done, no real changes from the original PW theme and It feels even better (tnx, u-nikos). The only reason I don't use this theme, because it's not the default. I think Ryan is a good front-end designer, but he's exceptionally good in scripting and keep all simple for us. Maybe the theming can be a community thing and the designs can be made with instruction from Ryan. ( but then Ryan has to let it go a little ). -
I'm trying to resize a logo to fit in a boundary box. Works great with only fitting the box. (see first 2 pictures) But I wished it could add some automatic scaling factor. +---+----------+---+ +------------------+ | |\\\\\\\\\\| | | | | |\\\\\\\\\\| | +------------------+ | |\\\image\\| | |\\\\\image\\\\\\\\| | |\\\\\\\\\\| | |\\\\\\\\\\\\\\\\\\| | |\\\\\\\\\\| | +------------------+ | |\\\\\\\\\\| | | | +---+----------+---+ +------------------+ If the original image has the same pixel dimensions as the box, the image should be shrinked like the picture below. +------------------+ | +--------------+ | | |\\\\\\\\\\\\\\| | | |\\\\image\\\\\| | | |\\\\\\\\\\\\\\| | | |\\\\\\\\\\\\\\| | | +--------------+ | +------------------+ If the boundary box has the same amount of pixels as the re-scaled image, we should re-scale the image again, with the highest amount of 'compression'. If the image contains little bit less pixels then the box, we should scale it less then the maximum scaling rate. If the image has 30% of the pixels of the box, don't re-scale it. to use: // single page image $logo = $page->image; // initialize the module $module = $modules->get("ImageFitBoundaries"); // max. horizontal space <--+ +--> max vertical space an image can take $info = $module->load($logo, 200, 95)->info(); $width = $info['width']; $height = $info['height']; // create the thumb $thumb = $logo->size($width,$height, array('sharpening' => 'none')); // sharpening none, due bug in png resize echo "<img src='$thumb->url' alt='$thumb->description' width='{$width}' height='{$height}'>"; Which Math genius can help me out. I started a Gist.
-
1. I dont see a good way to check/inspect if my Jquery libs are correctly linked as are my CSS sheets. In Chrome, click 'inspect' element, then click the network tab inside the inspector, there you can see what is loaded.2. I want to debug step by step the PHP code. In your config.php put: $config->debug = true; // Under no circumstance should you leave this ON with a live site. echo out, var_dump variables, to see if they have the expected outcome. 3. Read or watch movies about PHP. 4. Be eager !
-
Howto: add a banner that rotates pictures ?
Martijn Geerts replied to motionmindz's topic in Getting Started
<!-- HTML fragment --> <head> <link href="/path/to/jquery.bxslider.css" rel="stylesheet" /> <!-- jQuery library (served from Google), or serve your own --> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> <script src="/path/to/jquery.bxslider.min.js"></script> <script> // this is document ready, put this after the jquery $(function(){ $(".bxslider").bxSlider(); }); </script> </head> <body> <ul class="bxslider"> <li><img src="/images/pic1.jpg" /></li> <li><img src="/images/pic2.jpg" /></li> <li><img src="/images/pic3.jpg" /></li> <li><img src="/images/pic4.jpg" /></li> </ul> -
Our whole company still using IE8, and they're on a company network. Thus Loads of machines just use IE7 as render engine. But IE8 support brings ProcessWire a big foggy extra layer of HTML & Javascript. It's complicating page rendering. Next, we can't use native browser features for lot of functions without using bloated polyfills. It's time to move on. We must not forget that the ProcessWire admin is a controlled environment. So we can set some rules. Requiring ie10 or the latest from the others is not a problem it's a bless in my opinion.
- 4 replies
-
- 1
-
-
- internet explorer
- fancybox
-
(and 1 more)
Tagged with:
-
Very poor quality with scaled transparent PNGs
Martijn Geerts replied to NikNak's topic in General Support
This could be related -
It's like the game checkers, a few moves and no game is the same. And BTW, you're welcome.
-
And diogo ?
-
Lol
-
$items = $pages->find('parent=/video-container/'); // find retrieves an Pagearray while get gets 1 page object. foreach($items as $item) { echo $item->folgeTitel . '<br>'; echo $item->folgeYT . '<br>'; }
-
Where is /CONTAINER/ located ? And what are the names of your fields ? (ps, it's a good practice to lowercase all page names )
-
There was a bug in the code sorry. Maybe it's better to explain what i've done. // get the parent // the children of the page under www.your-domain.com/container/ $pages->get('/CONTAINER/')->children <-- this is a page array // now you can foreach this, because it is an array. $children = $pages->get('/CONTAINER/')->children; foreach($children as $p) { $all_fields = $p->fields; // fields are all the fields in the template from this page. (array) foreach($all_fields as $f) { // every field $f echo $p->$f . "<br>"; // $p, the page in the `outerloop`, $f all fields in $p } }
-
MODX with getResource is slow & inflexible compared to ProcessWire, take a look at this traversing heaven. Something like this might work: foreach($pages->get('/CONTAINER/')->children as $p) { foreach($p->fields as $f) { echo $p->$f . "<br>"; } }
-
Module HelperFieldLinks - field and template edit shortcuts
Martijn Geerts replied to Soma's topic in Modules/Plugins
I don't see any notices anymore here localy, maybe I just prevented it 'dirty' and didn't tell Soma anything So what I remember, is that $data_value is a string and sometimes an array. All those roles thingies are arrays, thats the reason I check for in_array. -
Thank You Willy ! var_dump((bool) ""); // bool(false) Very clever !
-
Template access, redirect to internal page
Martijn Geerts replied to Frank Vèssia's topic in Wishlist & Roadmap
Can be that I don't understand what you want but the admin login is called by ID: $config->loginPageID -
maybe i'm wrong, but so far I see this should function. /** * Does this page have the specified status number or template name? * * See status flag constants at top of Page class. * You may also use status names: hidden, locked, unpublished, system, systemID * * @param int|string|Selectors $status Status number, status name, or Template name or selector string/object * @return bool * */ public function is($status) { if(is_string($status) && isset(self::$statuses[$status])) $status = self::$statuses[$status]; return $this->comparison()->is($this, $status); }
-
Or check with a string: `hidden, locked, unpublished, system, systemID` $page->is('unpublished'); (Teppo was quicker !)
-
Template access, redirect to internal page
Martijn Geerts replied to Frank Vèssia's topic in Wishlist & Roadmap
You can use your config for it. $config->login_url = '/what-you-want/'; Then from elsewhere just call: $config->login_url or wire('config')->login_url -
Tnx Teppo, learned another great thing
-
Howto: add a banner that rotates pictures ?
Martijn Geerts replied to motionmindz's topic in Getting Started
One minor thing to mention about owlcarousel is the lack of circular slides. I prefer carousels which continues after the last slide. what's realy great about the owlcarousel is the fine-tuning between different screen widths. This could save you a lot of custom JS. When I'm in a hurry with a project I will consider owlcarousel. -
It's because of scope. This answer has been given atleast 10 times on this forum. In ProcessWire we have variables like: $page, $pages, $sanitizer, $config, $user, $input, $templates etc. Those can't be accessed directly in function or class scope. They can be accessed via wire('page'), wire('config') etc. etc. and you can access them inside a class witch $this->pages. ( depending on the scope of the methode inside the class ). The wire('') function can be from accessed everywhere. More information is given on the api docs an throughout the forum here. Don't understand me wrong but I think you should read http://processwire.com/api/ before or while exploring demo's etc. The next question could be, where can I find the methode whitelist. etc. etc. I've read the api docs many times. There's next to loads of information, a way of thinking. It's all written very well & it will make you understand the whole philosophy of ProcessWire and it's enjoyable. At first it's a puzzle, but when the first pieces are in place, the rest will follow.
-
Where do I find the FIND function in the skyscrapers demo?
Martijn Geerts replied to Chris Rosenau's topic in Getting Started
I don't know the skyscrapers profile. But if I see the syntax: $page->skyscrapers <--- skyscrapers must be a field of the type Page ( multipages ) stored in the current page. That field contains a Page array, which can be searched. -
How do I restore MySQL connection
Martijn Geerts replied to Chris Rosenau's topic in General Support
Thats why I always walk with 3 shoes, incase I loose one while walking.