Jump to content

szabesz

Members
  • Posts

    2,927
  • Joined

  • Last visited

  • Days Won

    19

Everything posted by szabesz

  1. I could provide a few Forum links which deal with issues similar to yours but @maxf5 is right: if you want to render the Repeater Items on individual pages under their own URL then you are better off either using Page Reference fields with Parent/Child relationship in the Page Tree, or you can also use PageTable. Note that a normal PageTable setup is also very similar to a usual Parent/Child relationship setup, however using PageTable has similar benefits as using Repeaters. Repeaters are normally desirable when you do NOT have to render individual pages for the repeaters, such as: galleries, sliders, product variations and so on.
  2. Hi, Isn't it the trendy "rubber band overscrolling" in effect all these browsers seem to prefer these days? Either way, as it is not ProcessWire related, probably this topic should be moved to "Dev Talk".
  3. Hello @zaib I'm not quite sure what your issue with repeaters is. Can you please be more specific? Here are the docs if that helps: http://processwire.com/api/fieldtypes/repeaters/
  4. Currently I am in a situation when a PageArray does not fit the bill: By the way: I kept talking about "one-to-one" when actually what I need is "one-to-many", meaning I need a Single Image (one) selected by VPS from many. I do not need many-to-many as I deliberately want to simplify things.
  5. If you are OK with a hacky solution, then DOMSubtreeModified might do it. I'm not a JS guru but a few days ago I used it to detect "AJAX update", well, sort of:
  6. This post by Ryan partially answers your questions: Regarding the admin login process, I do not know if it helps you or not but recently I used two hooks to use the admin login for frontend login as well: <?php $site_customers_pid = 'customers' /* Redirects frontend user to /customers */ $wire->addHookAfter('Page::render', 'siteProtectPages', array('priority' => 654)); function siteProtectPages($event) { $current_page = $event->object; if ($current_page->template == 'admin') return; // ignore admin pages including admin login page if ($current_page->path() == "/{$site_customers_pid}/") { wire('session')->removeNotices(); // needed to clear "left over" notifications of the login page } } /* logout hooks for non admin users * see: https://processwire.com/talk/topic/15911-redirect-home-after-logout/#comment-142170 */ $wire->addHookAfter("Session::logoutSuccess", null, "setRedirect"); function setRedirect(HookEvent $event) { if (wire('user')->hasRole('customer')) { wire('session')->redirect("/{$site_customers_pid}/"); } } And "What to do when user attempts to view a page and has no access?" is set to: "/admin/login/". With this setup when the visitor goes to /customers/, they see the standard login form. After logging in, they get access to /customers/. I styled the admin header and login form with CSS and JS to make it more like the site's design. I know that this is somewhat off topic but it might give you and idea or two.
  7. Thanks for sharing! Installed it, works great
  8. Hi @teppo, Bug report: (sometimes?) in the RSS the date shown is the Created date of the Post not the Modified timestamp. I've been able to live with this, however, should you have a minute or two, chould you please fix it? Cheers
  9. Hello @jothanne and welcome to the forums! Are you looking for something like this?
  10. Yep, it is worth spending the time on this stage, I 100% agree! This is the key to get to speed with ProcessWire based development.
  11. Hi, just a hint: I do not yet have much experience in this but for a similar (but not exactly same) use case I use @adrian's PageProtector module which supports locking down all Unpublished and/or Hidden pages just by clicking two checkboxes. I use it to protect areas of the website which are not yet ready to be seen by the public. Of course in my case Published pages should be accessible by guests, but you might want to take a look at the module's code to see how he did it so that you can extend it to Published pages as well:
  12. Morning (here...), As far as I can see, at this stage you are looping through the Pages of the Repeater and not the fields, yet. You need nested loops: <?php foreach($f as $repeater_page) { foreach($repeater_page->fields as $rf){ // looping, I hope, through the fields of the given Repeater ID //echos... } } Warning: written in the browser and without my morning coffee!
  13. Actually, I'm not trying to add some extra functionality, I just need a more UX friendly Page Table setup. There are three types of use cases: #1 Next page is always added to the bottom of the table: #2 Next page is always added to the top. Which I prefer by setting sort order to -modified, so that when editing the page, the editor does not have to scroll down at all. This is preferable when the sort order does not matter in any other way (i.e frontend order does not depend on it): #3 And there are those cases when added pages appear somewhere in-between. When dealing with a lot of rows/pages in the case of #3 and especially in #2 it is much more preferable to have the Add New button on the top of the page table, not just at the bottom. I do not see how adding an "Add New" Page Table button to the header could help here.
  14. That depends Where does your snippet go and how does it add the button to the existing core module (PageTable)?
  15. Based on @diogo's idea above, I impleneted a version which works for multiple Page Tables of the same Page, and only adds the extra button to the top if the table is not empty (i.e. exists): $(document).ready(function () { /* * Use both clonePageTableAddButton(); and bind("DOMSubtreeModified"... below so that it * works with multiple PageTables on the same page. */ clonePageTableAddButton(); //Adds the button again, when AJAX updates the table: $(".InputfieldPageTableButtons").closest(".InputfieldPageTableContainer").bind("DOMSubtreeModified", function () { clonePageTableAddButton(); }); }); /* * Adds a clone of the PageTable field's Add New button to the top of the table */ function clonePageTableAddButton() { $(".InputfieldPageTableButtons").each(function () { $myButtons = $(this); $myTableContainer = $myButtons.closest(".InputfieldPageTableContainer"); //Only add button when Table is not empty (length != 0) and no button has been added already (length < 2) if ($myButtons.closest(".InputfieldPageTableContainer").find(".AdminDataTable").length != 0 && $myTableContainer.find(".InputfieldPageTableButtons").length < 2) { $myButtons.clone().prependTo($myTableContainer); } }); } I think the non-existence of this button on the top of the table is a major UX issue and it should be treated like a bug in the core. What's your opinion on this?
  16. "Also worth mentioning is that each field template file receives all of ProcessWire's API variables. It also receives....": https://processwire.com/blog/posts/more-repeaters-repeater-matrix-and-new-field-rendering/#processwire-3.0.5-introduces-field-rendering-with-template-files Since no additional variables can be passed to the method, the workaround shown by @Ivan Gretsky is the recommended way to do it.
  17. Hello @ARG By design CKEditor is for generating valid and "preferable" HTML stripping out any unwanted markup/code, including PHP. It is configurable, meaning it is possible to specify what gets stripped out and what not, but I do not recommend using it the way you wanted to. You might have better luck with this one: https://modules.processwire.com/modules/inputfield-ace-extended/ An alternative way is to directly edit files in the admin: However, keep in mind that letting users directly edit code is a huge security hole/risk. Only trusted superusers should be allowed to do that. Non superusers should only use Hanna Code (similar to WordPress short codes): https://modules.processwire.com/modules/process-hanna-code/
  18. Thank you in advance! "Remove Selected" sounds good to me.
  19. Since I am dealing with children of PageTables which do not need any public names/urls I use the title instead which is much more meaningful anyway. I realized that I do not even need this module for what I want to achieve. It just seemed convenient at first sight to use it, instead I switched to using my own hook in order to do whatever I need.
  20. Isn't that how single page fields work ? Yes but VPS does not support Single page, does it? If I set it to Single page (Page) or boolean false when none selected, I get : Error retrieving results: [object Object] Single page (Page) or empty page (NullPage) when none selected, I get: Nothing added yet. Only Multiple Pages works, which I do not need in this case. However, I need VPS to pick Lego parts both visually and by their Part ID. When using one-to-many relationship, there should be no other images, should there? To better explain what I'm trying to do, here is a screengrab: [...image was outdated and big, so I removed it...] I have "Parts" but I store "Set Parts" in a Page Table. Part pages store the common properties like image, year of release and title. Set Part pages store the given LEGO Set specific properties like quantity, color and the reference to the Part in question.
  21. "Select All / click select" + Trash Selected icon seems to be removing the page being referenced. Besides, when in this "one-to-many mode", selecting a different image (i.e. Page) could overwrite the currently selected page. I don't know if I want to remove the page from the modal itself. If it can be removed with the "Select All / click select" + Trash Selected icon, then there is no need to open the modal in the first place. Or am I misunderstanding something? Why is it called "Trash Selected"? Is it actually using the ProcessWire's Trash in some way or just removing the page reference? BTW, I read your docs but things are still a bit fuzzy in my head, I need more time to test all the features the module has to offer.
  22. Hello @kongondo I have a VPS 003 question: I use VPS to realize a (one-to-one) one-to-many relationship (in Thumbs View), in which case it is overkill to use the current "Click Select > Add Page Dropdown > Apply Action > Close Button". It would be great to have this one instead: "Click Select" If it was possible to choose a "Quick Add/Remove" option then I could save a lot of time. Just by clicking on the image the page should be added and the modal window should be closed automatically. What do you think? Could you possibly add this feature?
  23. One more question regarding generated page names: currently different values referenced in "Name format children" are concatenated by a dash character separating them. Can I somehow use underscore instead? That way I could easily tell the various values apart even in the generated name.
  24. Bingo! Thanks a lot @PWaddict. Of course it does make a difference whether it is a PageArray or a Page. In my case I need to stick to a PageArray but obviously set_part_image.title is not what I need. "Luckily" set_part_image.first.title does work, meaning the issue is solved! On a side note, I need a PageArray because the InputField Type is Visual Page Selector which currently supports PageArrays only. Cheers,
  25. Hi @kixe or others who might be able to help me out, I cannot seem to figure out something, I hope you can help. The children Pages – which need auto generated page names – have a Page Reference field called set_part_image. I would like its Title to be part of the name, like this (contrary to its name, it is NOT an image field!): date(Y-m-d_H-i-s) set_part_image.title Meaning I need a time stamp like string followed by the title of that Page field. While this one works: date(Y-m-d_H-i-s) set_part_image generating something like: 2017-07-30_11-24-35-1053 where 1053 is the ID of the Page referenced by the field (of course), when using set_part_image.title the name is set to be untitled. I also get the warning message: SetupPageName expects value in field 'set_part_image.title' to autogenerate Pagename set_part_image.title DOES have a value filled in, so it should not be a problem for the module to get it. I am using ProcessSetupPageName 2.0.8, BTW. What am I doing wrong? Any Ideas? Thanks in advance!
×
×
  • Create New...