-
Posts
6,798 -
Joined
-
Last visited
-
Days Won
158
Everything posted by Soma
-
How to figure Multilanguage Images with one image var ?
Soma replied to iNoize's topic in General Support
No no function "And it will choose the right one depending on language." Readup http://processwire.com/api/multi-language-support/multi-language-fields/#language-alternate-fields somefield //default somefield_fr / must match a language name "fr" And PW will look for them and take care of which field is used according user language of course. 1. I think for carousel I would create a image per page and add language alternate fields for each language. Then create the slider from the those pages. 2. Or use the new core PageTable field to handle the slider. in the end it's the same as 1 as it creates a page for each PageTable entry, but nicer editing features. 3. Repeaters are still nice to also handle sliders, again each item is a page at the end anyway. ... not sure, it's what you have and it works fine. This is also one of those cases you wish there were no languages I had to always deal with these sort of things and while it can't be simple it has to be complicated. An image has language descriptions that's enough most of the time, but there's cases where the image also has to be translated. PW doesn't have an image field that could stores an image per language (yet), which is a shame kinda If you'd ask Ryan, he would response with my first post, that you can use language alternate fields for that. But it's not always the optimal and most practical solution. And it's really a edge case. In projects I work they're most likely often "Institutions etc" they like to have images of graphs and Political images that exist in various languages, flyers etc etc. After all it would be nice to have, and if PW could in some way support that, it would be really cool. -
Actually I have no AB anymore since 1-2 years. What framework? Yeah it's only half namespaced, I was about to add it but thought hmm it's so nice and short! The UL has the module class name, i'll add them to all classes or make it a var so it could be configured in case.
-
No problem. I was waiting for your facepalm post Looks nice!
-
I'm not seeing anything here. Well I'm innocent and it doesn't make sense as there is nothing. Have you installed ad blocker or any plugins ? What browser?
-
There's nothing in my module that makes them hidden, so it must be your CSS? E-mail has no "popup" class for example. Can you verify?
-
Adding image or file field to a module configuration
Soma replied to Hari KT's topic in General Support
There was many changes to file or images and overall, I had once in ImageManager used a InputfieldFile on a process admin module, set the upload dir etc, and then loaded the file from there to create image pages. But then since 2.5 I think it didn't work suddenly, and I couldn't get Ryan to explain what happens (as so many times) So I'm not sure what's working and what not anymore. Well after hours of trying and thinking I got it working, just something I can't make sense of it. All I remember was that the admin page is used to upload the image from a InputfieldImage, where before it wasn't. This code is interesting, but as said I have no idea what worked and why. https://github.com/somatonic/ImagesManager/blob/master/ImagesManager.module#L173 Ohhh, and you might be on a module settings config screen you are having this? There it won't work anyway as there's no page! -
@sinnut, yeah that's the purpose of why I made the module public. Donations welcome
-
Adding image or file field to a module configuration
Soma replied to Hari KT's topic in General Support
$field = wire('modules')->get('InputfieldFile'); That's a Inputfield not a Field! A field is something you add to a template/page and an Inputfield is only the input, so no storage for the image. -
How to figure Multilanguage Images with one image var ?
Soma replied to iNoize's topic in General Support
Alternative language fields maybe? image // default image_fr // alternative for "fr" lang image_en // alternative for "en" lang In template use echo $page->image->url; And it will choose the right one depending on language. -
There's no Page::localUrl on a 404 page in case you have a language switch using localUrl. Edited title... Can you let us know the PW version please uh?
-
Erm, use https?
-
MarkupSocialShareButtons This module outputs a list of share links for the following services by default * E-Mail (kinda extra) * Facebook * Twitter * Google+ * LinkedIn * Thumblr * Reddit (off by default) * Pinterest (off by default) Usage examples echo $modules->MarkupSocialShareButtons->render(); This outputs a simple UL list with links <ul class='MarkupSocialShareButtons cf'> <li class='mssb-item mssb-facebook mssb-popup'><a href='url'><i>facebook</i></a></li> etc ... </ul> Config Screen See more details and examples on github or modules directory https://github.com/somatonic/MarkupSocialShareButtons http://mods.pw/8j
- 74 replies
-
- 16
-
My ImagesManager also supports reading exif data and saves it to a field.
-
SFTP for sublime has many features like sync, monitoring etc. Quite handy. When I need it I use https://sublime.wbond.net/packages/LiveReload with the Chrome LiveReload extension.
-
SFTP http://wbond.net/sublime_packages/sftp
-
https://processwire.com/talk/topic/3601-field-label-language-problem/
-
Access $page and $pages Variables from inside a Javascript File?
Soma replied to bytesource's topic in API & Templates
What I do is use $config->js to populate the config array that I then output in the head for dynamic variables that want to share in a script. $config->js("myconfig", array("myajaxurl" => $pages->get(1991)->url); You can do this in templates or modules doesn't matter as long as it's before rendering page. Then this little to output as json. This is the same as PW uses in the admin to share config vars with js. <script type="text/javascript"> <?php // output javascript config json string to html // for use in javascripts from this point on $jsConfig = $config->js(); $jsConfig['debug'] = $config->debug; $jsConfig['urls'] = array( 'current_url' => $page->url, 'root' => $config->urls->root, ); ?> var config = <?php echo json_encode($jsConfig); ?>; </script> Then use in your script as var rootUrl = config.urls.root; for example- 4 replies
-
- 15
-
You can also PW API since 2.4 or 2.5 echo $page->blog_tags->implode(", ", "title");
-
kixie is right. Sorry, just to correct mine it would be index 2, because 1 is root parent and 0 would be root (home). $bar = $page->parents->eq(2); Just to summarize if called from the children // works $parent = $page->parent("parent=$page->rootParent"); // works and same as $parent = $page->parent("parent=1001"); // where 1001 would be /foo/ // works $parent = $page->parents->eq(2); $parent = $page->parents("parent=$page->rootParent")->first; // even works when on the parent itself $parent = $page->closest("parent=$page->rootParent");
-
I use $p = $page->parents->eq(1);
-
Issue seems with InputfieldCropImage.module rendering and testing if user is allowed to edit the current page, which is not there. It's not on context of a page edit. User profile doesn't have a "page" editing with an url param "id". Even if, the user isn't allowed to edit "user” page. ProcessProfile #67 fails $inputfield->value = $this->user->get($field->name); InputfieldCropImage.module in renderItem() fails and throws empty exception $page = $this->pages->get((int) $this->input->get->id); if(!$page->id || !$page->editable()) throw new WirePermissionException(); // empty
-
I found by searching the forum for your image name "professionnel_photo" that it is a crop image (apeisa thumbnail) field. CropImage isn't compatible with user profile page editing. I tried adding a cropimage to user template and make it editable on the profile. It works fine but after trying to add an image I get same error as your's and can't edit profil anymore.
-
From the error. Looks like you have a field dependency on a field using "role" field. First, "role" isn't a field but "roles". Second, roles aren't shown on when you view/edit your profile. It's not the same as editing a user.
-
This would be just meant as an example! - Maybe this could lead to problems if you don't test for if the image is really an image before loading into the images field (local disk). Would need confirmation through if PW isn't already checking (?) - Copyrights? - Probably could need some check for allow_url_fopen (not sure either on this one) (Make it your own and modify)
-
Edited: little buggers