-
Posts
2,769 -
Joined
-
Last visited
-
Days Won
31
Everything posted by Martijn Geerts
-
Your ImageMinSize Module will be a real good friend for Image Interceptor.
-
I love this addition, Thank You Soma.
-
Hanacode is cool, I used it in combination of tags. (image tags) [[images tags="cars bikes boats"]] Now you could render albums instead of images when there are more then 6 photo's groups or something. There are two annoying things about HannaCode 01. after save it returns to the list of hana codes. 02. I can't use tabs. --- ps, Maybe we need a repository of good Hanna Codes.
-
I tried this module and it works great ! A little thing about the CSS: /* Most Frameworks render with box-sizing: border-box;, but your CSS is made for content-box */ #weather { box-sizing: content-box; } #weather * { box-sizing: content-box; } /* prevent scrolling & box collapse */ #weather .current { overflow: visible; }
-
I do like it, Thank You Nikola !
-
Dive into Fieldtypes, they handle data storage/cleaning before putting in de db. Take a look at the mapmarker Fieldtype or soma's range slider. They both have an Inputfield and an own Fieldtype.
-
Changed the name to ImageInterceptor, tnx Adam
-
Thanks Marty, I didn't thought about that. I will investigate it.
-
@adam a recognizable (can see what it does name) has my preference. I like the name ImageInterceptor all though it sounds a little to advanced for the task it does. I will keep this name in mind. @Marty, squared images are now considered as portrait. In my experience most customers just drop in images if they can ( I almost always disable image input in WYSIWYG ) I can think of using image tags on the image field to give some control. When giving images a tag of logo. it wil be less wide then other images. or have a higher density of pixels. (Soma had a nice math script for "visual image weight", calculation also based on aspect ratio)
-
Give it a good name, you're welcome.
-
TextformatterImageInterceptor ( Textformatter module ) Let editors use WYSIWYG images, but let you control the image size, aspect ratio & behaviour. How to install Copy the TextformatterImageInterceptor.module file to your /site/modules/ directory (or place it in /site/modules/TextformatterImageInterceptor/). Click check for new modules in ProcessWire Admin Modules screen. Click install for the module labeled: "Image Interceptor". Go to the module config screen and set the settings you wish. How to use Edit your body field in Setup > Fields (or whatever field(s) you will be placing controlled images in). On the details tab, find the Text Formatters field and select "Image Interceptor". Save.About the settings Render Inline styles If checked, some inline styles are added to the image.High Density Double the pixel width of an image if the percentage is not set. (fixed image size)Default there are settings for landscape & portrait images. Squared images will inherit all settings belonging to portrait settings and there's a way to escape the default settings. But before we dive deeper in tagged sets I want to spread some light on the landscape/portrait settings. All images portrait/landscape wil get the class name .default. ps, All images including tagged set images get the image orientation as class (.landscape / .portrtait) Percentage The width of the image in percentage. This setting makes the image responsive or if left blank the image wil be fixed size. Images receive a .responsive and a .p-50 class (where 50 is the width in percentage) Width The width of the image in pixels. So the width of the image in percentage and the pixel width combined wil be the key to pixel desity. Alignment There are 5 different ways to align an image. left, center, right, inherit (inherits from the WYSIWYG editor) and not aligned. If render inline styles is checked the aligment wil be set directly in the inline style of the image. Alignment classes wil be added to the image. Aspect Ratio (cropping) if an aspect ratio is given, the image will be cropped to the given ratio. If you type 2:1 in the landscape settings. Images 800 pixels wide, will be croped to a 800x400 image. The image gets the following classes: .cropped and .crop-2x1 Image Captions Type here your class name(s) for the caption. When a class name is provided and an image has a description, the image is wrapped (if not already) and *has-* is set in front of the class name(s). For the caption a div is created with the class name(s) and the image description as text. Next to these settings. You can give custom classes to images. This way you can give it framework specific classes for example. And you're allowed to wrap the images with custom HTML. (Some frameworks needs additional HTML to make images more fancy) Then additional styles could be added to images if render inline styles is checked. Tagged sets Tagged sets are an image tag followed by settings specific for images with that tag. To enable tagged sets, the image field need "Use Tags?" to be checked. Go to setup, then fields go to your image field and under the details tab check "Use Tags?". Taged sets are a good way to escape the default image behaviour. Say you have a bunch of nicely ordered images on the page, but you want to show a company logo on 150px floated left. With tagged sets it's no problem. type: (logo 150px left) on one line and you've created your first tagged set. (don't forget to tag the image to) If you want captions for a tagged set, keep in mind that captions need at least 1 class. The format to enter: caption.class-name. For an image wrapper we use the same rules. The only difference is we start typing wrapper followed by class names starting with a dot. example: wrapper.logo.stand-out. You can have a multitude of sets, every set on it's own line. Every set needs at least a tag-name and a pixel width. Note: If you use a wrapper or captions (wrapper will be created if none is set), the inline styles and specific width & alignment classes will be set to the wrapper and removed from the image. This way no duplication of styles wil take place. github modules directory
- 42 replies
-
- 14
-
-
Can't get $data set in TextFormatter
Martijn Geerts replied to Martijn Geerts's topic in Module/Plugin Development
public function __construct() { foreach(self::$defaultConfigData as $key => $value) { $this->data[$key] = $value; } } Did solve it in the contruct... -
Hai, Somehow I can't set $data after installing this TextFormatter. ( TextformatterImageHijack ) Some how the $this->data needs a click on the submit button in the Module settings befor it gets populated. TextformatterImageHijack Changed link to Git Hub
-
Massive is a relative thing. If you talk about millions of pages it could be massive. If you compare with facebook it's tiny. I think the big issue is the disc space & how much files could be indexed by the file system. If you go over the limit a filesystem can handle there could be a "problem". If it is that big think about how to handle your assets. There are a lot of post on this forum about scale, give your self time to investigate.
-
Early stage InputfieldMailChimpCampaign
Martijn Geerts replied to Martijn Geerts's topic in Module/Plugin Development
On the __contruct(), the MailChimp Api class gets called looks like there's something broken there. The MCAPI.class.php should be loaded there. I strongly advise not to use this plug-in now. As it is standing still for months now. Recently I started to look at it again. ( Actually I'm busy with it now, building in Segmenting options ) My wish is that it will be workable soon, but time's not on my side. ( Next weeks gonna be very busy, vacation, doing nothing but drink beer & make some fun) I will post it here when it's in Beta... -
Hi kyle, The below code should do it (not tested, just wrote it in the browser) Markup: $html = "<h3>Condimentum Purus</h3><p>Cras Sollicitudin Vulputate Nullam</p>"; $markup = $modules->get("InputfieldMarkup"); $markup->set("label", "Label for this"); $markup->set("value", $html); Default selected: $needed = "ProcessWire"; $array = array( array( "cms" => "Joomla", "value" => "If you don't mind code" ), array( "cms" => "modx", "value" => "Good for trouble shooters." ), array( "cms" => "ProcessWire", "value" => "Great, we selected this." ), ); $select = $modules->get('InputfieldSelect'); foreach($array as $option){ $attr = $needed == $option['cms'] ? array('selected' => 'selected') : null; $select->addOption($option['cms'], $option['value'], $attr); }
-
'Maximum nesting level reached' at each edit in backend
Martijn Geerts replied to jtborger's topic in General Support
Put: max_input_nesting_level = 200 In your php.ini or other php config file. -
Does all folder in assets have the correct permissions ?
-
Type in your home template or else. $u = $users->get('admin'); $u->of(false); $u->pass = 'superSecretPassword'; $u->save(); Then go to a page with that template. Then go to /processwire/ & login. --- I almost forgot: Welcome Bosse1981 !
-
Thank you pete!
-
I don't think it's an error, LanguageLocalizedUrl was build far in the future.
-
It looks like LanguageSupportPageNames (2.3.1) doesn't support URLs that doesn't end with a trailing slash. Will it be supported in the near future? note: /processwire/styles.min.css looks so much nicer then: /processwire/styles.min.css/
-
maybe: $pages->find("parent.template=accounts, created<=-1 day"); Didn't read your post very well
-
Module: MarkupCSScompress 0.8.5 (beta) convert $config->styles array to a single gzipped & cached CSS file and give <link rel="stylesheet" src="/processwire/styles.min.css/"> tag back. I love using the $config->styles array on the front-end. One disadvantage is, I like it that much that I end up with a multitude of styles with their corresponding links. To much requests for the browser if you asked me. So my thought was: I wish I could combine all styles, compress the css and serve 1 link back to the browser. But I don't like struggling to find CSS selectors in a compressed file. So I add the setting: Caching & concatenating disabled for superusers. For caching I used Ryan's beautiful MarkupCache module. Cons: Doesn't work with external CSS files ( All CSS files have to exist in processwire )How to use: ( important ) Put the MarkupCSScompress.php into the template folder. Place <?php echo $modules->get('MarkupCSScompress')->render(); ?> in the head where normally the CSS <link> would be. Install this module. Totally open for changes & improvements. download from github view on github modules on PW Todo: Change al relative urls to absolute urls in the CSS cache files. ( done ) Check PW version compatibility
-
Somehow it's solved... I don't know how it happend. Sorry for your time! I think the Fieldgroup already existed and I tried to create another one with the same name. Deleting the fieldgroup belonging to the template in the DB did solve the issue. ( I also deleted fieldgroups_fields with the corresponding fieldgroups_id ) Couldn't find any topic / tutorial or docu on how to do this with the api: $fieldgroups = wire("fieldgroups"); // don't know if $fieldgroups is direct accesable in the templates $template = $templates->get("a-template"); $fieldgroupId = (int) $template->fields->id; $fieldgroup = $fieldgroups->get($fieldgroupId); $templates->delete($template) $fieldgroups->delete($fieldgroup);