-
Posts
1,523 -
Joined
-
Last visited
-
Days Won
21
Everything posted by elabx
-
Thanks for the heads up!I haven't tried locally but will soon.
- 246 replies
-
- visual studio code
- vsc
-
(and 2 more)
Tagged with:
-
No issues for the moment, except can't get autocompletion to work :D. And yes @bernhard, it is a ProcessWire website with the wire folder and all but I'm guessing it might be the context in which i'm editing (SSH FS) and I'm actually loading as root a public_html with a lot of websites underneath it.
- 246 replies
-
- 1
-
-
- visual studio code
- vsc
-
(and 2 more)
Tagged with:
-
Hi! Is there any configuration to get Intelephense autocompletion to work?? Or does it just need to bee installed and that's it?? Sorry, tried to figure out from the thread but just couldn't ?
- 246 replies
-
- visual studio code
- vsc
-
(and 2 more)
Tagged with:
-
This is the sole reason also I'm stuck in prehistoric emacs setup, to easily work on servers, always a command away from connecting to a server and opening a folder. OMG it's finally here!! Gonna try this ASAP. https://marketplace.visualstudio.com/items?itemName=Kelvin.vscode-sshfs#review-details EDIT: OMG it works wonders, love this.
-
In my experience YouTube always feels a bit clunky in comparison to hml5 video with feels more instantaneos, but could be made to work (I've only got it to be responsive with some js though), I agree the most "slick" solution is to use native html5 video and a CDN. I have personally used AmazonS3/Cloudfront for this.
-
I've gone this way! And used the Google Anaytics API to retrieve the data if needed.
-
Move Composer's vendor folder outside of the web root folder
elabx replied to gmclelland's topic in General Support
Hi! Has anyone found a solutions for this? I have several sites that use the same composer modules i'd love if I could just install them globally for the user. Though suspecting from where the require_once happens, I feel my only choice would be using symlinks? Just made a comment also in the GitHub issue. -
$termine->filter("date>=today")->sort("date")->slice(0,10) I wonder also if this could also work, I could bet it does: $termine->filter("date>=today, sort=date, limit=10"); Keep in mind filter method is destructive.
-
[SOLVED] Best way to assign properties but each properties only once
elabx replied to dotnetic's topic in General Support
Would it work if you setup the properties beforehand? And maybe define a catalogue somewhere else with a page field (I do it in a parent page). So you have a text field and not a select field and one line per property. And set them up in a hook (I've done this in Pages::added if I remember correctly) Although this would requiere all fields to always appear on the page, and exclude them from rendering if their description field is not filled. I have also removed the add new button for this purpose through a hook in the inputfield render. -
Well, had to do this now for including a privacy policy link in a formbuilder label ? $wire->addHookAfter("InputfieldCheckbox::render",function($event){ $field = $event->object; $output = $event->return; $policyUrl = $this->pages->get("name=privacy-policy")->url; if($field->name == "privacy_policy"){ $output = str_replace("privacy policy","<a href='{$policyUrl}'>privacy policy</a>", $output); } $event->return = $output; });
-
[SOLVED] Passing "parent page" to page creation via api
elabx replied to louisstephens's topic in API & Templates
Hahahahaha, early morning support, sorry guys -
[SOLVED] Passing "parent page" to page creation via api
elabx replied to louisstephens's topic in API & Templates
Use double quotes! -
maps Show maps with multiple markers in a reveal modal
elabx replied to Sorina's topic in Getting Started
I got it to work like this! https://jsfiddle.net/elabx/vysjwp01/ -
Check this post from Ryan:
-
I would try using this function: https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Fieldtype/FieldtypeRepeater/FieldtypeRepeater.module#L432 Repeaters items are actual pages that have to be created, hence when you are iterating the field in your code counts 0 repeaters, because no repeaters exist!
-
Is there any other place in the code where you actually create the repeater items themselves? Maybe that's missing.
-
Mmm, I don't think this will be as straighforward, I think this is all performed in javascript: https://github.com/processwire/processwire/blob/master/wire/modules/Inputfield/InputfieldCKEditor/plugins/pwimage/plugin.js Maybe override the whole CKEditor module (copy the whole module to site/modules) and rewrite the line where the img tag is created, which i think is here: https://github.com/processwire/processwire/blob/master/wire/modules/Inputfield/InputfieldCKEditor/plugins/pwimage/plugin.js#L210
-
How to actually run banners on ProcessWire powered website
elabx replied to andchill's topic in General Support
For some simple ad banners with click measurment, what I have done is using Google Analytics as measurement of the click events, i feel it just offers A LOT more out of the box. Let's you filter by a bunch of things, present data in a lot of ways, make reports in Google Design Studio, etc. Though in all honesty, don't know how it compares to the previous solution. -
I was surprised to find out that these are not WireArray! https://github.com/processwire/processwire/blob/master/wire/core/FilenameArray.php
-
Make the user page have a page reference field that lets you create new lists. This would let you either creat all lists in the website under a central page, or with a little hook work have each list of lists living under the user. Let the page reference field include this pages through the selector that return the selectable pages. My first though would be to use another page that relates each list-game with the extra info, you could probably add a hook that automatically adds a page somwhere which holds all this extra fields. Could be something like: - User -- Lists --- List 1 (holds a page reference field to all games) ---- Game 1 (for each game in the list parent field, a page here exists, holding extra fields that can be custom for this particular user) ---- Game 2 All possible with selectors and i think the owner selectro could help here: http://processwire.com/blog/posts/processwire-3.0.95-core-updates/ Doable out of the box with the page reference fields. This are just my first thoughts, maybe someone has a more elaborate solution or sees an error in my conception.
-
Wow! Amazing educational answer, thanks a lot, this kind of conversation really helps anyone move forward, thanks for your dedication!
-
Hi! Wanted to share this and ask for opinions: I see a lot of regex approach to finding/changing links but the DOMDocument class seems very useful, is there a downside to this? Any other comment to improve this? ? (naming convention, code style?) <?php /** * Textformatter to output local links inside RTA textarea fields, as their language equivalents * by Eduardo San Miguel * * ProcessWire 2.x * Copyright (C) 2011 by Ryan Cramer * Licensed under GNU/GPL v2, see LICENSE.TXT * * http://www.processwire.com * http://www.ryancramer.com * */ class TextformatterLanguageLinks extends Textformatter implements Module { public static function getModuleInfo() { return array( 'title' => "Multilanguage links", 'version' => "100", 'summary' => "Textformatter to output local links inside RTA textarea fields, as their language equivalents", 'author' => "Eduardo San Miguel", 'requires' => array( "PHP>=5.4.0", "ProcessWire>=2.5.28" ), 'icon' => 'languages' ); } public function format(&$str) { $dom = new DOMDocument(); $dom->loadHTML($str); $tags = $dom->getElementsByTagName('a'); foreach ($tags as $tag) { $path = wire("sanitizer")->path($tag->getAttribute("href")); if($path){ $possiblePage = wire('pages')->get($path); } else{ continue; } if($possiblePage->id){ $langPageUrl = $possiblePage->localUrl(wire("user")->language); } //If empty? if($langPageUrl){ $str = str_replace($tag->getAttribute('href'), $langPageUrl, $str); } } } } Edit: Already found bugs because I wasn't sanitising the assumed path in the href attributes.
-
The $page inside the Hannah code should refer to dev_button_repeater item, so you can search where it belongs to like this: wire('pages')->get(preg_replace("for-page-",$page->name)); That should return the dev_repeater item of the iteration. Thoug don't have very clear how you are using the hannah code. Maybe like this it would work? Use the parent repeater's image if attr is data-image and no value is set. [[data attr="data-image"]] Set a custom data attribute: [[data attr="data-example" value="Something something"]]
-
<?php foreach($page->dev_repeater as $repeater) { $image_field = $repeater->image_field; foreach($repeater->dev_child_repeater as $url) { $url->hidden_field = $image_field->url; } } ?> I´m guessing something like this should be working right?
-
Yes, this should be doable! https://github.com/ryancramerdesign/ProcessHannaCode (Check PHP Usage Notes) If I understand the docs correctly, the $page variable context will be the repeater page where the image field is.