-
Posts
6,798 -
Joined
-
Last visited
-
Days Won
158
Everything posted by Soma
-
ColorPicker Custom Fieldtype/Inputfield for ProcessWire 2.+ This module gives you a new custom Fieldtype. Let's you select a color using a Colorpicker jQuery Plugin. The color selected will be stored in HEX format uppercase: "EAEAEA"; To use it in your template as a background HEX color, you'd simple output the value and prefix it with a #: echo "background-color: #" . $page->color; When creating a new field in the admin, you can set a default value the field should be prefilled with when creating a new page. The field supports a "reset" button to be able to set it back to the default value. The colorpicker used: ColorPicker jQuery Plugin by Eyecon Since 1.0.6 the colorpicker supports color swatches to add predefined colors for easy selection. Thanks @Rayden for the implementation. How to install: Download the contents of this repository and put the folder renamed as "ColorPicker" into your site/modules/ folder Login to processwire and got to Modules page and click "Check for new modules". You should see a note that two new modules were found. Install the FieldtypeColorPicker module under "Field" section. This will also install the required InputfieldColorPicker at the same time. Done You can now create a new field with the "ColorPicker" Fieldtype. Get it from modules section: http://modules.proce...e-color-picker/
-
Is this a proper way to get an image from the Home page?
Soma replied to MarcC's topic in General Support
Maybe try a var_dump on $newsletter->sidebar_image or alike to track down the problem -
Just noticed that when I use the clone function for a FieldsetTabOpen, it doesn't clone the closing field.
-
Videos inside processwire: How to embed videos inside processwire?
Soma replied to jester.vergara's topic in FAQs
ProcessWire's TinyMCE is configured to not allow all tags. There was some thread concerning exactly this subject not so long ago. that might help. In the field settings you'll find the TinyMCE advanced configuration settings under "input" tab. Otherwise it's also possible to setup a textfield you would only put the video url into, and use that in your php template, so you don't need to enter the whole code in the RT. Depends what you want to do but I would go with this. -
From the thumbnails module thread: <?php $page->image->getThumb('thumbnail'); // single image field $page->images->first()->getThumb('thumbnail'); // multiple images
-
Thanks Ryan for testing. I do "exactly" what you do. Hmm, not sure what's causing it. I've run a few tests. It didn't happen on a local test install, but on the zueblin.ch website I did. I've removed the bramus css extras plugin to make sure... still same issue. I have 2 TinyMCE fields on same template, so I thought this might be the next one to try. And then I tried to reproduce on my local install and I got same issue suddenly! Can you also try?
-
I just discovered a bug I think. While tracing down a PW site with lots of assets and pages to scan for all images and links in the RT text fields, I discovered that there's some multiple links that appear to be empty, not visible. So I figured that when inserting a external link in the RT, using the PW link dialog, then afterwards open it again to edit, it then inserts a invisible empty <a href="someurl"></a>" right before the link meant to be changed (which stays untouched). I'm sure it's not browser specific, but my guess is that the PW inser link plugin need a check. It only seems to fail with manually entered external links. I would consider this urgent to fix soon. I now need to go manually go through all them because it isn't something the client nor me have known. Though with the bootstrap script I wrote to scan whole site and look for such things it's a whole lot easier thanks to the easy as pie API. Thank for anyone confirming/reproduce this bug.
-
You're right, thanks for the suggestions. But I need the blank values to be 0 for the chart, so I implemented a check that sets not filled in fields to 0. I know it would be possible to check for them in the output, but wanted to make it simple as possible. Thanks for pointing out the typo! Must have been sleeping...
-
I'm in need of a special inputfield with multiple input form fields. I created a little Inputfield extending InputfieldTextarea and using it for storing the values as json encoded string. Seeing an example of Ryan recently using this technique I went and tried to do a little custom Inputfield. I got it working so far with a little try and error, but wanted to have feedback, if there's anything done wrong or could be done better. I need this to store numeric values for the 12 months. These will be used to render a chart on page. So I first did a simple textarea and having each values on a new line, but wanted something more intuitive and convienient for the client to enter the values. (I know it would also be possible (and maybe better solution) to write a complete new Fieldtype/Inputfield, but I'm not really into it yet and would need some help. But this was kinda simple and does the job, only drawback is that it wouldn't work with selectors as it's stored as json in a text field in db.) Here's my code: <?php /** * ProcessWire Custom InputfieldMonths * * Inputfield that stores numeric values for the 12 months of a year. * */ class InputfieldMonths extends InputfieldTextarea { protected $months = array( "January" => "jan", "February" => "feb", "March" => "mar", "April" => "apr", "May" => "may", "June" => "jun", "July" => "jul", "August" => "aug", "September" => "sep", "October" => "oct", "November" => "nov", "December" => "dec" ); public static function getModuleInfo() { return array( 'title' => 'InputfieldMonths', 'version' => 100, 'summary' => 'Stores 12 integer values for months of a year', 'permanent' => false, ); } public function init() { parent::init(); } public function ___render() { $values = json_decode($this->value,true); $out = ''; foreach($this->months as $label => $name) { $out .= <<< _OUT <p> <label for='$name'>$label</label> <input id='$name' name='$name' value='$values[$name]'/> </p> _OUT; } return $out; } public function ___processInput(WireInputData $input) { foreach($input as $key => $val) { if(!in_array($key, $this->months) or $val === '') continue; if(!is_numeric($val)) return $this->error("Wrong format. Value '$val' is not numeric!"); } $months_values = array(); foreach($this->months as $month) { $months_values[$month] = $input[$month]; } $data = json_encode($months_values); if($this->value != $data) { parent::trackChange('value'); $this->value = $data; } return $this; } }
-
WELL, the "invisible" button is still there after to open it again... Edit: Button is actually like 10% opaque...
-
Erhm no I mean yes I got Email noti .. I did nothing just wait dunno why. I also got yours from this message
-
WOhoooooooo I got a notification! Apeisa thanks!
-
There's actually two x button there when you hover over recent topics box. The overlaying blackish one will hide the sidebar forever. Works for me.
-
Just wanted to hook me in. Great idea Nico. Thanks for the module! I will check it out soon, as it's a often requested feature.
-
Hey welcome cbuck! You're not an idiot, it's ok to ask and feel dumb... You should be able to easily grab page using an instance of the category page for example.. <?php $cat = $pages->get('/blog-categories/news'); $pa = $pages->get('/blog/')->find("pagefield=$cat,template=blog-entry"); // "pagefield being your page reference field used for the categories you could also check with multiple (PageArray) categories. Same goes for sections, just combine them if you wish. You would just cycle through your categories/section and use the page object to find all blog entries with the code above. Pretty straight forward.
-
Whoohoooooo! This is great! Great done Pete and Ryan! Only thing I recommend would be to turn off some formating in the RT. No?
-
Hey and welcome transpix! Thanks for sharing that site with us. Great to hear you enjoy ProcessWire. Feel free to share even more Project specific informations.
-
Progress on ProcessWire 2.2 and overview of multi-language support
Soma replied to ryan's topic in Multi-Language Support
Awesome stuff Ryan as always. Interesting read for sure! Thanks so much for this. ;D -
Just a question. How about making it possible to insert cropped images in tinymce too? Would it be possible?
-
Very interesting thread going here Cool to know these.
-
Thanks guys for the answers and suggestions. I think Chrome Frame would be a possible solution to temporary make it work in IE7. I will make some tests. Thanks Nikola for testing out, haven't got the time to test out and I just thought I would ask if there's a specific reason. That's pretty much what I thought would make problems in IE7. I think the layout things would be the easiest to fix, though I'm not sure I would take that path anyway. I used to do it for a decade now, time to move on Well the "deal breaker" would be in using PW as the CMS for this project and not the job itself though. But we would like to use PW, as it would be a good fit.
-
Just curious why you didn't support IE7? Is there any main functionality that isn't working in IE7 or just html/css reasons? I'm just wondering if we could manage to make it work with IE7. We're currently doing early prototype work for a client's intranet. It's a big client and they internally mainly work with IE7-8. So this could be a deal breaker in the worst case.
-
Progress on ProcessWire 2.2 and overview of multi-language support
Soma replied to ryan's topic in Multi-Language Support
I finally got a little more testing with the new admin language modules. I really think it a great solution, and it's now easy to install and manage. Now also checked out the new language text fields. Thanks for those. They can be very helpful I guess. But I question wether it's good to have them in the same fieldset or better using tabs. That way it would be more separated for editors. Or it may would be cool to allow seeing only certain language fields by a user. Just thinking out loud. One thing I experienced was when changing the fieldtype to TextareaLanguage, and save it, the Label/Descr texts entered in the secondary language gets cleared. So I have to reenter them. When I switch back to Textarea.. they again get cleared. -
Problem is this technique is used using a mix of positioning in % and negative left margin. So if you resize your browser the left part of the container get shifted outside browser window. It may not the way to go anymore with fluid responsive layouts, although there could be media queries being used to adapt to window size. I used this technique myself a few years back and decided to get away from it. Just my experience with using it, everyone has to decide on their own.
-
I think it may could be because of Nicos favorite center position technique on the main container (as pointed out in a other thread one I wouldn't recommend ) hint: #home { font-size:13px; left:50%; margin-left:-480px; margin-top:100px; position:relative; width:960px; }