Jump to content

ngrmm

Members
  • Posts

    414
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by ngrmm

  1. @lenoir you could also use the builtin option in the backend here: setup > templates > your-template > advanced > List of fields to display in the admin Page List
  2. assuming your other template name is championship you could do this in your player.php template $playerChampionships = $pages->find('template=championship, winner_name=$page->id'); foreach($playerChampionships as $championship) { // … }
  3. @ryangorley there is also the option to separate tags and categories from your blog tree structure and use URL segments. This way you could create URLs like /blog/tag-A/ and /blog/category-A/ at the same time
  4. @Jhin AFAIK there is fixed number of status options (locked, unique, hidden, unpublished, …) which you can set or check. Therefore you could add a checkbox field to your template. Then you could set the status in the backend or via API.
  5. @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'); } });
  6. @BitPoet I've not tried it yet, but would this be not possible with a hook on page save out of the box?
  7. 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/.
  8. 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>
  9. @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.
  10. 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.
  11. @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.
  12. 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?
  13. @flydev just for you to know, I asked Ryan about InputfieldFrontendFile His Answer:
  14. @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?
  15. @kater do you have more than one language installed but not activated? And give it a try and replace the title field with another text field,
  16. 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.
  17. 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 } }
  18. Is it a field inside a repeater matrix? Sometimes you need to save the repeater field again, after changing the ck-editor-configs.
  19. 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.
  20. @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.
  21. @poljpocket But even if i manage to give them access to the right pages. Once they are there, they would see the adminbar …
  22. @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?
  23. 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.
×
×
  • Create New...