Jump to content

Christoph

Members
  • Content Count

    61
  • Joined

  • Last visited

Everything posted by Christoph

  1. Hi Robin, this is just great, thanks a lot! Yes, it's the best way to have first_name and last_name as separated fields, but up until now I had no idea how to automatically combine and use them for the title. Will try this.
  2. I didn't find a solution to use the exploded full name as a sort string for sorting by last_name, so I put a separate last_name field into the template that ist only used for sorting. As I don't want users to fill in the name twice, I did that automatically by checking if the last_name is empty when loading the team page on the frontend. I added this code at the top of the teams template, that is showing all the team members $team_members = $pages->find("template=team_member, last_name=''"); foreach($team_members as $team_member) { $name = explode(" ", $team_member->title); $team_member->of(false); // "turns off output formatting" $team_member->last_name = $name[1]; $team_member->save(); } Now, when I load the page in the front end, the last name is saved into the database and can be used for sorting. I'm fine with this workaround, maybe it is useful for someone else
  3. Thanks for your reply, Louis! I just want a DRY approach. I have a list of team members, all saved as single pages in PW. When adding a new member, I create a new page and put the full name into the title, so I have the name already there, for the URL and for output in the frontend. Now, I don't want to have to input the same name again in further fields like first_name and last_name, just to be able to sort by last_name. This should be possible in an easier way. I could get the names with: $names = $pages->get("name=parentpage")->children->title; Then I could loop through the array and explode the names to get the last name. But then I'm to much of a PHP noob to use the result as a property to sort the pages. I guess there must be a PHP way to get there, something like usort() or array_multisort(), but – at least for me – to complicated …
  4. I'm in a situation where it would be overkill to create new fields. Currently, I'm facing the same problem, having a title field width full names that I'd like to sort by the last name. So is there an answer to the first question of @oma, without creating separate fields?
  5. Hi there, I have an installation with German admin language . For a date field I want an input like "Mai 2016". With PHP date it works fine, problem is, the date within the input field is shown in English like "May 2016". For the output I can use strftime %b %Y, which works fine and shows the German month names. If I try this for the admin, the value won't be saved. Is there a way to get German month names into the admin input fields? I know it's not a big deal having them in English, as they are very similar. I'm just curious if I'm missing something.
  6. @Robin S I tried your code snippet for option C and it worked. Wondering though, where's the difference to option B in this case?
  7. @DarsVaeda Had the same issue with unusable popup on option C/D. My solution was to change the jQuery version to the one processwire is using. @Robin S Thanks for your help! Will try your solution with option C later today. You're right, instead of changing the admin template, it is enough to allow access for the repeater_content template
  8. Yes, I read it. As I had no problems using option B with repeaters as a superuser, I just wanted to make it work for other user roles, too. Option C/D is just no real front end editing any more, at least regarding how my clients understand it. In my current client's context, the front end editing is just needed to correct typos and the likes. But you are right, as there is a strong advice to not use option B in a repeater context, the docs don't need to provide a solution on how make it work .
  9. Ok, sorry for any inconvenience! While trying to better explain my problem I came up with a solution. Because the issues described in the post mentioned above are related, as I discovered, I wrote my solution over there: So, this thread is obsolete.
  10. I had the same issues you both mentioned. When logged in with some other role then superuser and try to edit a page, either the text disappeared or I wasn't even able to edit the text, at all. The problem comes up, if you want to use option B (explained here: https://processwire.com/api/modules/front-end-editing/ ) for front end editing. I chose it above the other options, because of its direct "inline access" (compared to the dialog box with option C and D). Because repeater fields are stored as child of the admin page in the backend, other user roles don't have access to them by default, which leads to the afore mentioned issues, I guess. My solution was to give those user roles access to the admin page template and its children. It took me some time to discover it, so if other users have problems with this, as well, maybe it's worth mentioning it in the module docs somewhere?
  11. The thread had a different topic and was marked as solved, that's why I started a new one
  12. This is what @design-a-point wrote in a different thread. I experience the same issue, but couldn't find a solution, yet. Any role other than superuser isn't able to front end edit a field. Any ideas? Thanks for your help!
  13. No. Well, it depends. I've just accepted that Processwire makes no difference between backend structure and frontend/URL structure. I'd still wish for a more flexible approach on this, but currently I get along with it. While thinking about it: The question is, if »normal« users use and think about URLs the same way we do. Safari doesn't even show the URL by default … It could be an issue in breadcrumbs nonetheless, but I rarely use them in my projects.
  14. This seems to work. Never saw these subselectors, interesting! Thanks a lot!
  15. Hi there, i have a little problem with the pagination module. I get an archive-list of articles like this $articles = $pages->get("/archive/")->children("limit=10"); and use a foreach to output the result. tThe limit selector tells the pagination module when to create a new page. So far so good. Now, I just want to skip the first 10 articles from the archive as they are already shown on the homepage. I'd set the start selector to start=11, but this seem to interfere with my page navigation as the start selector is used here to output the pages. What can I do to skip the first 10 articles while still using pagination? Thanks for your support!
  16. I rather see a problem for users that might go to a page that doesn't exist. This is my biggest concern. Basically I don't mind having a longer URL-structure If you make it viewable later on, well, then it would be like rearranging your content structure. You're then adding a layer that helps user finding your content better. But if I decide that this layer isn't needed, then I see more sense in leaving this layer out of the URL structure. In the end, it's not the biggest issue, I just want to understand the basic idea behind it, so ist would be great to get some insights on that reasons you mentioned, as I still don't understand it
  17. I think, this URL only makes sense, if there's actually a page that this url refers to. I often create pages, whose only purpose is to keep the admin tidy. If a page is set to unpublished and/or hast no template file and is therefore not meant to be visible, why does it need a place within the URL string?
  18. Thanks for your help, again! Update: I copied the whole website to a different server and now everything works fine, again. The mentioned page that I couldn't edit before is now editable, but what I recognized is, that it takes a few seconds to load the page in the admin. I'm using a repeater field to manage a ton of dates (> 50) and I guess that this could've been a problem for the old server? Nonetheless, everything fine for now.
  19. Thanks for your help, guys! Now, I think I've crashed the whole thing. Just changed ProcessPageEdit.module and I'm getting "error: class 'Process not found in ProcessPageEdit.module Changed it back and error ist still there. What's going on here? @Arjen Before I changed ProcessPageEdit.module I created a testpage with the same template. could edit it without any problem. And yes, there was one page in the trash with this template
  20. Hi Arjen, thanks for your reply. I try to provide a bit more: The template uses a few text fields and a repeater field (where most of the client's changes happen) There is just one page using this template. (Although the overview under setup > templates says "2") I turned on $config->debug but it didn't show any further hint. The front-end just works perfect. The page using that template shows all infos. No errors. Unfortunately I have no local environment for this project.
  21. I've a strange problem I never run into before. When I try to edit one special page in the admin, I get this: I can edit every other page except one. I can't find anything in the server log files and there is no hint in the assets/logs error file. I'm using PHP 5.6 and PW 3.0.5 Until 2 days ago, everything worked just fine, maybe it's related to the fact that the client edited the page recently? But I can't figure out what the problem is. Thanks for some hints!
  22. Thanks for clarifying! I thought repeaters behave the same as pages …
  23. Thanks, LostKobraKai, your version works! Just to get it right: Is "today" working because I'm searching within repeater fields?
  24. Thanks for your quick reply! Find doesn't work in this context and produces an error: Error: Call to a member function find() on a non-object As I only need one page (the one where the repeater is included), I think "get" is ok here. Your second idea sounds promising, but unfortunately, the code doesn't work either. Anyway, thanks for your support!
×
×
  • Create New...