Jump to content

Christoph

Members
  • Posts

    61
  • Joined

  • Last visited

1 Follower

Profile Information

  • Gender
    Male
  • Location
    Germany

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Christoph's Achievements

Full Member

Full Member (4/6)

4

Reputation

  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!
×
×
  • Create New...