ngrmm
Members-
Posts
446 -
Joined
-
Last visited
-
Days Won
3
Everything posted by ngrmm
-
Making unpublished changes to pages that require approval?
ngrmm replied to mpdude's topic in Getting Started
@mpdude try this hook – Create a role for user, who should not be able to publish pages – Put this in ready.php file in the site directory $wire->addHookBefore('Pages::save', function(HookEvent $event) { $page = $event->arguments(0); $userRole = wire('user')->role; $page->of(false); if($userRole == "your_user_role_which_can_not_publish_pages") { $page->status('unpublished'); } }); -
Making unpublished changes to pages that require approval?
ngrmm replied to mpdude's topic in Getting Started
@BitPoet I've not tried it yet, but would this be not possible with a hook on page save out of the box? -
I think what happens is this: When you try to view [localhost/myprocesswiretestsite]/informations-generales/ processwire does not find any associated template and gives you a 404-Error. And your 404-Error-Page has the basic-page.php template. This is how it supposed to be. This happens also if you type in [localhost/myprocesswiretestsite]/qwer1234/.
-
strange, It worked for me. I pasted this and it got stripped with the default settings. After adding video to the pastefilter whitelist it stays. Which tags get stripped for you? <video width="320" height="240" controls> <source src="movie.mp4" type="video/mp4"> <source src="movie.ogg" type="video/ogg"> Your browser does not support the video tag. </video>
-
@TomPich welcome! Happy for you escaping WordPress. If you create a page in the CMS it always needs a template. This template defines which fields it has, handles access etc. … This is the backend part. In order to display this page under the it's own path you will need a .php-Template file in the dir site/templates/your-template-name.php So for your need you could do this: – create a new template in processwire Setup > Templates > add new – add your fields to this template – create a page with this template somewhere in the page tree As long as you don't create a php-template file for it, you will be not able to display it under it's own path. But you still can use the content of this page in other php templates.
-
You have to look for it in the module settings, not in the field settings Pastefilter whitelist is the section. Paste in this: p, strong, em, hr, br, u, s, h1, h2, h3, h4, h5, h6, ul, ol, li, blockquote, cite, a[href|id], a[target=_blank], img[src|alt], img[class=align_left|align_right|align_center], table[border], thead, tbody, tfoot, tr[rowspan], td[colspan], th[colspan], colgroup, col, sup, sub, figure, figcaption, code, pre, b=strong, i=em, video I just added video at the end of the default tags. I guess that the purifier will ignore this tags.
-
@Smirftsch which version of TinyMCE are you using? I usually use CKEditor and there you can allow extra Content in the options of the field. I think with TinyMCE you can whitelist html tags in the module settings. This would effect pasted content.
-
My next project will be a website where registered members can create profile pages and projects as subpages of their profile page I have researched and tried a few ways and this is my favorite way so far: My page tree would have the following structure - Home -- Profiles --- Profiles 001 ---- Project A ---- Project B --- Profile 002 ---- Project A -- Admin --- Access ---- Users ----- Profile 001 – User registration runs through the LoginRegisterPro module. – during the user-registration another profile-page besides the own PW-user is created in the page-tree via API. – Per AdminRestrictBranch the display in the backend is restricted, so that the module FEEL can be used for editing the profile page and the associated subpages. – I would like to avoid any page tree view and let user edit their profile and project only via FEEL and some buttons on frontend (add new Project, delete project, unpublish profile, …) The PW own user page would only be used for authentication or password reset. Therefore I would create another profile page with fields for text and images. Can this be solved more elegantly? Are there other modules I'm not aware of?
-
@Flashmaster82 I guess the new page is not activated in your non-default language? Check the settings tab for that. There is a checkbox on the right side of the second language name field. I never experienced this when using the page reference field in the backend, only when you create pages via API/Hooks, you have to activate non-default languages. Is the superuser creating pages via the field using the default language?
-
I write vanilla css. Well thats a lie ?. I write scss, but only because of lacking css nesting support. I guess in 1-2 years there should be a browser-support over 95%. Nesting is the only scss-feature i use. Everything else is vanilla css. Compiling scss to css is done by ProCache. I'm not a real programmer and have design/art background. Therefore i try to keep my workflow as simple as possible. In my projects I have to develop some „unusual“ layouts and many times the designs change a lot during the development. Therefore over the years the following distribution of files has worked for me pretty well. _reset.scss _fonts.scss (@font-face and sizes as classes) _globals.scss (color-variables, animation-classes and other global classes) _main.scss (for body and main element if needed) _header.scss _footer.scss m_component-name.scss … p_template-name.scss … I don't use components, but my section/article tags have always a unique classname, which correspond with the related php/css/js files. For Example for a image-slider i would have there three files: m_image-slider.php m_image-slider.scss m_image-slider.js .m_image_slider { width: 100%; } Should there be a need to overwrite some styles on a „project“ template, I can do that in a file like p_template_project.scss body.template_project { .m_image_slider { width: 50%; } } And if there is a need to have two different layouts for the image slider on two pages with the same template, I use the page ID. body.id_1234 { .m_image_slider { width: 80%; } } Therefore my body tag has always these two classes: <body class="id_<?= $page->id; ?> template_<?= $page->template; ?>"> That workflow helped me a lot to save time. Most of the the only my section tag has a classname. .m_image_slider { h2 { } figure { img { } } } What I want to say is that css methods have their justification and use. I do not work in teams and as single programmer it is much clearer and flexible to develop my own small method.
-
[solved] How to use a variable inside an expression?
ngrmm replied to ngrmm's topic in API & Templates
thanks @BillH -
Which syntax is need for this? // field names: // field_1 // field_2 // field_3 // … for ($i = 1; $i <= 40; $i++) { if($page->field_{$i} == 'test') { // this does not work // do stuff } }
-
[SOLVED] TinyMCE always adds empty paragraph after saving the page
ngrmm replied to wbmnfktr's topic in General Support
Is it a field inside a repeater matrix? Sometimes you need to save the repeater field again, after changing the ck-editor-configs. -
[SOLVED] TinyMCE always adds empty paragraph after saving the page
ngrmm replied to wbmnfktr's topic in General Support
Not a real fix, but you could activate these two options: Remove empty paragraph texts Remove non-breaking spaces You find them inside the input-tab of your field > Beautify Markup Toggles I had the same issue with imported text from an API. They were using pseudo-elements inside empty headline tags as visual spacers. -
module PrivacyWire - Cookie Management & async external asset loading
ngrmm replied to joshua's topic in Modules/Plugins
@snck had the same problem. And found out, that podigee-player is DSGVO compliant. At least they say it here. Bu I usually use a div wrapper for iframe embeds, so the classes do not get mixed up or replaced. But there is no way if you have to use the script tag. -
@jensweigel thanks for the detailed explanation. In the latest version of RepeaterMatrix you have the option to copy&paste matrixItems across the entire page. Even if the pages has two different templates. You just need the same RepeaterMatrix field. But I can also understand how you create the structure. And with restricting template usage for children there should be no irritation for customers, right?
-
let's say I would use LoginRegisterPro to be on the secure side. There is still the issue on how to edit existing page image fields, without the giving any edit permissions. @flydev There is a page with an image field with some uploaded images. How can you offer en edit form to delete the uploaded images and add some new images? I know that a loggedin user (via LoginRegisterPro, with no backend page-edit permission) is able to edit his own profile page on the frontend. An image field on the profile page would be editable with the help of InputfieldFrontendFile. But I was not able to figure out on how to extend this editing possibility to other templates. Ryan mentioned in another thread that the modules section on processwire.com works that way. An regarding giving access to pw-backend: my problem here is, that a user with edit permission can view the page-tree, use the backend search field, … I would like to only allow editing those pages, which are related to users and nothing else.
-
Actually I will use FormBuilder. The form will create pages. And I will use hooks to generate an email after the page is saved and send it to the user (just guests). In the email the user will find two links. One for deleting the created page and one for editing. The edit link will have the guest email and a random alphanumeric string as url segments. This way they will be able to only edit „their“ pages When they click this link, they would see a form which is already populated. This works with text fields or checkboxes. My Problem are image fields. I do not want the user to have any edit roles or some kind of backend access.
-
Could you describe this method in more detail? Maybe screenshots from the backend?