-
Posts
6,808 -
Joined
-
Last visited
-
Days Won
159
Everything posted by Soma
-
How can I specify default value for certain input field?
Soma replied to PawelGIX's topic in General Support
For things it's may be useful (checkbox) but never felt I ever need it as you could also make it reverse (check to disable). And if then it also can be handled in the template code, if(!$value) $value = 'default'; way. I'm not sure what to think about it really, some part of me likes having default values and some part thinks it complicates things not really necessary maybe. -
This IS the problem yes. Yeah I know I haven't implement the check for zip yet. Thanks for the link.
-
I guess it is working then?
-
That would have to be loooots of cash then. Because you'll need to create a image and a link plugin and also some configuration etc.
-
Dave, can you grab the latest dev version and replace the ModulesManager.module and try again? https://github.com/s...anager/tree/dev
-
There must be something strange. Here's the php bug https://bugs.php.net/bug.php?id=53018 Don't know yet what to try, but maybe it's possible to get around it.
-
As I said the github url does a redirect when using the zip url (button) on the github page. I recognized this but used curl then, so there's a setting to allow to follow. Not sure why it's not working with file_get_contents and redirects on your part. Think it's a php setting or something we'll have to try, maybe a context stream is needed in your case. Also I've seen there's a php bug. What version are you using? Can you try on another install or locally?
-
Yes the github urls are redirected when downloading the zip. Have you got the latest version? It works well on all my installs even with the redirect, not sure what doesn't in your case. Have you tried another download?
-
Is this a proper way to get an image from the Home page?
Soma replied to MarcC's topic in General Support
Any more informations? Does it fail on all or just on some. What line is the error? You could try this modified code: <?php $blog_entries = $pages->get(1008)->children; foreach($blog_entries as $blog_entry) { $blog_thumb = false; if(count($blog_entry->blog_images)){ if($blog_entry->blog_images->first()) { $image = $blog_entry->blog_images->first(); } else $image = $blog_entry->blog_images; $blog_thumb = $image->width(500); } echo "<div class='blog_overview_item' >"; echo "<h2><a href=\"{$blog_entry->url}\">{$blog_entry->title}</a></h2>"; echo "<p>posted on ". date("d.m.Y, H:i", $blog_entry->created) ."</p>"; echo '<div class="blog_preview_image">'; if($blog_thumb) { echo "<a href='{$blog_entry->url}'><img width='{$blog_thumb->width}' height='{$blog_thumb->height}' src='{$blog_thumb->url}' alt='{$blog_thumb->description}' /></a>"; } echo "</div>"; echo "</div>"; } -
A different way of using templates / delegate approach
Soma replied to Soma's topic in API & Templates
I still don't get what you mean. Reading you posts, there's no "dirty hack" needed, it's simple, flexible and straight forward with only 1 line of php code to include the view template. Without that how would your main template know where to include the view? include($config->paths->templates . "view/{$page->template}.inc") There's no need to go fancy here. I wouldn't like if PW would make assumptions on how to use it. -
A different way of using templates / delegate approach
Soma replied to Soma's topic in API & Templates
I'm not sure I understand correctly. "My" approach already does exactly this. The template in PW uses all "main" as alternative, but the template name still exists when main.php is called, so depending on the name of the template the right templatename.inc view include will be loaded. -
THis has been reported already, it seems a bug, fieldsets don't work in custom tabs.
-
Hi ceberlin, thank for your post. Do they have cURL enabled? We could then implement to use it if allow_url_fopen is disabled. I think in case this doesn't work out it could be a simple download link to download and intall it manually.
-
I always use an exit() or die(); after the echo echo $variation->filename; exit(); Ryan the extra "." in the thumbnail filename PW is generating. saskia-smaller.0x100.jpg
-
Maybe some code injection on where they get deleted in Pageimage.php to see if name and paths are correct will help.
-
A different way of using templates / delegate approach
Soma replied to Soma's topic in API & Templates
Ah, yes then you would have to include the function to each template file. That's one reason I don't like Ryan's approach. Though no issue at all, just personal preference. Edit: Yes a module would help here, that provides function for all templates. -
A different way of using templates / delegate approach
Soma replied to Soma's topic in API & Templates
Of which method here are you talking about. With my approach the main.php always get's loaded and then the template of the page is included, so this will work well. -
A different way of using templates / delegate approach
Soma replied to Soma's topic in API & Templates
I'm not sure I understand right, but I would put them in main.php or include them like you would when using a head.inc. -
If you're speaking about Cropimages (module), yes the cropped images won't get deleted. If using regular Image field in PW, the thumbnails will get removed.
-
I think maybe my ColorPicker modules would be good reference to make it. http://modules.processwire.com/modules/fieldtype-color-picker/
-
It's simple and possible to add a custom js to load on page edit. Then the script would listen to the field input and handle the showing of the video. A regular field (text) would suffice, you then need to look at the admin code what class or id you have to attach you're scripts to. If that's what you're after you can maybe make it a simple js module or an autoload module that hooks in after Page::edit or something similar. Let us know so we could sure give you more detailed help to get you started. Edit: of course nothing again creating a simple fieldtype/inputfield module that would be more flexible and dedicated, but little more complex.
-
Hmm. I used double click feature in jstree http://www.jstree.com/ in a project and I think it's done using dblclick event. Never noticed any problems.
-
I think everybody thought about this. SInce I use delegate approach, one main.php that "all" templates use, I have a include to /views/basic-page.inc so it's pretty nice. More possibilities are there using includes.
-
Thanks Ryan! Well he mentioned it on IRC, so I remembered to split it up so it works from a forum post.. not sure it really was about the exactly same, but order of selector fields matters. Some things he recognized he make a post you even liked.
-
Good thoughts. I think the same. Though our clients don't have any problems understanding without anything (default theme). BTW my theme goes the same direction http://modules.proce...odules/teflon/. I think making it possible is nice, although I maybe won't really use it. Depends on the project.