Jump to content

Wanze

PW-Moderators
  • Posts

    1,116
  • Joined

  • Last visited

  • Days Won

    10

Everything posted by Wanze

  1. Hi kamekun, Do you use repeaters to store your attributes of the car-models? You shouldn't do that, you may have problems with scaling when having lots of data. Can you post your site tree? How did your structure your templates? You could create a Question template, just with a title field, and put the question in the title. Then in your car-model-template, use a repeater field which has 2 fields: 1) A select dropdown to choose the question 2) A text field to write the answer Though if you have a lot of questions, then maybe it'll be hard to select the right one... Cheers
  2. Hi NikNak, You should be able to change the title of the modules by changing the title value of the page. For example for Google Analytics, the page is (default) located under Admin. You can open the page and set another title for german. I think this should work? For translating strings inside the page, you'll have to translate the file "/site/modules/ProcessGoogleAnalytics/ProcessGoogleAnalytics.module", as Manfred suggested. Cheers
  3. Hi Peter, What happens if you set $config->sessionChallenge = false in /site/config.php? Does it work then?
  4. Check your Console for Javascript errors and HTTP request errors, for example with Firebug.
  5. davo, If "Date" is the name of a date field, it should work. What exactly does not work? The sorting?
  6. $this->_() does only work in modules (inside classes). In templates (site/templates) you must use __('string');
  7. You must set the output formatting to false before changing the status. Also you need to write save(), because it's a method and not a property: wire('page')->of(false); wire('page')->addStatus(Page::statusUnpublished); wire('page')->save(); wire('page')->of(true);
  8. Depends on the variable you put in var_dump Can you tell what do you want to achieve, debug?
  9. @adrian Thanks for your help! You were right about the creatPath method, I was able to solve my problem Thanks ryan. I solved it by making wireMkdir recursive with the additional argument. In the PagefilesManager class I did the following updates: // Change _createPath() to support recursive directories protected function _createPath($path) { if(is_dir($path)) return true; return wireMkdir($path, true); } // Add new method static public function makeCustomPath(Page $page) { // Examples: ID=1780, path = /site/assets/files/17/80/ // ID=19814, path = /site/assets/files/19/81/4/ // ID=205478, path = /site/assets/files/20/54/78/ $tmpPath = ''; $digits = str_split("{$page->id}"); foreach ($digits as $k => $digit) { $tmpPath .= $digit; if (($k+1) % 2 == 0) $tmpPath .= '/'; } if (substr($tmpPath, -1) != '/') $tmpPath .= '/'; return $tmpPath; } // Custom path needs to be set in the _path() and url() methods static public function _path(Page $page) { //... //$publicPath = $path . ((int) $page->id) . '/'; $tmpPath = self::makeCustomPath($page); $publicPath = $path . $tmpPath; //... } public function url() { //return $this->config->urls->files . $this->page->id . '/'; return $this->config->urls->files . self::makeCustomPath($this->page); } Should be able to test this with many data soon, I'll report back here for those interested.
  10. Hi Marco, You can't instantiate an abstract class and call methods on it. Does it work if you don't make the parent controller abstract?
  11. Hi Marty, You can use the parent selector: parent=/path/to/my_parent/
  12. Interesting discussion here... The ext4 64k limit is becoming an issue for me with a large project. I have a product template with an product image and additional files. Currently, there are > 92'000 products in the old database. Pw will be used to manage the products in the backend and also as an online shop for clients. There will be 10 up to 100 new products per day, so the amount of data is growing constantly I was playing with the PageFilesManager class and modified the ::_path() method: //$publicPath = $path . ((int) $page->id) . '/'; // Make subfolders per ID $folders = str_split("{$page->id}"); $publicPath = $path . implode('/', $folders) . '/'; This returns for page with ID 1730 a path like "/var/www/pw/site/assets/files/1/7/3/0/" However, when I try to publish a new product page, I'm getting the error message Session: destinationPath is empty or does not exist (image) I didn't found where Pw should create this directory, I was first looking at the ProcessPageAdd and also in the Pages::save() method, but no luck yet. The error is throwed by the InputfieldFile::processInput(), which checks if this path exists. First: Would it be possible to create a solution like this? Second: Does anyone know when/where Pw does create the folder in /site/assets/files/ ? Cheers
  13. Hi Gabi, There's no difference between calling ->field or ->get('field'); First is routed through PHPs magic getter ( __get() ) and will call the get() method behind the scenes... If you want to have global variables available all the time, why not just store them in a variable, e.g. $global? No need to assign them to the actual $page variable: // Store page in $global or $sys $global = wire('pages')->get(1222); // Later in any template... just get the values from your variable echo "<div id='contact'>{$global->contact_name}</div>";
  14. Hi globi, It's not a good idea to have your posts as repeater. Why? Scaling. After a certain number of posts, you'll get problems with repeaters, because Pw has to load them all. Maybe you're already facing this problem? I'd suggest to write a script which loops through your repeater posts and add them as single pages. Cheers
  15. Just a little note to the translations: If you're in a class context (extending Wire), the way to translate strings is like this: $this->_('Your string to translate'); Whereas in templates, there's the following syntax to use: __('Translate me baby'); Great module
  16. Did you look at the generated markup? It works fine here. Of course you have also to adjust your css to match the class you've given, otherwise you'll see no effect on the webpage itself.
  17. See here: http://processwire.com/api/multi-language-support/code-i18n/
  18. Hi creativ3minds, Have you seen this thread? http://processwire.com/talk/topic/3691-tutorial-a-quick-guide-to-processwire-for-those-transitioning-from-modx/
  19. Pawel, I think you're misunderstanding something. Have you read what adrian posted? You can get the images from your gallery page anywhere in any template. No need to upload them multiple times: $images = $pages->get('/galleries/gal1/')->images; //Pick second image $img = $images->eq(1); // Pick fourth image $img = $images->eq(3);
  20. There's a typo: currrentItemClass should be currentItemClass
  21. It all depends on your server hardware and the filesystem that is running. There's no problem having thousands of folders. Ext4 can handle 64'000 subfolders but I'm sure this limit does not exist, because I have a site running with more pages and folders too.
  22. Wanze

    Avatar for pwired

    No tears left from laughing... Thanks WillyC
  23. Wanze

    Avatar for pwired

    Nice beard diogo! LoL this thread becomes better and better...
  24. Wanze

    Avatar for pwired

    @apeisa Nothing to worry about... I'm now also already 27 and also don't have much of a beard Let's see the good side: You don't have to shave that often
  25. Wanze

    Avatar for pwired

    It's the same, just needed a coffee
×
×
  • Create New...