-
Posts
704 -
Joined
-
Last visited
Everything posted by Christophe
-
I'm trying to add a data-uk-lightbox (UIKit) attribute to a <a> tag (in a multilingual body field). I've allowed it in Allowed Content Rules: a[data-uk-lightbox]. I've even tried with a[*]. When I add it in the source code, go back to the wysiwyg editor, and then go back to the source code, it is there as data-uk-lightbox="". When the page is saved, it is removed... Is there a way to add a custom attribute like this one? Do I have to add it to another list somewhere? Edit: I've also tried with a[data-uk-lightbox]{*}. data-uk-lightbox="" gets removed only after saving the page.
-
Hi @adrian, This would be (very) good enough. (Using UIkit,) I could perhaps (also) add a lightbox (http://getuikit.com/docs/lightbox.html) I was thinking of perhaps inserting an image, and when clicking on it the lightbox would appear with the video, perhaps with a black background or another color before it (auto-)starts. Meanwhile, I've found another "solution". Using mp4 files (converted, optimized... by YouTube), they seem to be well played in different browsers. It seems good enough for this project. I'm using a file field (mp4 format only). I'm thinking about using UIKit's lightbox also. It can also just open in a new tab after clicking on a image. Before finding your module I had thought about using videojs, creating pages with a video template, and perhaps fetching a video with a page field(?). But, perhaps your module with your solution is better here.
-
Hello, For a current project (the same that is the first with so many specific requirements, and for which I use some of your modules), YouTube is ultimately not a (good) choice (viewers have to be blocked from being able to go to YouTube from the embedded video). So I've just installed FieldtypeVideo. I've tried to upload a 16.9 (Mo) mp4 video, but the "spinning-wheel" animated icon and the 100% on the red row are still there after several minutes. It doesn't change. I've also tried with a 12.4 (Mo) file. Apparently, the shared hosting (OVH) doesn't have ffmpeg and ffmpeg-php activated. So I guess it's probably the reason... (Or could it be because of the sizes of the files?) Does someone have (alternative) solutions? I know there's vimeo plus/pro (but it's not really a solution for the association). NB: I've tried to hide the YouTube icon at the bottom-right corner with css, but of course it doesn't work/is not "allowed". Perhaps with js(?) If I use Video.js, are ffmpeg and ffmpeg-php still needed? (Yes,) probably. If there's no solution, I'll just let them be downloadable as they were on the old website.
-
Just an idea. Perhaps you (simply) need (to) (add) :focus
-
I've implemented this in ProcessWire: https://processwire.com/talk/topic/6730-js-library-for-simple-product-image-gallery-with-thumbnails-no-lightbox-or-transitions-just-click-and-view/ The result is very nice. But the big image(s) was flickering. Some times the 2 same images, sometimes (also) others. I've tried different things to reduce/stop the flickering, but nothing has changed it. It has always/often been only when clicking the first time on an image (after cleaning the (browser) cache). So I've implemented this one. Having both has apparently stopped the flickering (if it's not due to something else). (Seems somehow logical, perhaps related to the cache...) But now, with this gallery system (which is also nice) it seems almost impossible to make it responsive (I hadn't noticed it wasn't). I'll probably have to find a third solution.
-
I've implemented it in ProcessWire. The result is very nice. But the big image(s) was flickering. Some times the 2 same images, sometimes (also) others. I've tried different things to reduce/stop the flickering, but nothing has changed it. It has always/often been only when clicking the first time on an image (after cleaning the (browser) cache). So I've implemented this one (the last code at the bottom): https://processwire.com/talk/topic/8909-add-simple-html-gallery/ Having both has apparently stopped the flickering (if it's not due to something else). (Seems somehow logical, perhaps related to the cache...) But now, with the other gallery system (which is also nice) it seems almost impossible to make it responsive (I hadn't noticed it wasn't). I'll probably have to find a third solution.
-
I'm sending you a PM.
-
Hello, Version 0.1.9. Now 0.2.0. I don't remember updating something. I've done what is here: https://processwire.com/talk/topic/2074-module-page-edit-field-permission/?p=110990 ready.php doesn't seem to change anything now. "Restricting to the homepage means they now have access to everything, but before they weren't getting access to anything" -> Yes (it's just one user account involved). It was only getting access to this: https://processwire.com/talk/topic/2074-module-page-edit-field-permission/?p=111223 (first two images attached). Coming back with "the contents of the data field for module's settings". Is this what you want?: {"matchType":"specified_parent","branchesParent":null,"phpCode":"","restrictType":"editing_and_view","branchExclusions":[]} Going to bed (it's very late/early). Perhaps going to eat before .
-
Hello, Do you mean the number of branches that are restricted? There was only one. I've just restricted the user (who has/had the issue) to the homepage and now it works. Edit: perhaps it is what should always be done if the user doesn't have the superuser role...(?) But I wonder why this happened, as, if I remember well, I had not changed anything for this user before I noticed this problem. (I'm a little bit "worried" something like that could reappear. But now it shouldn't.)
-
Hello Adrian, Sorry to bother you. References : https://processwire.com/talk/topic/2074-module-page-edit-field-permission/?p=110862 https://processwire.com/talk/topic/2074-module-page-edit-field-permission/?p=111223 All of a sudden, almost everything seems restricted for this user. "How to match user to branch" is set to "Specified Branch Parent". "Branch parent to restrict access to" is (still) set to nothing for this user. (Could it be that an old test setting has reappeared?) Perhaps I should reinstall it and see what happens. Edit: I've rapidly uninstalled it and then reinstalled it (without removing the folder via ftp). I've set it to "Specified Branch Parent". I've only restricted the access (to the "Membres" section of the tree) for 3 users (with the "membres" role). But the user (with the simpleuser role) that I haven't restricted to anything is restricted to almost everything now. It wasn't the case before.
-
Thank you Martijn for the information. I've had a solution starting here: https://processwire.com/talk/topic/2074-module-page-edit-field-permission/?p=111207 But now I have another problem :/. https://processwire.com/talk/topic/2074-module-page-edit-field-permission/?p=111223 ** All of a sudden another issue has appeared (I don't know if it's related in a way or not at all). Now when I log-in as the "manager" user (not the superuser), I don't have access anymore to the page(s) tree and to the users ("membres" role) that I could add or edit. When I click on the Users link I have the following message (translated): ProcessWire: You don't have permission to execute this module - ProcessPageLister I don't understand what has happened... ** I have added attached images. Edit: it's apparently due to Admin Restrict Branch. I have to find why, as it worked well before and I only restricted a Specified Branch Parent for the "Membres" role.
-
Another problem I've just discovered :/, now when I log-in as the "manager" user (not the superuser), I don't have access anymore to the page(s) tree and to the users ("membres" role) that I could add or edit. I've deactivated ready.php (ready_deactivated.php). I've disconnected and cleaned the browser's cache. Now when I click on the Users link I have the following message (translated): ProcessWire: You don't have permission to execute this module - ProcessPageLister What happened? I don't remember it not working before using ready.php (but I can't say I'm 100% sure). I haven't changed anything to this role recently. Edit: it's apparently due to Admin Restrict Branch. I have to find why, as it worked well before and I only restricted a Specified Branch Parent for the "Membres" role.
-
I can't use OR (or ||) in this case, as the template is for a type of page edited by other roles with more permissions. In this project, as it is, I can't currently see if/how (using) // limit code to one template if($page->template != 'planning-child') return; // limit it to user role if(!$user->hasRole("membres")) return; , // limit it to user role if(!$user->hasRole("membres")) return; // limit code to one template if($page->template != 'planning-child') return; or only // limit it to user role if(!$user->hasRole("membres")) return; would be different (or not). I'll test it in the future if I have the opportunity.
-
It works with only if(!$user->hasRole("membres")) return; if($page->template != 'planning-child' && !$user->hasRole("membres")) return; doesn't seem to work. (Perhaps there's a "conflict"...(?)) // limit code to one template if($page->template != 'planning-child') return; // limit it to user role if(!$user->hasRole("membres")) return; as you had put it seems to work. But does this block of code(s) (if used together) mean that both conditions have to be "ok" (or one or the other)? Edit: (or the first one that is "ok"...) For my project if(!$user->hasRole("membres")) return; is enough, but I'm wondering... Thank you so much! (It's one of the only things that last(ed) in order to finish the website.) NB: I'm leaving my "mistakes" in case it helps other people
-
Hi Bernhard, So, I've copied the code in ready.php (or _ready.php): <?php $wire->addHookAfter("ProcessPageEdit::buildForm", function(HookEvent $event){ $process = $event->object; $page = $process->getPage(); $user = wire('user'); // limit code to one template and to user role if($page->template != 'planning-child' && !$user->hasRole("membres")) return; $config = wire('config'); $config->styles->append($config->urls->templates . 'styles/membres.css'); }); It doesn't seem to work as it is. I've also tested it with only if(!$user->hasRole("membres")) return; I've tested it in case with $config->styles->append($config->urls->templates-admin . 'styles/membres.css'); as some Back-end/Admin styles are there. Edit: I've just tried with ready.php in /site/templates-admin *** (The insertion of "-" caused problems when I tested the path to /site/templates-admin/styles/membres.css some days ago, so I tried to add some curly braces, etc. at that moment.) I can't see membres.css loaded with the developer tool(s). *** Edit 2: I've just realized after writing the "Edit" that ready.php has to be in /site I think I've put it in /site/templates because I have an _init.php file there...
-
Can Admin Custom Files be a solution for my problem? Please see https://processwire.com/talk/topic/2074-module-page-edit-field-permission/?p=110990 Users with a restricted role now only can edit 2 fields of a repeater item. But they can remove or add repeater items. I need to hide both "functionalities" with css (or another solution), only for this page with a specific template and when a user with this role is logged-in. Thank you in advance Edit: in this particular case, as this role can only edit pages with this template (that is only for these pages) now, the condition could be only when this role is logged-in.
-
What would be the simplest way(s) to add the following css rule in order to hide the trash icon and the add an item link (repeater) (for a page with a specific template and) only when a specific role is logged-in?: .fa.fa-trash.InputfieldRepeaterTrash, .InputfieldRepeaterAddLink {display: none !important;} Lastly, I've, for example, created a templates-admin folder and a styles sub-folder, and have done some tests, but it hasn't worked yet. Could I put a condition more or less like this one? (and where/how?): <?php if($this->user->hasRole("membres")) { echo "<link rel='stylesheet' href='/site/templates-admin/styles/membres.css' />"; } ?> Thanks in advance. It's an issue because the users with the role can only edit 2 fields inside the repeater item, but can add or remove a repeater item without any problem.
-
Hello Adrian, I've done it with Templates recently, I should have been curious enough/(rested and) taken the time to check (again?) if it was also possible with Fields. Thank you for your post. Now only osteopaths' fields can be edited by them. And I've hidden the Settings tab from them thanks to Restrict Tab View. The only (relatively important) thing left now is that they can remove existing (repeater) items, or add some new ones (it doesn't bother if the 3 non-editable fields are required...). I've tried doing something at the repeater(s) level but I've only been able to make it completely hidden (just seeing a list of ids apparently). Edit: perhaps Admin Custom Files is the solution...
-
_disclaimer.php is now: <!-- This is an anchor toggling the modal --> <a id='dc' href="#disclaimer" data-uk-modal="{bgclose:false,center:true}"></a> <!-- This is the modal --> <div id="disclaimer" class="uk-modal"><div class="uk-modal-dialog"> <div class="uk-modal-header uk-text-center"><h1> <?=$pages->get('/information/disclaimer/')->title?> </h1></div> <?=$pages->get('/information/disclaimer/')->body?> <div class="uk-modal-footer uk-text-center"><a class="uk-modal-close">OK</a></div></div></div> And <script> (function($) { if (localStorage.getItem('isdisclaimerloaded') === null) { $.UIkit.modal('#disclaimer').show(); } localStorage.setItem('isdisclaimerloaded', 1); }(jQuery)); </script> is now in scripts/disclaimer.js I don't know why the modal doesn't want to center vertically as it should.
-
Hello, For an association website, for a member(s) role I have restricted its users: they can only edit the months pages of the Members section of the page tree. But they could see the other pages (sections). So I've used the Admin Restrict Branch module, so they only see the Members section in the page tree. In the months pages I'm using a repeater to add several "events" to each month. But now, the website "contact" wants only the last two fields in the repeater to be editable by the users with the member(s) role. Is the only way/solution still to use PageTable instead of Repeaters? It's the first time I'm using Repeaters, and I haven't used PageTable yet.
-
For the moment, I've always used it. I'll have to try it in inline mode also. If needed, I center images in a paragraph with "Styles". I have already aligned images to the left (or the right) of some text, but have found (again) that it can be a problem when displayed on very small screens, perhaps more when the text is justified. Like others, I also use directly the images field to automatically generate a slideshow, an image gallery... with the field inserted in the template file. Concerning the Files field, I've just noticed that it's possible, for example, to drag and drop a pdf file to the ckeditor field. It automatically adds the link, the text being the name_of_the_pdf_file.pdf. If we go to edit the link, we see that Target is already set to "_blank", which I think is good by default. I don't know if I should add this to the Whishlist Forum, but at least with the image management option, I think it would be perfect if it would let the Title field "empty" and just use the Description of the image (Images field) for the alt tag. Without the image management option, it could directly use the Description of the image for the "Title" field. Currently it adds the name_of_the_pdf_file.pdf to the "Title" field, which isn't really necessary. Edit: I've just noticed/realized that it apparently works when there is only one pdf file in the Files field. Because then, even if I click on the pdf link, the "row" is moved instead of the link. It would be nice if, with Shift, Ctrl or something else, we could do it even with multiple files. But I guess it wouldn't be very practical if there were too many files (rows).
-
Forget (almost) everything I've said :/. It was because I had forgotten that I still had <?php if(!$session->noPop) include("./_disclaimer.php"); $session->noPop = 1; ?>a#dc {display: none; color: transparent;} at the top of home.php. I don't know if it's "good" to mix this with the "script". I was not fixing the correct "version" of the code. I've added the #dc id in _disclaimer.php and have removed the same code in home.php. I'll use a#dc instead of a[href='#disclaimer']: a#dc {display: none; color: transparent;} I've removed "Open". NB: not enough sleep apparently these last days...
-
I've tried with this code: <script> (function($) { if (localStorage.getItem("isdisclaimerloaded") === null) { $.UIkit.modal('#disclaimer').show(); } localStorage.setItem('isdisclaimerloaded', 1); }(jQuery)); </script> It seems to work. But after clearing the cache and reloading the page what happens is that the "Open" link that is normally hidden (#dc {display: none;) appears at the top left corner of the browser window. In fact, id='dc' is not longer in the anchor tag at that moment. It is removed apparently. The page has to be reloaded a second time for it to disappear. It works also when going on another page and coming back of course. It seems "logical" because of the #disclaimer id. Any "trick" to not have the link visible on the first page load? NB: cookies would perhaps be better for "old" browsers Edit: I have "Uncaught SyntaxError: Unexpected identifier". At least with webkit browsers. I'm adding a[href='#disclaimer'] {display: none; color: transparent;} I also want to simply remove the "Open" text between the anchor tags but it doesn't seem to want to disappear in the developer tools (for the moment).
-
I've just copied it from https://yootheme.com/support/question/79225 after having done a quick search . This time I haven't really tried to understand (for the moment) what I've copied. It's all new to me. Perhaps it's easy to add some thousand seconds before it "reloads" again? "I was really surprised why you are asking this when you are developing awesome modules with ajax field reloading at the same time" Are you talking about the last "script" I added? Or are you talking about another Christophe? NB: I've changed the script to (function($) { $.UIkit.modal('#disclaimer').show(); }(jQuery)); as it is at the very bottom of the page.
-
Ok, so now I have this at the bottom of home.php: <?php // This is an anchor toggling the modal echo "<a id='dc' href=\"#disclaimer\" data-uk-modal=\"{bgclose:false,center:true}\">Open</a>"; // This is the modal echo "<div id=\"disclaimer\" class=\"uk-modal\"><div class=\"uk-modal-dialog\">"; echo "<div class=\"uk-modal-header uk-text-center\"><h1>{$pages->get('/informations/disclaimer/')->title}</h1></div>"; echo $pages->get('/informations/disclaimer/')->body; echo "<div class=\"uk-modal-footer uk-text-center\"><a class=\"uk-modal-close\">OK</a></div></div></div>"; ?> <?php include('./_foot.php'); // include footer markup ?> <script> jQuery(document).ready(function($) { $.UIkit.modal('#disclaimer').show(); }); </script> It works well apparently. I still need it not to bother the visitor if he/she comes back on the homepage: cookie, session... Does somebody know how to do this?