-
Posts
688 -
Joined
-
Last visited
Everything posted by Christophe
-
You can also try https://filezilla-project.org/ or http://www.freefilesync.org/, for example.
-
@SiNNuT, if we stay in the non-proprietary category, you might be interested by http://sk1project.net/.
-
Here is the code for Autres Artistes: <?php include('./_head.php'); // include header markup ?> <!-- main content --> <div id='content'> <div id="directory_listing" class="row"> <div class="grid-fourth margin-top"> <?php include('./_left_menu.php'); ?> </div> <div class="grid-three-fourths row"> <?php echo "<h1>" . $title . " <span>" . $skill_title . "</span></h1>"; $children = $page->children("limit=12{$filter}"); $pagination = $children->renderPager(); if($children->count) { foreach($children as $child) { $thumb = $child->joindre_au_maximum_4_photos->first()->size(200,200); echo "<div><a href='$child->url'><img src='$thumb->url' width='$thumb->width' height='$thumb->height' /></a><p><strong><em>$child->votre_pseudo</em></strong><br />$child->pays</p></div>"; } } else { echo __("Pas de ") . $skill_title . __(" pour le moment."); } echo $pagination; ?> </div> </div> </div> <?php include('./_foot.php'); // include footer markup ?> Some variables are in _init.php now: // Gender variables $woman = __("femme"); $man = __("homme"); $gender = ""; $filter = ""; if($input->urlSegment1 == $woman) { $gender = $woman; } if($input->urlSegment1 == $man) { $gender = $man; } // Skill variable $choix_autre_artiste = $pages->get(1069); $filter2 = ""; foreach($choix_autre_artiste->children('include=hidden') as $skill) { if($input->urlSegment1 == $skill->name) { $skill_title = $skill->title; $filter2 = ", qui_2=$skill->name"; } } I've updated the left menu code in the post where it was displayed. Thanks a lot again @fbg13 for your help and for introducing me to url segments. I knew they existed but it's the first time I'm using them.
-
<?php include('./_head.php'); // include header markup ?> <!-- main content --> <div id='content'> <?php if($input->urlSegment1 == $woman) { $filter = ", civilite=mademoiselle|madame"; } if($input->urlSegment1 == $man) { $filter = ", civilite=monsieur"; } ?> <div id="directory_listing" class="row"> <div class="grid-fourth margin-top"> <?php include('./_left_menu.php'); ?> </div> <div class="grid-three-fourths row"> <?php echo "<h1>" . $title . " <span>" . $gender . "</span></h1>"; $children = $page->children("limit=12{$filter}"); $pagination = $children->renderPager(); foreach($children as $child) { $thumb = $child->joindre_au_maximum_4_photos->first()->size(200,200); echo "<div><a href='$child->url'><img src='$thumb->url' width='$thumb->width' height='$thumb->height' /></a><p><strong><em>$child->votre_pseudo</em></strong><br />$child->pays</p></div>"; } echo $pagination; ?> </div> </div> </div> <?php include('./_foot.php'); // include footer markup ?>
-
@fbg13, I think I've found the source of the problem. I made a big mistake. I've learned my lesson. Logically, civilite should only have one value. At one moment I had allowed the field to contain several pages (I think I wasn't sure it was only for the API and not also for the admin). (I had had a similar problem at one moment with another radio button (page) field on the persons pages where, when changing the color of the eyes, the new color would be added instead of the old choice being replaced. I had converted this field from a checkboxes (page) one to a radio buttons (page) one.) I've had this confirmation by changing the value for some "key" pages, with several pages allowed and with only one allowed for the field, and seeing the differences in 3 different versions of the sql file made with DB Backup. Easy with Sublime Text (but I'm currently using Linux Mint's default text editor to write code, I like the back and forward buttons...). And I had cloned a lot of pages to quickly have several pages for the tests. So, I made one or two silly mistakes... I hope I can resolve this quickly by saving again all the pages. I'll come back to confirm. Edit: apparently, once it is stored, it stays there. So pages that already have more than one value keep the other values. I guess I'll just have to remove the pages having this issue. I don't want to mess with/edit the sql file. Edit2: after saving again, both men (that were cloned women initially) had the value of Mademoiselle, and the women that were displayed in the Men page (that were cloned women that had had at least once the value of Monsieur saved) had the value of Monsieur. I've changed all this, saved and now everything is working. I still have the other filtering system to figure out, but now I have more chance of being able to make it work. And this one was a little more "mandatory" than the other one. Thanks again (a lot)! I've learned a lot!
-
Hello ryan, I hope you are doing well! Fell free to move this post to a more suitable topic. Using version 2.8.35, I am in the Modules page to install and try Tracy Debugger for the first time. I've just noticed that the link modules.processwire.com sends to http://moduels.processwire.com/ Surely a translation problem. When I go to the Upgrades (module) page I now see: ProcessWireUpgradeCheck: Error loading GitHub branches - https://api.github.com/repos/processwire/processwire/branches - HTTP error(s): 403 Forbidden: 2: fopen(https://api.github.com/repos/processwire/processwire/branches): failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden , Forbidden - Check that HTTP requests are not blocked by your server. I don't remember having this warning message displayed a few days ago with version 2.8.35. Please remove/suppress this post.
-
@fbg13, Thank you again for your help. I've put your code. There are no error messages and something is output but Femmes doesn't seem to filter anything, it outputs the same thing as its "parent" Mannequins-Modèles. It keeps the two images with mustaches (corresponding to the 2 only pages where Monsieur is chosen for Civilité). And Hommes outputs the 2 men but also 5 mademoiselles (I've checked and saved again these pages). (There are at least 15 mademoiselles in Mannequins-Modèles.) Edit: I hadn't noticed the post above...
-
@fbg13, I've woke up late. I went to bed too late/"early". I was just going to post this: <?php $filter = ""; if($input->urlSegment1 == "femmes") { $filter = ", civilite=mademoiselle|madame"; } if($input->urlSegment1 == "hommes") { $filter = ", civilite=monsieur"; } $results = $pages->find("template=directory_listing_mm{$filter}, limit=12"); $pagination = $results->renderPager(); foreach($results as $child) { if($child->joindre_au_maximum_4_photos->count) { $thumb = $child->joindre_au_maximum_4_photos->first()->size(200,200); echo "<div><a href='$child->url'><img src='$thumb->url' width='$thumb->width' height='$thumb->height' /></a><p><strong><em>$child->votre_pseudo</em></strong><br />$child->pays</p></div>"; } } echo $pagination; ?> I'm having an empty page (nothing output) in Mannequins-Modèles, Femmes, or Hommes. And (in Mannequins-Modèles) if I change some things in order to resolve this issue I have error messages like: Notice: Trying to get property of non-object in if removing or changing something to if($child->joindre_au_maximum_4_photos->count). If I remove ->count I have an empty results/content area (no error message) or Fatal error: Call to a member function first() on null if I add ->first() (with or without ->count()). I'm going to take a close look at what you've just posted.
-
@fbg13 I guess I have to rest. I suppose that what I do with $results will be echoed intead of the code already in place when there are url segments added in the url(?). It's what I wasn't sure about. Edit: I'll see "tomorrow". I'm starting to think what I've just written is wrong. Have a great evening/night!
-
@fbg13, But if I need the results to be the results of mademoiselle + the results of madame? And if I want femmes and hommes (instead of monsieur) to appear in the url? I'm sorry... I can't think properly. I think I'm going to take a break. Edit: and where do I echo/how do I integrate $results as there is already some code to output all the Mannequins-Modèles? NB: I think I'll try to give the project to somebody else when the client later wants to use an advanced search form...
-
@fbg13, Sorry, perhaps it's because it's late and I have forgotten to eat (It's not serious I know), but the page femmes (name) doesn't exist, only the pages with the names mademoiselle, madame, and monsieur. And the page hommes (name) either. (If it was the case, it would be femme and homme for them to be "similar".) We perhaps have to use variables, but how... Their parent page being available at /fr/outils/choix-civilite/ or with the id 1085 (perhaps better for a multilingual website). So I'm a bit lost. NB: I'm going to eat a little...
-
@fbg13, I'm not sure how to apply all this. I'm not experienced enough. civilite with the following radio buttons is a page field: Mademoiselle, Madame, Monsieur(Title)/monsieur(name). One difficulty being that "Femmes" (Mademoiselle + Madame) and "Hommes" (Monsieur) don't really exist. I'm not sure that this is correct (perhaps it needs to be different, I'm not sure using & is correct or | instead...): echo "<ul><li><a href='$search->url?civilite=mademoiselle&civilite=madame'>" . __("Femmes") . "</a></li>"; qui_2 with the 15 (skill) checkboxes is also a page field. Perhaps I can use URL segments only for Mannequins-Modèles. If I find how to make it work. (Later I'll have to adapt some things as the website will certainly have another language activated.) I'm starting to think it's too big for me in so little time. It's the first time I'm stuck like this. I'm starting to think that I'll pay someone to resolve all this even if I "loose" money. Or I'll ask more to the client. NB: I guess (I don't know why I didn't use it...) ! a mister/sir could be used somewhere... (?), at least here, if the rest of the line is correct/useful: echo "<ul><li><a href='$search->url?civilite!=monsieur'>" . __("Femmes") . "</a></li>"; Edit: I don't know what I"m thinking... I don't need this if I use URL segments. But I'm not sure how to modify my code in directory_listing_mm to make it work, how/if I need to change: <?php $children = $page->children("limit=12"); $pagination = $children->renderPager(); foreach($children as $child) { $thumb = $child->joindre_au_maximum_4_photos->first()->size(200,200); echo "<div><a href='$child->url'><img src='$thumb->url' width='$thumb->width' height='$thumb->height' /></a><p><strong><em>$child->votre_pseudo</em></strong><br />$child->pays</p></div>"; } echo $pagination; ?> I'm not thinking in good conditions, I'm putting pressure on myself...
-
Just now it's like this: <?php include('./_head.php'); // include header markup ?> <!-- main content --> <div id='content'> <h1 class='text-center'><?php echo $title; ?></h1> <div id="directory_listing" class="row"> <div class="grid-fourth"> <?php include('./_left_menu.php'); ?> </div> <div class="grid-three-fourths"> <?php // look for a GET variable named 'q' and sanitize it $q = $sanitizer->text($input->get->q); // did $q have anything in it? if($q) { // Sanitize for placement within a selector string. This is important for any // values that you plan to bundle in a selector string like we are doing here. $q = $sanitizer->selectorValue($q); // Search the title and body fields for our query text. $selector = "title|body~=$q"; // If user has access to admin pages, lets exclude them from the search results. // Note that 2 is the ID of the admin page, so this excludes all results that have // that page as one of the parents/ancestors. This isn't necessary if the user // doesn't have access to view admin pages. So it's not technically necessary to // have this here, but we thought it might be a good way to introduce has_parent. if($user->isLoggedin()) $selector .= ", has_parent!=2"; // Find pages that match the selector $matches = $pages->find($selector); // did we find any matches? ... if($matches->count) { // we found matches echo "<h2>" . __("Nous avons trouvé") . $matches->count . __("page(s) correspondant à votre requête:") . "</h2>"; // output navigation for them (see TIP below) echo "<ul class='nav'>"; foreach($matches as $match) { echo "<li><a href='$match->url'>$match->title</a>"; echo "<div class='summary'>$match->summary</div></li>"; } echo "</ul>"; } else { // we didn't find any echo "<h2>" . __("Désolé, aucun résultat n'a été trouvé.") . "</h2>"; } } else { // no search terms provided echo "<h2>" . __("Please enter a search term in the search box (upper right corner)") . "</h2>"; } ?> <?php $children = $page->children("limit=12"); $pagination = $children->renderPager(); foreach($children as $child) { $thumb = $child->joindre_au_maximum_4_photos->first()->size(200,200); echo "<div><a href='$child->url'><img src='$thumb->url' width='$thumb->width' height='$thumb->height' /></a><p><strong><em>$child->votre_pseudo</em></strong><br />$child->pays</p></div>"; } echo $pagination; ?> </div> </div> </div> <?php include('./_foot.php'); // include footer markup ?> I'll update the code here when/if I make progress.
-
Hello @fbg13, I hope you are doing well! /fr/annuaire-des-books/mannequins-modeles/ and /fr/annuaire-des-books/autres-artistes/ have their own template files (even if the code is the same, at least for the moment). I'm trying to create the search.php file starting from the skycrapers demo profile search.php file, removing, adding, and changing things, but as it's my first time I don't really know what I'm doing. I can only imagine/guess some things for the moment. I'm turning a bit around. I think I understand most of the file but I don't really know how to convert it for my use case. And I guess that for the "Autres artistes" filtered children pages It can be more "automated", and that for the "Mannequins Modèles" filtered children pages it is a bit different as there is Miss & Mrs (Women/Femmes) or Mr (Men/Hommes). (At the end I'll also need to include the corresponding sub-link texts as h2 tags in the results pages.)
-
This is the code for the 2 non-filtered "listing" pages: <?php $children = $page->children("limit=12"); $pagination = $children->renderPager(); foreach($children as $child) { if($child->joindre_au_maximum_4_photos->count) { $thumb = $child->joindre_au_maximum_4_photos->first()->size(200,200); echo "<div><a href='$child->url'><img src='$thumb->url' width='$thumb->width' height='$thumb->height' /></a><p><strong><em>$child->votre_pseudo</em></strong><br />$child->pays</p></div>"; } } echo $pagination; ?> (The image field is mandatory but I left the if condition. I'm going to remove it in search.php.)
-
I'm including _head.php, _foot.php, and also _left_menu.php now. I also use an _init.php file. Here is the code that I have for the moment in the _left_menu.php file: <?php $mannequins_modeles = $pages->get(1050); $autres_artistes = $pages->get(1051); echo "<ul id='left_menu'><li><a href='" . $mannequins_modeles->url . "'>$mannequins_modeles->title</a>"; echo "<ul><li><a href='" . $mannequins_modeles->url . $woman ."/'>" . $woman . "</a></li>"; echo "<li><a href='" . $mannequins_modeles->url . $man . "/'>" . $man . "</a></li></ul></li>"; echo "<li><a href='" . $autres_artistes->url . "'>$autres_artistes->title</a><ul>"; foreach($choix_autre_artiste->children('include=hidden') as $skill) { echo "<li><a href='" . $autres_artistes->url . $skill->name . "/'>$skill->title</a></li>"; } echo "</ul></li></ul>"; ?> I'm not sure it is correct. For example if civilite= put twice is ok. I'm going to start working on the search.php file. I don't know exactly for the moment how I'm going to code all this and if I'm in the right direction. I'm going to study the skycrapers demo profile search.php file to see if it can help me. I'm not sure if _left_menu.php and search.php will be sufficient. And if I need to separate with if else the parts for models and for other artists, and inside insert other if else conditions. I just want to have the search page echo something different depending on the link or sub-link and the "query" in its URL. It's my first time trying to do something like that, a sort of basic search form. Later I'll certainly have to create more complex/advanced ones. I just need to figure out if this basic "search form" is "simple" to create or more complex. One of the 2 websites I created with kraken css. I'll redirect the directory to the women models after if possible. (Website started a few days last year, and improved a bit during a few days now. I have a nice "conditional" form that now saves data as ProcessWire pages (Form Builder)...). Edit2: I wouldn't mind a bit of help...
-
I'm slowly trying to do it with some logic, the little knowledge I have, and looking at the skycrapers demo profile files (removing what doesn't seem to concern my use case to see things more clearly). The positive aspect is that I'm learning/progressing. I don't know if I'll succeed, I guess I'll have to tell the client (the kind we all know that is always in a hurry when it benefits him/her, who thinks that adding this or that functionnality is easy, who asks for relatively complicated things/functionality at the last moment, and so on) to be more patient. I'll post some code here as soon as I have enough of it to show. Have a nice day!
-
You can use the following module: http://modules.processwire.com/modules/process-wire-upgrade/
-
Problem updating a input file type description
Christophe replied to Uonze's topic in General Support
What is your ProcessWire version? Have you updated/upgraded it recently? If yes, how? What are your hosting settings (php, mysql, apache/nginx...)? What modules have you added/activated/installed? Have you added/modified some configuration settings? The Portuguese (or Brazilian Portuguese) language is installed as the default or as the second one? Have you changed language settings? Yes, it could be related to permissions.- 3 replies
-
- file
- description
-
(and 1 more)
Tagged with:
-
Hello, Let’s call a page « Directory », redirected - for the moment at least - to its first child page. http://www.domainname.com/fr/directory/ So its children are something like: mannequins-modeles/ → template : directory_listing_mm autres-artistes/ → template : directory_listing_autres_artistes With thumbnail images of the first image of their children pages (linking to these children page). So for Models it’s listing all the models, and for Other artists all the artists. And there is pagination (limit=12). On the left panel/column, there is a link to Models and one to Other artists (it will possibly be on the directory children and their children pages). It’s the first time I have this use case, so I don’t know how to do it at all, and what would be the best approach/technique (« search »/find functionality - and page, ajax-like…). For Models, I need to use the civilite field (required page field with radio output) to have Women and Men sub-links to filter by gender. So I have something like Miss, Mrs and Mr as radio buttons. (Example path for a hidden page: /fr/outils/choix-civilite/mademoiselle/ It may be better to use page ids if needed if later other languages are activated. I don't remember if it's really necessary.) For Other artists, I need to use the qui_2 field (required page field with checkboxes output) to get sub-links corresponding to each of the checkboxes and filter depending on these. Here, at least now, I just want/need to filter by one checkbox at a time, and some artists can be listed in more than one place/sub-link page as they can have multiple skills (there is another field for their profession but it’s not important here). For the moment 15 skills exist. (Example path for a hidden page: /fr/outils/choix-autre-artiste-vous-etes/musicien/) Thank you for any help/advice! Have a nice week! Edit: NB: I can PM the website urls if needed... Edit 2: ProcessWire 2.8.35
-
Sorry to say that this website shouldn't be in Sites anymore. I was looking for an example to give to a newcomer on the ProcessWire Forums and, feeling something was different and/or by habit, have just looked at the source code... I'll perhaps look for an automated way to find other websites like this one in Sites. I had done it to check if websites' urls were still valid as I had found that a few weren't anymore. It reminds me of the CMS Critic case.
- 33 replies
-
- 3
-
- Photography
- Travel photography
-
(and 1 more)
Tagged with:
-
Outputting the value of the selected radio button (page field)
Christophe replied to Christophe's topic in API & Templates
Hello @Robin S, I had seen this but I guess I was "afraid" that changing the setting would mess things up, but it's only for the API. I wanted to still be able to change the selected radio button if needed. Perhaps I thought that if I changed this setting I would lose all the other choices. I don't know why, as even then, as the pages would still be there , I could easily have had them all again by reverting back to the previous setting. Thank you :)! Have a nice weekend!