Jump to content

Macrura

PW-Moderators
  • Posts

    2,765
  • Joined

  • Last visited

  • Days Won

    40

Everything posted by Macrura

  1. 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;
  2. great! will be really nice for things like invoices, sensitive, or copyright/rights managed data in files
  3. @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.
  4. yeah i was thinking this practically on the same day you posted this, would be truly epic!
  5. 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>
  6. 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..
  7. you may be able to use $config class for your custom site variables;
  8. 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
  9. @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/
  10. 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...
  11. 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; }
  12. @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..)
  13. 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?
  14. 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; }
  15. 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>
  16. 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
  17. 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
  18. sorry - i meant PW reset has hardcoded message that sends plaintext; the url was breaking in Outlook for Mac, i think some newer email clients don't break the URL
  19. sometimes i use 2 fields in this type of situation, one i'll call an "add item utility" and the other is the regular page select; so i can add the items in the 'utility' field and then select them in the page select; it was the only way i could come up with to achieve a similar functionality as you have described, e.g the utility field adds the item only, and then it can be selected from the other field..
  20. this is great - last project we needed this on we did something like this, which worked ok: <?php if($notices->count) { echo '<ul id="notices">'; foreach($notices as $notice) { echo "<li>$notice->text</li>"; } echo '</ul>'; } else { echo "<div class='form-container'>"; $controller = new ProcessController(); $controller->setProcessName('ProcessForgotPassword'); echo $controller->execute(); echo "</div>"; } one problem i noticed was the link in plaintext was breaking, so wasn't clickable, i was thinking that it would be good if the email could be sent in html where the link could be in an anchor tag
  21. I use this http://modules.processwire.com/modules/inputfield-textarea-markup/
  22. what is the path if you output the path variable - can you post only the path here, to an example image; i can't review your full code.
  23. for the project in question, i think for a custom design, the # of pages doesn't matter so much as the information architecture; charging by # of pages is sort of old fashioned, now that the CMS can generate unlimited pages using various templates; more sensible to charge by # of templates; does the client want a blog, how often do they need to change their homepage content, and how much seo, do they want open graph, RSS, Atom, RDF, Schema etc; it is sensible to break the hours up into areas, like Planning & Discussions (discovery) Graphic design, asset preparation & management CMS setup, back end development, custom admin stuff Front end development testing, QA, launch SEO Most sites will clock in around 40+ hours even for a basic site - makes sense to estimate on the high side - i have yet to complete a project in less then the # of estimated hours...
  24. I'm using pagination on a site where it is outputting articles, and i'm also setting up a "Printer Friendly" view for the page, which would output the whole page body, but i'm having trouble 'unsetting' the pagination textformatter. Any tips on how to do that (i've tried a bunch of things, like $page->getUnformatted('body'), and $page->of(false)... but nothing seems to work - i always get the paginated version; i don't think it could be cached because the print view is generated off a url param (?printerFriendly=true) i guess i could apply the textformatter at runtime to the field where pagination is required - is that the best way to approach this?
×
×
  • Create New...