Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/03/2015 in all areas

  1. 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; }
    2 points
  2. 1) Options you could setup a reapterfield 2) Use the PageTable field type - create a page template for your quotes that only output the quote - you could use the quote pages as children where you need them - or if you have them in several places you could create a special hidden page and get them via API or in Content via HannaCode some links on this topic https://processwire.com/talk/topic/6417-processwire-profields-table/page-2#entry63119 https://processwire.com/talk/topic/8177-page-table-howto/ some example setup for PageTable or PageTableExented fields: https://processwire.com/talk/topic/7459-module-pagetableextended/ regards mr-fan
    2 points
  3. 1) from the module side there is pretty much in the core right now...but here are some "trending" stuff https://processwire.com/talk/topic/8298-list-your-5-must-have-modules/ 2) from your content structure you have to give your users a interface to manage easy different kind of data so maybe you are interested in the best (but commecial) module for this Lister Pro https://processwire.com/api/modules/lister-pro/ with this you can handle every task users have to interact with pages. 3) other option to handle pages and templates in a easy userinterface is a kind of "better repeater" that works with pages PageTable and PageTableExtended introducion - https://processwire.com/talk/topic/6417-processwire-profields-table/page-2#entry63119 PageTable - https://processwire.com/talk/topic/6546-pagetable-documentation/ PageTable Extended - https://processwire.com/talk/topic/7459-module-pagetableextended/ What helped me most at the beginning: Famous Kongondo's tutorial about structuring content in Processwire: https://processwire.com/talk/topic/3579-tutorial-approaches-to-categorising-site-content/ Sitescraper Profile from Ryan on filtering and searching stuff via PW API: http://demo.processwire.com/ http://modules.processwire.com/modules/skyscrapers-profile/ Navigation Helper: http://modules.processwire.com/modules/markup-simple-navigation/ Helper on setup things: wireshell.pw https://processwire-recipes.com/ If you have special questions on single parts/problems you may consider before you start to create fields and templates...you could ask more specific. Best regards mr-fan
    2 points
  4. Hi folks! I'm about to add my new module FieldtypeAssistedURL to the repository. You find the source code on github and hopefully in the modules repository soon. Here an extract from the README.md: This module offers you a new field type AssistedURL Field, providing and input field for storing absolute and relative URLs. The field type adds a button to open the URL chooser dialog known from the CKEditor link feature without the tab navigation bar for specifying link attributes. Using the URL chooser dialog the editor may select URLs from internal pages or uploaded files via a search field with auto-completion, a page tree control, and a file selector control. Please feel free to post suggestions and any form of feedback here in the forums or on github. Wumbo
    1 point
  5. Would anyone else like to see the ability to make use of PW variables to build up dynamic descriptions and notes for fields? This is a very simplistic example and not that useful, but I do have some use cases where the ability to do something like this would be very handy: $f->description = __('Please make sure you fill out this field based on the content of the {page.parent.title} summary field.'); As I said - a bad example, but I think this could be a powerful addition in some scenarios.
    1 point
  6. Hi Forum, I recently had a chat with a friend who was introduced to PW by me. He said: "brilliant cms, poor documentation." His comment makes me think about the cheatsheet: While we see new API methods introduced at a very fast pace, the cheatsheet doesn't seem to keep up. That's sad, because it's such a good resource. So, how can I (as a user with very limited PHP skills) help to update the cheatsheet? Is somebody skilled willing to team up with me - as kind of a supervisor - for the update tasks? Or are there any plans on behalf of the team to update the cheatsheet? Thanks!
    1 point
  7. Hi to all, As I've mentioned earlier to Ryan, ProcessWire runs fine on Windows 7/2008 Server setup with IIS 7.5 WebServer with IIS Mod-Rewrite from Micronovae that can read .htaccess file. The problem is that this IIS filter is free for development use on localhost without limitations but it's not free for production use on live server (it costs $150 per server license). I've found another solution that works flawlessly and it's absolutely free. Download URL Rewrite Module 2.0 for IIS from http://www.iis.net/download/urlrewrite and install it Define new web site under "sites" in IIS Manager and point it to directory where you've unzipped ProcessWire files Download web.config (translated from original .htaccess) file from this post, unzip it and put it in ProcessWire root directory Delete .htaccess file (because you don't need it any more). I hope that this will help someone if the need arises for ProcessWire use on this kind of install. web.config.zip
    1 point
  8. Hi Ryan, thanks for the answer, I'll PM you regarding the purchase/licence. I have added @Webrocker to my "alternative" contact in the profile settings, but that did not "open" the proforum's door thanks for the work you put in all that!
    1 point
  9. Thank you mr-fan, that is exactly what I was after!
    1 point
  10. Might not be relevant anymore, but still wanted to answer this particular question. To find out when PageinatedArray.php was added to the core, open the file in GitHub, click "History", find the applicable commit (in this case the first one), and click the "< >" link next to the commit number ("browse the repository at this point in the history"). This is probably the easiest way to browse the repository at given point in time and check applicable ProcessWire version from /wire/core/ProcessWire.php or whatever else you might require. For tracking more specific changes you'd use "Blame" instead of "History" to find the commit and then hit "Browse files" from the top right corner of the commit message
    1 point
  11. I'm not sure how deep this issue goes, but fixing the pagination module issue can be quite easy. $pa = new PageArray(); $pa->setTotal($total)->setLimit($limit)->setStart($start); $pager = $this->modules->get('MarkupPagerNav'); $pager->baseUrl = $baseUrl; $pager->render($pa);
    1 point
  12. Use either $this->users->… or wire('users')->…
    1 point
  13. @Webrocker the Agency support/upgrades period should last for 1-year, regardless of whether a renewal or not. If you find that not to be the case, please let me know and I'll update your account to correct that. Though I'm not sure which account we are talking about, as you mentioned it was one separate from yours? Also, to add you to the Agency support, just have the purchasing account send me a PM indicating what other accounts they want to be attached to the support, and I'll be happy to add. Thanks.
    1 point
  14. Hey, a lot of times I create a role called "editor" and give all of the page-* permissions to it. No problems so far. But I normally forget to go to "home" template afterwards to set the permissions for the template, too. So my idea is to show a list of templates (maybe only the once you have selected as "Manage access individually") in a list like the following in the role edit screen: I think this would be a huge performance improvement and could save a lot of confusion and clicks.
    1 point
  15. Thank you! This solved the error for me.
    1 point
  16. Thank guys for this module - it was great to quickly set up a ratings system. A couple of thoughts though. I am not sure why it needs to be an autoload module - I'd rather you simply load it manually in a template file when you want to use it. I am not sure why it isn't simply a custom fieldtype that can be added to templates as needed - the way you have done it seems to work just fine, but the one issue I am having is that it can't be used as easily in all situations - for example, you can't select "rating" as an option when configuring a custom view with ListerPro. I am sure there are also other situations where it would be preferable to be a fieldtype, but maybe there are advantages to the approach you have taken that I am not thinking about. Of course if #2 is implemented, then #1 is no longer an issue Any chance you'd consider a bit of a rewrite to make it a fieldtype? if not, please let me know and I'll put something together myself - just trying to avoid duplicate modules that do the same thing Thanks for considering.
    1 point
  17. Hello again! We've just updated Ratings to Version 1.1, which includes a simpler, more unified API. You can access all API methods via the ratings property. Examples: $page->ratings->add(4); $page->ratings->average; // => 4.4 $page->ratings->count; // => 12 The changes should appear soon in the ProcessWire modules directory. Please check out our GitHub repository for more details.
    1 point
  18. Excellent information. I too have just successfully installed Processwire on Windows Server 2008 running IIS 7. Thanks to everybody posting on this page. Extra information from my situation in case somebody else is running into similar issues. I had never even heard of this CMS until I was told I needed to install it to host a web site for a subsidiary. I had previously installed PHP and MySQL on the system and really didn't feel like installing Apache if I didn't need to do so. I took a leap of faith after reading on the Requirements page that "A user has reported that that were able to install ProcessWire on IIS 7 in Windows 7." Issues and Resolutions Rename /site-default to /site The files you download for Processwire include the folder "site-default", just rename the folder as requested. I was looking to see how IIS interpreted the default web site and was confused immediately. It's a real simple request when you know what it means. Error 500 reported within the browser Immediately I got the 500 error in the browser. That didn't mean much to me so I executed the PHP script from command line. Open a command prompt and navigate to the directory in which you are installing Processwire type full path to php.exe or php-cgi.exe and then install.php e.g. C:\myphpfolder\php.exe install.php This will report the error generated in the script and not just the generic 500 error. In my case PW could not find MySQL on the host. Error 2002 No such host is known (Database connection error) I did a bunch of searching for this. The error actually occurred in the /wire/core/ProcessWire.php file. In review of the code I realized it was parsing the page location to find the "localhost" name. In my case I was not using the default website and I had another name not recognized by (I assume) the hosts file (C:\Windows\System32\drivers\etc). After thinking about it now, I could have probably added the name I had in the hosts file. My resolution was to "Add Application" within the Default Website in IIS pointing to the install location. Now localhost is a valid host name and MySQL could be located. Error 404 file or folder The Processwire home page was fine, but no sub-directory calls worked. That's when I found this post. I took nikola's suggestion: "Download URL Rewrite Module 2.0 for IIS from http://www.iis.net/download/urlrewrite and install it" I downloaded the web.config file he provided and placed it in the Processwire root I removed the <add sequence="module" /> entry as stated by jamestflynn Then finally incorporated the suggestions by zlojkashtan as I understood why that would be important The default site is running. The URL rewrites are working. You guys are awesome.
    1 point
  19. Thanks this was helpful. Only change I had to make was for this section: <denyUrlSequences> <add sequence="inc" /> <add sequence="info" /> <add sequence="module" /> <add sequence="sh" /> <add sequence="sql" /> <add sequence="\..*" /> </denyUrlSequences> I had to remove the <add sequence="module" /> line. It gave me a 404 for the module section in the admin until I removed that.
    1 point
  20. I use that kind of stuff in every project. Here is one of my "MarkupRenderHelper" modules (stripped some code to make it easier to follow - might throw few errors because of that, but should give the idea): <?php class MarkupRenderHelper extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Render Helper', 'version' => 100, 'summary' => 'Simple module that adds few methods to Pagearray and Page object. -Antti', 'singular' => true, 'autoload' => true ); } public function init() { $this->addHook('PageArray::renderArticleList', $this, 'renderArticleList'); $this->addHook('Page::renderListItem', $this, 'renderListItem'); $this->addHook('Page::renderTags', $this, 'renderTags'); $this->addHook('Page::renderMeta', $this, 'renderMeta'); $this->addHook('Page::firstImage', $this, 'firstImage'); } public function renderArticleList($event) { $articles = $event->data['object']; $out = "<ul class='acticles-list'>"; foreach($articles as $p) { $out .= $p->renderListItem(); } $out .= "</ul>"; $event->return = $out; } public function renderListItem($event) { $p = $event->data['object']; $parent = $p->parent(); $out = ""; $img = $p->firstImage(); if ($p->author) $author = $p->author . ","; $out .= "<li class='$parent->name'>"; if ($img) { $img = $img->width(130); $out .= "<img src='$img->url' width='$img->width' height='$img->height' alt='$img->description' />"; } $out .= "<div class='text-holder'>"; $out .= $p->renderMeta(); $out .= "<h2><a href='$p->url'>$p->title</a></h2>"; $out .= "<p>$p->summary</p>"; $out .= "</div>"; $out .= "</li>"; $event->return = $out; } public function renderMeta($event) { $p = $event->data['object']; $parent = $p->parent(); $author = ($p->author) ? $p->author . "," : ""; $out = "<span class='meta'><a href='$parent->url'>$parent->title</a> $author $p->publish_date </span>"; $event->return = $out; } public function renderTags($event) { $p = $event->data['object']; $out = ''; foreach($p->tags as $tag) { $out .= "<a href='$tag->url'>$tag->title</a>"; if ($tag !== $p->tags->last()) $out .= ", "; } $event->return = $out; } public function firstImage($event) { $p = $event->data['object']; if (count($p->images) > 0 ) { $img = $p->images->first(); } else { $img = false; } $event->return = $img; } } Sometimes I add "widgets" for $pages object too. Then I can just do <?= $pages->renderInfobox() ?> or something like that.
    1 point
  21. I started to write this post and at the same time figured out the answer from source. Decided to post my problem, since this is something that is currently missing from cheatsheet (not sure if everything should be there). I create page from API and I need to set that it children get sorted by custom field called candidate_number. How to set that from API? This is how: $p->sortfield = $fields->get('v_candidate_number');
    1 point
  22. You should also be able to do this: $p->sortfield = 'v_candidate_number';
    1 point
×
×
  • Create New...