Jump to content

kixe

Members
  • Posts

    802
  • Joined

  • Last visited

  • Days Won

    10

Everything posted by kixe

  1. @kcnpxcp Welcome to the forum. If you create a new page from the page field you have to change the name later under the tab field settings. If you have only a few tags its easier to create them manually and add them to your fieldtype page. You can also create pages from API within a template: $pages->add($template, $parent, $name); In this case title will betaken from name. Does this help? @owzim This option doesn't work by creating a new page via fieldtype page. Furthermore Name format for children is still under development and doesn't work properly. Look here: https://processwire.com/talk/topic/8551-custom-urls-for-pages/?p=82742
  2. About "Name format for children" option This option is still in development and not very well correct described (doesn't work properly too) Until now you have 3 options: If you type 'title' (without quotes) in the setting field you will get a page title 'untitled', because there doesn't exist a title if you autogenerate the page. from the 2nd page up you will get the title 'untitled-[n]' whereas n starts counting not at 1 but at the total number of sibling pages under this parent name is always date('Y-m-d-h-i-s') example '2014-12-15-04-10-30' If you type any other character than these (-_ a-zA-Z0-9) you will get a string generated with the date() function (sometimes weird stuff) If you type a string with allowed characters (-_ a-zA-Z0-9) you will get this string as a prefix. Same as above with the counter [n] Source of this information: wire/core/Pages.php Line 700 something
  3. I don't understand clearly what you want. If you want to create a page by API inside a template you can do this: $p = new Page(); $p->template = 'basic-page'; $p->parent = $pages->get(1); $p->name = date('Ymd').'-my-url-title'; $p->save(); to get a page with a specific name use: $pages->get('20141214-my-url-title'); //or $pages->find('20141214-my-url-title'); Does this help? If not please explain more clearly what you want to do.
  4. In your function you are just asking for the total number. If you need only this thats easy done. $pages->get('name=posts')->numChildren; more options http://cheatsheet.processwire.com/page/built-in-fields-reference/page-numchildren/
  5. This Topic should be marked as answered. Video Tutorial By the way before this option was implemented in core you could enable it by installing my LanguageTranslatorPlus Module which exists since 10/2013.
  6. module doesn't uninstall properly. put issue notes on github. If possible for you and not annoying for people using this module I would really recommend to rename your module since it doesn't generate fields at all. What about ProcessValueGenerator or ProcessRandValueGenerator.
  7. Are you sure you are talking about the same thing? @toothpaste Do you mean this? http://jqueryui.com/sortable/ or that? <form action="{$page->url}" method="post"> <select name="muzikanten" onchange="this.form.submit()"> <option value="A">Muzikant A</option> <option value="B">Muzikant B</option> <option value="C">Muzikant C</option> </select> </form> or both? @JanRomero urlSegments are nicer than raw GET parameters.
  8. very silly! switching around with fields I tested in a field with diabled textformatter. Everything works as expected. @Martijn: finally 9 because it has a flat rooftop. But you are right to use PW it is necessary to be able to count until 8 (or maybe 9)
  9. doesn't work https://www.google.com/maps/place/The+Great+Pyramid+at+Giza/@29.9797402,31.1351772,17z
  10. The $page object is an instance of the current page, which you are viewing, whereas $template object is an instance of the template itself.
  11. Super nice module. Awesome. Got some Notices, just to no. Notice: Undefined variable: field in /site/modules/FieldtypeOpenWeatherMap/FieldtypeOpenWeatherMapConfig.php on line 16 Notice: Trying to get property of non-object in /site/modules/FieldtypeOpenWeatherMap/FieldtypeOpenWeatherMapConfig.php on line 16
  12. Thats a question of philosophie. This module creates a page with a process field (which calls the module). This module hooks in ProcessPageListRender Changing the page status is a process In a way you are right: this module is not a process itself, but it executes one. Any suggestions for a better name? Something like HookProcessPageStatusToggler.module? I am often thinking about a straight naming syntax for modules. I have no idea ...
  13. @Soma no we don't. @Martijn Geerts Its already done. I updated it and included lock/unlock button too. @kongondo When I started with the module I didn't know about the one from geniestreiche. I startet on the base of Nicos ProcessPageDelete.module. I will not put it in the modules directory. I am open to merge the results with geniestreiche. Sent him a message.
  14. made some changes. Implements now publish/unpublish button too. Enable/ disable buttons via modules settings. @adrian Thanks. I changed this.
  15. @kongondo. I saw that coming but didn't search enough in the growing modules directory.
  16. It doesn't require LazyCron. Thats a copy paste bug . Thanks Adrian for the comments. I put it quickly together. Polishing will come soon. Thanks
  17. New Module which adds 1 more, but very tiny green buttons to the page list. It saves minimum 3 klicks to change page status from hidden to visible. Edit: update 11.12.14 Module provides up to 3 (more) buttons in page list to toggle status (hidden/visible, published/unpublished and locked/unlocked). Enable/Disable the buttons in the settings (screenshot) ProcessPageStatusToggler.module
  18. Welcome ChadD. Did you check these modules? http://modules.processwire.com/modules/markup-twitter-feed/ http://modules.processwire.com/modules/social-twitter-update/ http://modules.processwire.com/modules/markup-social-share-buttons/
  19. Need some help. Following works as expected foreach ($page->children as $member) { $key = $member->siblings->getItemKey($member)+1; if ($member == $member->siblings->last()) $rowend = "</div>\n"; elseif ($key%3 == 0) $rowend = "</div><div class=\"row\">\n"; else $rowend = ''; } ternary operator should do the same but brings different result. What is wrong? Cannot see it. foreach ($page->children as $member) { $key = $member->siblings->getItemKey($member)+1; $rowend = ($member == $member->siblings->last())?"</div>\n":($key%3 == 0)?"</div><div class=\"row\">\n":''; }
  20. You could create a module based on LazyCron by Ryan and combine it with my E-Mail-Verfication-Module which checks also availability of mailhost. Here is a function to check availability of an url. function check($str, $needle) { return (strpos($str, $needle) !== false); } function validate($url) { $header = @get_headers($url); return (isset($header) && count($header) > 0 && check($header[0], "200")); }
  21. To get a page by index number from a PageArray is easy: /* returns a page object */ $pagebyindex = $myparentpage->children->eq(integer $num); Now I needed a function which returns the Index of the page from the siblings. It took me a while to figure this out, and I like to share this here: /* returns an integer */ $indexbypage = $myparentpage->children->getItemKey($page); // or $indexbypage = $page->siblings->getItemKey($page); Found this information in http://cheatsheet.processwire.com/ under section PageArray/WireArray and here: http://processwire.com/apigen/ To get complete information about API this page is your (and my) friend. Have a nice day
  22. You could use the comment box to have this information in the cheatsheet.
  23. $page is always the current page if ($page->has('slider')) echo '<script src="path"></script>';
×
×
  • Create New...