Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/16/2013 in all areas

  1. After having had such fun creating a first theme for Textadept (see here http://processwire.com/talk/topic/3518-what-ide-do-you-utilize/?p=34637), I now created another theme, this time inspired by the colors of PW You can download Textadept here http://foicica.com/textadept/ And the ProcessWire theme here https://github.com/ocorreiododiogo/processwire-theme
    5 points
  2. I'm not sure what's up but it looks like the caching from GitHub was failing, as I tried to reload it several times but no luck. That issue has turned up in the past too. I went ahead and made /api/cheatsheet/ a redirect to http://cheatsheet.processwire.com - major thanks to Soma for developing the Cheatsheet into a ProcessWire site. It's quite impressive the way he's got it setup with Fredi too. I'm going to start adding more new PW 2.3 functions to it today.
    4 points
  3. Maybe Ryan was doing something, or it's again the caching from github page. Ryan setup a PW installation I've done to manage the cheatsheet in future. It's available here http://cheatsheet.processwire.com/ Or on github page http://somatonic.github.io/ProcessWireCheatsheet/
    4 points
  4. Wel Welcome sosoba! This would be possible by making a hook to any of the the form building methods in ProcessPageEdit.module. All methods with three underscores are hookable. All about hooks. Take the HelloWorld.module and add this hook to the init() $this->addHookAfter('ProcessPageEdit::buildFormSettings', $this, 'buildFormSettings'); And then add this function to the class. public function buildFormSettings(HookEvent $event){ $fieldset = $event->return; // get the fieldwrapper returned $field = $fieldset->get("_pw_page_name"); // get the name field $field->collapsed = Inputfield::collapsedYes; }
    3 points
  5. Some interesting reads for those interested in security: Well it should be mandatory for every webdev to know these thing or at least care about. Hack yourself first - how to go on the offence before online attackers do http://www.troyhunt.com/2013/05/hack-yourself-first-how-to-go-on.html Feel free to discuss or post other articles about the subject.
    2 points
  6. LanguageLocalizedURL module Localized URL generator and parser You can find the last version here: http://modules.proce...-localized-url/ Or from the repository on github: https://github.com/m...e-localized-URL This module is useful to generate localized url using the language code as first 'folder', and then the localized titles of the nested pages: (removed previous instructions to prevent double maintaining.) See more infos in readme of the module with instruction and informations. https://github.com/m...aster/README.md
    1 point
  7. First of all i'd like to say hello to all the community! Me and a co-worker are fresh users of Processwire. We've been wandering trough various cms's but this is a really high quality enviroment. Both flexible and powerful. I suspect we'll use it for many sites to come... I also wanted to share the site that was created (almost finished) with this fantastic CMS. Thanks Ryan! www.concinaprata.org Sorry but only Italian content. Back to the topic, the question i need answer to is: How can i set the name field visibility to Always collapsed? I noticed that my client, when creating pages, can't resist the urge to modify that field and that will surely create problems with the seo. I tried searching in the fields page, but name isn't listed there. Even in the database i couldn't find it...and i'd prefer not to touch core files. So i apologise beforehand if it was a crystal clear thing and i didn't see it!
    1 point
  8. I searched by Ryan's name instead of the plugin name. It didn't appear because it's not attributed... Now there are 3 likes, and I reported that attribution is missing
    1 point
  9. haha. I'm sure I have many on that wall as well.
    1 point
  10. diogo, I'm not following your example. (sorry). Wouldn't the parent always be either /shoes/men/ or /shoes/women/? The other parts of the selector are looking for pageField values — and there could be multiple. Maybe I'm being dense and just not getting it.
    1 point
  11. On top of what Reno just wrote, it can even be as simple as this: EDIT: As Reno pointed, this code is wrong, i was even taking in consideration only the last segment, which is not very clever... I will leave it here for the wall of shame if ($input->urlSegment1) { $mypage = ""; $template = ""; if ($input->urlSegment4) { $name = $input->urlSegment4; $parent = products; } elseif ($input->urlSegment3) { $name = $input->urlSegment3; $parent = collections; } elseif ($input->urlSegment2) { $name = $input->urlSegment2; $parent = kind; } else { $name = $input->urlSegment1; $parent = sex; } $name = $sanitizer->name($name) $mypage = $pages->get("parent=$parent, name=$name"); echo render($mypage); } else { // normal code for page without segments } Um Portuga, boa! Benvindo
    1 point
  12. Hi zyON, I think $input->urlSegments would work here. Although, you may need to up the maximum allowed number of segments in your /site/config.php — I think the default is 4, so you might be OK. Anyhow, for a URL like: http://sitename.com/shoes/men/brand1/casual/collection1/product1 In this case you are already specifying the exact page you want, so you can do a simple: $pages->get("name=$input->urlSegment4"); Putting it all together: $brand = ""; $type = ""; $collection = ""; if ($input->urlSegment1) $brand = ",brand.name=".$input->urlSegment1; if ($input->urlSegment2) $type = ",type.name=".$input->urlSegment2; if ($input->urlSegment3) $collection = ",collection.name=".$input->urlSegment3; if ($input->urlSegment4) { // if Segment 4, then we know what page to get $product = $pages->get("name=$input->urlSegment4"); } else if ($input->urlSegment1){ // check if we are using URL segments $products = $pages->find("parent=$page->path . $brand . $type . $collection"); } else { // do something else for pages without URL segments } This is untested, and written in the browser (there may also be easier methods, this is just off the top of my head while on lunch break.) ...and of course, it may not work at all. Try it out and let me know.
    1 point
  13. Why not $albums and $album->songs?
    1 point
  14. Btw, Have you seen this new Hooks page? Would probably be useful to you..
    1 point
  15. Hi Valan I'll preempt this by saying that I believe it may be possible to achieve in FormBuilder, though in Ryan's own words, Form Builder is a tool for making simple forms much much quicker to make rather than for coding more complex forms. I'd be tempted to make this myself to have more control let me know if you need any help. Perhaps Ryan or others may comment on this to confirm the possibility of using FB.
    1 point
  16. Il mio tempo è limitato ma se posso dare una mano la do volentieri.
    1 point
  17. Maybe I am late to the party but I've just discovered this little gem called SearchMark (github link). It's an open source chrome extension that does what historious does. It searches not only you bookmark titles and urls but their contents! I decided to Google for something like this since I have bookmarked lots of PW forum threads! There are times I know I have read something and I have it bookmarked but I just can't find it. I usually resort to Google to search for it again, which isn't the best use of my time . When I was on FF I used scrapbook for similar tasks but that would mean downloading a part of (or a whole) site then searching through the contents. It wasn't dynamic either - I would be searching through old content. But now, with SearchMark, I can "Google" the contents of my bookmarks. It works just like a Google search with wild cards and all! Results are returned with your search terms highlighted I tested SearchMark using this forum thread and was very pleased by its speed and accuracy: I searched the following (on the first post on that thread) // $field->children() - returns that thread + other threads with those search terms "// $field->children()" - returns only that thread // $field->children() -ideas - returns other threads except the above since it contains the word ideas // $field->children() +ideas - returns the above thread plus others with the search terms plus word ideas Now if I could limit it to only search my PW bookmark folder....//Edit: Of course I can add this +processwire.com to my search terms, duh! Hopefully someone finds this useful.
    1 point
  18. The $page var in the custom PHP field is "broken" in 2.3 as it doesn't return the page edited anymore but the process page edit. I just got a problem with this yesterday when updating a website to latest PW. I fixed it by using $_GET['id'] to get the id of the page being edited. $p = $pages->get($_GET['id']);
    1 point
  19. http://security.stackexchange.com/ is well worth a browse in a free moment.
    1 point
  20. I'm lost without CC... Edit: And why is the crying-smiley not working?
    1 point
  21. Me too. (At last, a semi-legitimate 'Me too' post!)
    1 point
  22. Ciao Alessio, mi chiamo Lorenzo, la tua è una buona idea...vediamo quante altre persone sul forum sono italiane
    1 point
  23. Hi Wanze! I should probably add from the very beginning that attribute pages (ones, that editor selects within each repeater item) have few other fields, particularly attribute category and attribute measure. For example, "length" attribute has "carcass" category and "cm" measure. So later during rendering attributes are grouped by category and values have measures. In this case I have to add 50*3 attribute fields (name, category, measure) + 50 value fields into the page... it is too much... Nevertheless, thanks for idea with foreach ($page->fields...) - quite useful PW feature that I've never used before! I guess that my question touches more fundamental things in PW. As far as I understand, currently PW pages are "field-static". I believe that introduction of a "dependable field" (field that PW dynamically substitutes based on "parent" field value within a page, using rules predefined by developer) in PW pages could attract more sophisticated projects.
    1 point
  24. You didn't find anything?? http://processwire.com/talk/topic/71-categorizingtagging-content/ http://processwire.com/talk/topic/2976-get-pages-with-the-most-similar-categories-sorted/ http://processwire.com/talk/topic/2010-fieldtype-for-storing-tags/ http://processwire.com/talk/topic/1916-another-categories-question/ http://processwire.com/talk/topic/2519-nested-categories/ http://processwire.com/talk/topic/3085-getting-tags-in-use/ http://processwire.com/talk/topic/2309-best-way-to-organize-categories-in-this-case/ http://processwire.com/talk/topic/1679-find-pages-with-multiple-categorytags/
    1 point
  25. Cody Lindley strikes again http://tech.pro/tutorial/1214/javascript-regular-expression-enlightenment
    1 point
  26. Hi valan, I see your point but I still think fields are the way to go. There are for certain some fields that are more often used, so you could group them together. Don't worry about the cars that do just hold a bunch of attributes, Pw scales well. You have more overhead with repeaters, because each repeater item is stored as page in ProcessWire. So with a car that has 50 attributes as repeater-items, you end up with 51 pages (1 car page + 50 repeater pages). You don't need to write 50+ lines of code, you can also loop through the fields of a page: foreach ($page->fields as $f) { // Maybe check for the value based on the type of field (select, page)... // if ($f->type == 'FieldtypeXY) ... $value = $page->get($f->name); if ($value) { echo $f->label . ' has value: ' . $value; } }
    1 point
  27. Well that doesn't really come through until now... So what now? If all of the "list" are in the PageArray (but also some others), or if the PageArray is the list 1:1... ? Now I'm curious why you want or need that? I would do that if you want to test if all of the list pages are in the PageArray: $result = $pages->find("template=basic-page"); $list = $pages->getById('1001,1002'); if(count($result->filter("id=$list")) == count($list)){ echo "all found"; }
    1 point
  28. That's what I assume he wants... If you want to know which is in the page array use filter. $found = $pageArray->filter("id=1001|1003|1005"); echo $found; // 1001|1003
    1 point
  29. zyON, Check into the Page Fieldtype Maybe something like this for organization: Shoes -- Men ---- Product A ---- Product B ---- Product C -- Women ---- Product A ---- Product B ---- Product C Brands (these are just the references, no products listed as children) -- Brand 1 -- Brand 2 -- Brand 3 Collections (these are just the references, no products listed as children) -- Collection A -- Collection B -- Collection C Create page fields for Brand and Collection, and add them to your "Product" template. Now you can associate brand and collection with each product. So to get the output you need: Shoes > Men (Any Brand) $pages->get("/shoes/men/") Shoes > Brand2 $pages->find("has_parent=/shoes/, brand.title=Brand 2") Shoes > Brand2 > CollectionB $pages->find("has_parent=/shoes/, brand.title=Brand 2, collection.title=Collection B") You could also pass $input values to the selector so this could be generated via use selections.
    1 point
  30. To avoid any duplication kongondo is talking: In latest versions (not sure if in stable yet), you can do this: $allArticles = $pages->find("template=article|image|video|audio|quote, sort-=created, limit=20"); foreach($allArticles as $article) { $templateFile = $article->template . "-teaser.php"; echo $article->render($templateFile); // It renders the content with article-teaser.php, image-teaser.php etc... } There is of course multiple ways of doing that (I rarely output any markup in templates directly), but I think that would be nice way of doing simple tubmlr-style blog.
    1 point
  31. I have new version coming that introduces ability to create new pages. I would be extremely happy to get some feedback about the methods and arguments I am planning. Currently it works like this: $fredi->newPage("templatename", "title|summary|body"); or $fredi->newPage("templatename", "title|summary|body", $parentPage); That would open new modal with title, summary and body fields. By default it creates new pages under the current page, but you can define alternative parent page there also. I have also created ability to set fieldWidths, just add =XX to fieldname and it gives the width. Those can be used both in edit and new page modals. Like this: $fredi->render("title|author=50|summary=50") I want to take this further: defining required fields and also for new pages prevalues and possible hidden fields. This means that simple string based fields definition doesn't fly that far, or it needs some super nice syntax. Ideas?
    1 point
×
×
  • Create New...