Jump to content

diogo

Moderators
  • Posts

    4,314
  • Joined

  • Last visited

  • Days Won

    80

Everything posted by diogo

  1. Ryan isn't there any way of "switching the database" on the template to make the api work with one instead of another?
  2. On another note, maybe you should consider removing the background (or making it much lighter). I really have trouble to read the texts over it. The old cards on the right side are beautiful though
  3. In this case I have the feeling you don't have to categorize a lot because events are very independent and dates are automatically categorized already (because there is a sequence). I think you should be more concerned about things like (which musicians were born in my hometown?). You can have those fields as page fields, and create the pages for the existing countries and cites in those countries, to link to. Kongondo wrote a great guide about categorization http://processwire.com/talk/topic/3579-tutorial-approaches-to-categorising-site-content/
  4. Yes, it is possible of course. It would look more or less like this: foreach($pages->find("template=person") as $p){ $timeAgo = date("Y") - $p->year; echo "<p><span>{$timeAgo}</span> YEARS AGO - on {$p->weekday} {$p->day} {$p->month} {$p->year}</p>"; echo "<p>(+) {$p->occupation} {$p->lastname} originally {$p->original} aka {$p->alias}, is born in {$p->city}, {$p->country}.</p>"; } Dealing with dates in your case won't be easy because you can't use unix timestamps (starts in 1970). That's why I chose to have all the details from the date in different fields. There might be better ways to deal with this of course. You can also import the database by exporting the database to csv and importing it to PW. This module is great for that http://modules.processwire.com/modules/import-pages-csv/. You will have to plan carefully and build all the structure in PW before.
  5. Ryan I just pushed a change to the inputMapMarker.js file on github that solves this problem. Added this inside the InputFieldMarker function: // added by diogo to solve the problem of maps not rendering correctly in hidden elements // trigger a resize on the map when either the tab button or the toggle field bar are pressed $(document).ready(function() { // get the tab element where this map is integrated $tab = $('#_' + $(map.b).closest('.InputfieldFieldsetTabOpen').attr('id')); // get the inputfield where this map is integrated and add the tab to the stack $inputFields = $(map.b).closest('.Inputfield').find('.InputfieldStateToggle').add($tab); $inputFields.on('click',function(){ // give it time to open window.setTimeout(function(){ google.maps.event.trigger(map,'resize'); }, 200); }); }); I had to put it inside the function, to have the "map" variable in scope. I'm not sure how we could move it outside the function if you don't like it that way. Also, the 200 value on the setTimeout works for me (it works above 120 but I set it to 200 to be on the safe side), but we can decide on a safer value depending on other's tests.
  6. @rooofl, sorry, I didn't see your questions before. Yes, that's right, you can't have pages previously selected on a page field. What you want would require a module that hooks on page save and selects the page being saved on all the selected pages from the field on that page. Sounds confusing but it's quite simple. $selectedPages = wire($page)->field; foreach($selectedPages as $p){ $thisPage = wire($page); $p->field->add($thisPage); $p->save(); } Written on the browser and I don't have time to make it more complete. Just to give an idea.
  7. The post seems to have been deleted. I will restore it. edit: even better, the post was removed because the content was exactly the same. I moved this one to the forum "modules/plugins" instead of restoring the other. Marco I edited your post to remove the link.
  8. The page is not indexed if there's nothing linking to it. I would have the links disabled by default at least and the checkbox to enabled them, and maybe the possibility of enabling by template (as you said) or by parent because it makes all the sense to enable all descendants of a page (articles page for instance). Like this, you could enable the links to all the site just by enabling the descendants of home. Or am I complicating?
  9. I thought of this already, but gave up on the idea because it allows anyone to start trying random numbers and get pages that you don't want accessible to everyone. One way of avoiding this would vbe to have a global checkbox field that you would have to check to activate the shortlink to that page.
  10. Did you remove the title field from those pages?
  11. Those are the ID of the pages. My guess is that you chose a field that doesn't exist on the selectable pages as the pages identifier for the dropdown. Go to that field settings, and under the input tab change the "Label field" setting.
  12. I updated the README file on github with a troubleshooting section with the solution to this problem https://github.com/ocorreiododiogo/pw-admin-custom-pages/blob/master/README.md
  13. Get doesn't build the array in PHP, it just gets the requested page from the database and creates only that object.
  14. At the computer now. It would be more efficient if you would do this instead: $urlcat = $pages->get("/categories/")->get("name=$name"); // <- get instead of find echo "<h3>Category: <i>" . $urlcat->title . "</i></h3>"; or this: $urlcat = $pages->get("/categories/$name"); echo "<h3>Category: <i>" . $urlcat->title . "</i></h3>";
  15. make sure you sanitize that value before using it in the selector and throw a 404 if the page is not found.
  16. You are using a find to get the page. That gives you a page array instead of the page object. for trying, $urlcat->first()->title should do the job, but you should change your find to a get. (on mobile) edit: teppo, not fair, I'm in disadvantage here
  17. I changed that immediately after posting. You are too fast for me
  18. That line is not from the PW core, but specific to the module. The module adds it on the installation procedure, but for some reason it didn't happen with you.
  19. A very interesting topic for sure https://www.google.com/search?q=AnnaKus&oq=AnnaKus&aqs=chrome..69i57&sourceid=chrome&ie=UTF-8#q=AnnaKus+how+fast+do+you+type I hope we can stop here.
  20. Can you check if the admin.php file in the templates folder was changed during the installation? if so, it should have these lines: // line added for the Custom Admin Pages Module if($page->template->id !== 2) $page->process = "ProcessAdminCustomPages"; If it doesn't, please replace it by the one on github or add these lines yourself just before the require() https://github.com/ocorreiododiogo/pw-admin-custom-pages/blob/master/admin.php
  21. I apologize in advance if I judged you wrong but before this last post, you had 3 posts and neither of them about Processwire. We don't mind that you comment on other existing posts that are not related to PW, but I just can't let you open a topic with three links in it under these circumstances.
  22. Anna, I also love animals, but unless you post something about Processwire we will have to consider you as a possible spammer.
  23. Just want to add that you can use PW's $input to access cookies: $input->cookie->property_favs
×
×
  • Create New...