Jump to content

nalply

Members
  • Posts

    10
  • Joined

  • Last visited

Everything posted by nalply

  1. Thanks, that's what I have been looking for! I just told my wife how fast you have been in helping me. That's awesome.
  2. I am not sure whether this has been asked before. I tried googling, but got slightly different topics, so I post this as a new topic now. Sorry. I have a «protected» page. The guest user is not allowed to view this page, only a few roles. Now the customer want this page to appear in the navigation even for guest users. When they click on the item they should be presented with the Processwire login then they should be able to view the protected page. This works if I give them the direct link, and if they are logged in, the protected page also appears in the navigation. This is the code for the navigation. It's a two-level navigation. Sorry about the alternative syntax. I know it's controversial, but I like it for templating. <? foreach (top_pages() as $top): ?> <li id="nav_<?=$top->id?>" class="top"> <a href="<?=$top->url?>"><?=$top->title?></a> <? if ($top->numChildren): ?> <ul> <? foreach ($top->children as $child): ?> <li class="sub"><a href="<?=$child->url?>"><?=$child->title?></a></li> <? endforeach ?> </ul> <? endif ?> </li> <? endforeach ?> Now, how can I get the children of $top as a given role even when not logged in?
  3. Thanks. I had the httpHosts configured correctly. So you think this should have worked? That means same server, two domains, same logins? Perhaps Cloudflare is the problem, because the two domains are cloaked behind different IP addresses. But I have the feeling that this shouldn't be the case. I wonder what exactly goes into the password hash. There is a global auth salt in install.php at line 680 however this salt is same for both domains. This is used for the password hashing. Could someone clarify how the hash is calculated, especially which inputs to the hash are used?
  4. I installed Processwire on a server under a domain dev.example.com, so that the website can be prepared at ease. Now the website is ready. I made same server available under www.example.com. This means, dev.example.com is now an alias for www.example.com. However I can't login under www.example.com. It says Login failed. Note that I didn't copy any files. I just changed DNS to point to same server. Edit The frontend works fine under the two domains. Login worked fine under the dev domain. I reset the password for the new domain. Now the same password doesn't work for the old domain. Password.php (links to Ryan's Github repo) doesn't say that the domain goes into the password hash or salt (or I didn't read carefully enough). What has happened?
  5. I found a solution. First I tried to save the field to the Processwire database, but this gave me the willies. It's a race, i. e. what if two people simultaneosly access this page? After studying the source code of MapMarker I found the geocode() method. This works now: function getMap($object) { $map_module = wire('modules')->get('MarkupGoogleMap'); $page = wire('page'); $page->map->address = "{$object['strasse']} {$object['hausnummer']}, {$object['plz']} {$object['ort']}"; $page->map->geocode(); $rendered_map = $map_module->render($page, 'map'); return "<div class='sf_map'>$rendered_map</div>"; } Any thoughts?
  6. I am using the FieldtypeMapMarker module to display a location on a map. The address comes from a different database (see my other topic Parameterized template). I tried this: function getMap($object) { $map_module = wire('modules')->get('MarkupGoogleMap'); $page = wire('page'); $page->map->address = "{$object['strasse']} {$object['hausnummer']}, {$object['plz']} {$object['ort']}"; var_dump($page->map); $rendered_map = $map_module->render($page, 'map'); return "<div class='sf_map'>$rendered_map</div>"; } that means, I just set the map address from $object with the members street, house number, zip and city. Such an address string is for example: "Rathausgasse 75, 3011 Bern". This does not work, however. var_dump() shows the address I want, but the map ignores it. It uses instead the default address I saved in the field.
  7. Thanks for the detailed answer. Yes, the external database (however not MySQL) is not build on PW. Yes, the URL is served by PW. Now I know how to proceed. What I needed was the word «url segment».
  8. Thanks, that's what I have been looking for.
  9. I have an external database with a list of items, each one identified by an id. I would like to integrate this database into the CMS. www.example.com/external-database/item/<id> I have created a page www.example.com/external-database/item, but not the dependent pages. If link to the ids, Processwire tells me that they don't exist. Can I use the id urls without creating the pages? The id urls should use the parent url as template and use <id> as a parameter. In short, a parameterized template.
  10. An additional note to whom it may concern: For the people who are running ProcessWire under nginx and fpm (like me) there is an additional setting for nginx: client_max_body_size 500m; (see http://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size for details). It also helps to look for error logs.
×
×
  • Create New...