Jump to content

Macrura

PW-Moderators
  • Posts

    2,776
  • Joined

  • Last visited

  • Days Won

    40

Everything posted by Macrura

  1. Forklift in combination with Sublime Text is pretty unbeatable for simple FTP and text editing. Also, I wouldn't rule out Coda, which is basically a text editor with most of the features of Transmit, all in 1 app..
  2. @BFD Calendar - sounds like a possible bug; perhaps best course is to report it as an issue on github.
  3. yeah - that's the other piece of the puzzle... !
  4. what happens if you re-create that same field as a copy on the same template - does it also not work? Are there any errors in the console?
  5. as long as the page URL is /page-title they should crawl that; you could also use a hook to make those pages live off the root as is explained in the CMS critic case study. that would take care of the URLs, because then the system would always rewrite those landing page URLS to the root versions i use this for landing pages: wire()->addHookBefore('Page::path', function($event) { $page = $event->object; if($page->template == 'landing-page') { // ensure that pages with template 'landing-page' live off the root $event->replace = true; $event->return = "/$page->name/"; } }); in the landing page itself i put this: // if someone tries to access this page at it's real location in the page tree, redirect to the fake URL: if(!$input->urlSegment1) { $session->redirect($page->url); }
  6. you could do it multistage with add-> e.g. start with simple selectors of things that will match and then incrementally add more; or you could foreach through them and do more advanced checking on each item, but this will be pretty slow; or see if OR groups would work: $tmp = $pages->find("template=booking,bookingStartDate>=$frontStartDate,(bookingStartDate<=$frontEndDate, bookingEndDate<=$frontEndDate),bookingEndDate>=$frontStartDate"); https://processwire.com/api/selectors/#or-groups
  7. it depends on if you are rendering the page off the root or redirecting; for a landing page you may as well render it using the URL segments technique; and you can manipulate your canonical URL to show the off-root URL
  8. Any chance the new pages are being created, but unpublished? I had that same issue on '.12, and to fix it i think i had to reset the family settings;
  9. great! will be really nice for things like invoices, sensitive, or copyright/rights managed data in files
  10. @tekno, can you explain more about what you want to do? there are several ways to get a list of unique values, but depends on how the fields are setup and how your search form needs to reference them.
  11. yeah i was thinking this practically on the same day you posted this, would be truly epic!
  12. not sure, i've never seen siteurl as a parameter, and i don't see that in the cheatsheet; also don't you need to reference the $item->url? <section id="technology"> <h1><?php echo __('services-and-technologies'); ?></h1> <h2><?php echo __('services-and-technologies-heading'); ?>.</h2> <ul class="centering-block"> <?php foreach($page->services as $item) { echo "<li> <h3>$item->title</h3> <p>$item->textContent</p> <a href='$item->url'> <p>$item->title</p> </a> </li>"; } ?> </ul> </section>
  13. or even show_in_slide= (?)
  14. guess i'm the someone else.. after just having built several blogs with PW, i do wonder why anyone would willingly use that awful WP interface, and the annoying media manager, not to mention things like featured image etc.. i guess for power bloggers, WP probably has some advantages, but most of my clients just need a simple blog that they can edit quickly and easily..
  15. you may be able to use $config class for your custom site variables;
  16. you have to figure out how the markup outputs each panel and then loop in such a way to create your panels; this will assume at least a pretty good knowledge of HTML and use a code editor like Sublime text so you can see matching divs
  17. @quickjeff - have you considered making a sitemap manually - then you would have api control over what it spits out: http://processwire.com/talk/topic/3846-how-do-i-create-a-sitemapxml/
  18. it's a good question - i thought there was (maybe i'm imagining it) some setting where you could tell it what to do with trashed items, e.g. trashed items are deleted, or left there; ran into a situation yesterday where we wanted to move a child item from one parent to another, but even moving it just allowed it to be on 2 page tables, because the 1st page table remembered the id, and didn't account for the fact that the item was no longer a child of the page table.. ended up being easiest to trash the page and then move it out of the trash to the new parent; but i could see there being a need in future to be able to elegantly move pagetable items around without too much hacking...
  19. haven't tested this but i'm thinking of adding the settings to the $config class so they are available inside functions and wireInclude, wireRender.. would just need to change the loop to this i think: foreach($settings_lines as $settings_row) { $settings_pair = explode('|', $settings_row); $config->{trim($settings_pair[0])} = trim($settings_pair[1]); } or foreach($settings_table as $row) { $config->{$row->setting} = $row->value; }
  20. @jlahijani - thanks for this, i should add your technique to my settings tutorial.. how do you do settings, e.g. table, text field, regular fields, etc.. https://processwire.com/talk/topic/8373-use-delimited-texarea-table-or-yaml-for-settings/?hl=settings **just set this up and it works great! (i was using a custom admin page before for this and doing a session redirect..)
  21. you would need to: 1.) allow the form to accept GET params (in the form setting) 2.) Use a select field for the class, or a text field 3.) make your link to the form that references the page ID of the class, like: /registration/intro-to-computers/?class=1298 (page select) or url encode the title if using a text field /registration/intro-to-computers/?name=Intro%20to%20Computers%22 and you probably would want to sanitize the input, though i think FB sanitizes input by default?
  22. common way for quotes is: 1.) Make quote template, add necessary fields (body, author, link etc.) 2.) make quote-index template (children allowed = quote) 3.) set quote template for parents allowed = quote-index 4.) in a hidden part of your tree (e.g. /settings/quotes/) add new page using quote-index template 5.) add quote pages as children of the quote-index 6.) change quote-index template to disallow new pages to be created 7.) to output your quotes, (replace nnnn with the id of your quote index) <?php $quotes = $pages->get(nnnn)->children; //or $quotes = $pages->find("template=quote"); foreach($quotes as $quote) { // output your quote markup here, // e.g. echo $quote->body; }
  23. the code you are providing doesn't make any sense; did you mean to do something like this? <div class="container"> <div class="row"> <?php foreach($page->children as $c) { ?> <div class="col-xs-6 col-md-3"> <div class="well"> <h2><?php echo $c->title; ?></h2> <p><?php echo $c->summary; ?></p> </div> </div> <?php } ?> </div> </div>
  24. it depends a lot what the content will be; if it is static info, then i would use textarea markup module if it is something that needs to be dynamic, using javascript/ajax, then i might use the textarea markup but have some custom admin jquery that can read other values/fields and change the content of the text area. for php generated stuff i don't know how to insert it between other fields, using the module code, but there might be a way... you could always put it at the top and then move it with jQuery
  25. i usually use a custom module and put all of my custom admin stuff there, e.g.: public function ready(){ if($this->page->process == "ProcessPageEdit"){ $this->addHookAfter('ProcessPageEdit::buildFormContent', $this, 'mySpecialThing'); } } public function mySpecialThing(HookEvent $event) { $form = $event->return; $field = $this->modules->get("InputfieldMarkup"); $field->markupText = "<h3>My Special Thing</h3>"; $form->prepend($field); } // end function
×
×
  • Create New...