-
Posts
344 -
Joined
-
Last visited
-
Days Won
1
Everything posted by fbg13
-
Then you need to add extra checks if($input->urlSegment1 == "femmes") { $filter = "civilite=mademoiselle|madame"; } if($input->urlSegment1 == "hommes") { $filter = "civilite=monsieur"; } // or if($input->urlSegment1 == "mademoiselle" || $input->urlSegment1 == "madame") { $filter = "civilite=mademoiselle|madame"; } if($input->urlSegment1 == "monsieur") { $filter = "civilite=monsieur"; }
-
On the template responsible for this page /fr/annuaire-des-books/mannequins-modeles/ enable url segments then change echo "<ul><li><a href='$search->url?civilite=mademoiselle&civilite=madame'>" . __("Femmes") . "</a></li>"; to echo "<ul><li><a href='/fr/annuaire-des-books/mannequins-modeles/femmes'>" . __("Femmes") . "</a></li>"; and add this $filter = ""; if($input->urlSegment1) { $filter = "civilite={$input->urlSegment1}"; } $results = $pages->find("{$filter}"); at top of the template file responsible for this page /fr/annuaire-des-books/mannequins-modeles/ Now when you go to /fr/annuaire-des-books/mannequins-modeles/femmes it should get all pages with field civilite=femmes
-
You can use url segments (need to enable them for each template you need to have them). Then the Femmes link will be /fr/annuaire-des-books/mannequins-modeles/femmes and in the template file for directory_listing_mm you do this $filter = ""; if($input->urlSegment1 == "femmes") { $filter = ", civilite=value_representing_femmes"; } if($input->urlSegment1 == "hommes") { $filter = ", civilite=value_representing_hommes"; } $results = $pages->find("template=directory_listing_mm {$filter}"); /fr/annuaire-des-books/mannequins-modeles/femmes /fr/annuaire-des-books/mannequins-modeles/hommes the red part will be $input->urlSegment1, so if $input->urlSegment1 is femmes you change the selector to search for pages where your civilite is femmes. You have quite a few filters so this might not be the best solution. I say you change the civilite to page fields the the code becomes: $filter = ""; if($input->urlSegment1) { $filter = ", civilite={$input->urlSegment1}"; } $results = $pages->find("template=directory_listing_mm {$filter}"); If changing fields to page field is an option i can explain further.
-
I don't quite understand you're explanation . So let's see if i got it right, you have a directory page where you display pages from different templates (directory_listing_mm, directory_listing_autres_artistes) and in the sidebar you want to have links that filter the results based on some fields (which are checkboxes). /fr/annuaire-des-books/mannequins-modeles/ and /fr/annuaire-des-books/mannequins-modeles/ have their own template files right?
-
Don't quite understand what you mean. Do you have a textarea (page-content) field that has multiple <h2>, <h3> tags and you want to have a navigation for them? If i got it right please mention if this tags are always the same.
-
OK. Thank you guys for helping me with this very annoying thing.
-
The "shared session directory" part confuses me; we're both talking about /site/assets/sessions right? Or do you mean the sessions directory in a shared hosting environment?
-
http://stackoverflow.com/questions/32395988/highlight-menu-item-when-scrolling-down-to-section
-
Well for some reason IronMan with space between the words gives me that no idea why. Might have caught a virus.
-
For pages related to same kind of pages: movies (Ironman related to Ironman 2, Avengers etc), books, games, tutorials, recipes... If i write IronMan with space between the words i get V@g1n@ Monologues wtf
-
Yes it was CloudFlare. I'll stick with only the user agent for the session fingerprint. Sorry but i don't understand what you mean. Are you referring to my sessions directory?
-
$config->sessionFingerprint set to 0 or 8 seems to work but 1 and 2 keeps logging me out. My ip is not changing while the log out happens (not to my knowledge). The sessions directory has ~12k files in it. Is that normal? Can someone explain the above message? My ip is not 173.245.53.109
-
Thanks for this module. Might be worth mentioning that it works with the same field too.
-
I keep getting logged out after about 20 minutes and i got no idea why. All session configs have default values PW v3.0.39. Also in the session logs i have this: Is that ip address supposed to be mine cause it's not?
-
Why won't it help? It's better than empty space or removing the sidebar altogether imo. #branding { position: fixed; } Or do you mean it won't help cause it's just as useless as the empty space?
-
Wouldn't it be better to make the branding fixed even for non-sticky header?
-
Meant for all three (masthead, breadcrumbs, headline), but now that i think about it the headline is the most useful to me, having the button always on screen. Also didn't think about the default theme. I'll just stick to the non-sticky header. Thanks for the module.
-
@tpr what do you think about changing the sticky header so that it hides when scrolling down and shows when scrolling up? https://jsfiddle.net/102d1sdt/4/ headroomjs
-
I just used this, just that i used Ryan's suggestion for the random string $rand = new Password(); $hash = $rand->randomBase64String(100); and there is a problem with the second check here: if(strcmp(wire("users")->get($activate_username)->user_activation, $activate_hash) == 0 || wire("users")->get($activate_username)->user_activation == 0) If wire("users")->get($activate_username)->user_activation is a string starting with a letter it will be converted to integer 0 so the if statement is true, if the string starts with a number that number will be converted to an integer. To solve this use === in that comparison, or put 0 in quotes "0", or omit it altogether (if it's already 0 no need to set it again to 0). This is how i handle the activation: $username = $sanitizer->pageName($_GET["user"]); $hash = $sanitizer->text($_GET['hash']); // get the user $u = $pages->get("template=user, name={$username}"); // user exists if($u->id) { // check if user is activated if($u->user_activation === "active") { echo "Account is already active."; } // not activated compare hash from $_GET with hash from db // http://php.net/manual/en/function.strcmp.php else if(strcmp($u->user_activation, $hash) == 0) { // hashes are the same activate user echo "Your account has been activated!<br>"; $u->of(false); $u->user_activation = "active"; $u->save(); } // hashes don't match else { echo "There was an error activating your account! Please contact us!<br><br>"; } }
-
It just parses "$item->internalPage" and echoes "->url" as a normal string, don't know if it's normal behavior or not. More about the variable parsing.
-
Try putting $item->internalPage->url in curly braces {$item->internalPage->url}
-
If you selected "Single Page" in the field options you need // /parent/child $item->internalPage->url; // or http://domain.tld/parent/child $item->internalPage->httpUrl; else you need to loop the field or do $item->internalPage->first->url.
-
@oma I assume you want them ordered ascending and the ones starting with a number at the end. You could do this by storing the numerical names in a variable and echoing that variable after the "normal" names. $numericalNames = ""; $normalNames = ""; $names = $pages->find("template=template_name"); foreach($names as $n) { /* get the first letter of the current name */ $firstLetter = substr($n->name, 0, 1); $regexPattern = "/[0-9]/"; // if first letter is a number if(preg_match($regexPattern, $firstLetter)) { $numericalNames .= $n->name; } else { $normalNames .= $n->name; } } echo $normalNames; echo $numericalNames;