Jump to content

doolak

Members
  • Posts

    319
  • Joined

  • Last visited

Everything posted by doolak

  1. Hi Joss, thanks for your answer! I know what those settings mean and i use them as you described. I just thought, that it may be a little confusing that it does not say: "May NEW pages using this template have children?" That would make it clearer that before setting this to "No" you can add some children but after having set it to "No" no more children will be possible.
  2. It's just a little thing, but i found it a bit confusing that in the template settings > family you have these options: 1. May pages using this template have children? but: 2. Can this template be used for new pages? Maybe it would be clearer if the first would be: "May pages using this template have new children?" And the same for the following: Allowed template(s) for parents > Allowed parent template(s) for new pages using this template Allowed template(s) for children > Allowed children template(s) for new pages using this template Or am i just a bit confused? ;-)
  3. I had to import over 500 of members as pages into PW, so i am using the Import Pages module. I wondered why a lot of members are imported without their birth date and i found out that the module seems to import one date format wrong: I was using the date format dd/mm/yyyy in the CSV - but it seems that it was imported as mm/dd/yyyy and the dates which have a day higher than 12 were not saved. In PW FieldtypeDate everything seems to be fine, i guess there is just a problem in the Import module. Now i changed the CSV to dd.mm.yyyy, changed the date to the same format in the PW date field and everything is imported correctly.
  4. It seems that as long the page is not added it does not have an own ID until the ProcessPageAdd is finished, so i have to check it somehow like: public function addScript(HookEvent $event) { $this->page = $this->pages->get($this->input->get->parent_id); if($this->page->template == 'mitglied') { $this->config->scripts->add($this->config->urls->PopulateTitle . "populate_title.js"); } } The code above does not work, so i tried to solve it with jQuery and found a solution: jQuery(document).ready(function() { if($('input[name=parent_id]').val() == '1015') { // do something } }); But i am sure there will be a possibility using the PW API and it would be nice to know what i made wrong in the first code above - would be great if someone could help me to find the mistake i made there.
  5. How can i check the template name of the page which will be added during ProcessPageAdd?
  6. For a page field i need to use a costum selector to find the selectable pages, which find just the pages which have a text field called "mitglied_name" which contains the letter "a" at the beginning - so i am using this selector: member_name^=a Generally it works fine - i just missed a few member names in the list and when i had a deeper look i recognized that words with less then 4 characters are not found. Can anybody confirm this issue or am i doing something wrong?
  7. Would it be somehow possible to display a date field formatted in a concat field? This is displayed as timestamp at the moment.
  8. Thanks for your help, Ryan! Yes, as i mentioned above, i recognized the directories with the preceding "-". So the temporary fix above will prevent new directories have that prefix, right? Edit: Ah, i see - it's described in the config.php: /** * Set to true if you want files on non-public or unpublished pages to be protected from direct URL access. * * When used, such files will be delivered at a URL that is protected from public access. * See also: fileContentTypes in /wire/config.php, which you may copy/paste into this file and modify * if you want to. * */ $config->pagefileSecure = true; /** * pagefileSecurePathPrefix: One or more characters prefixed to the pathname of protected file dirs. * * This should be some prefix that the .htaccess file knows to block requests for. As of version 2.3 * ProcessWire's htaccess file blocks files directories starting with a "-", so the default value * below is recommended here. * */# $config->pagefileSecurePathPrefix = '-'; Great, that will work for the moment! (I don't want to give the costumer superuser access - but it wouldn't be nice to deliver the site with that "little problem" that he can't see the images when having them uploaded and the page is unpublished... ;-)
  9. Yes, i thought the same and tried it with $(document).ready(function() already - but it did not work... or to be honest, i just thought it wouldn't work... I just inspected the source code with Safari and did not switch to the DOM tree or verified it in CSS Edit - at last both possibilities which are described above work fine! Thanks for your help again, Soma!
  10. Thanks for the hint using the data attribute - i have to admit i never used it before... In the template i am using: array ('item_tpl' => '<a href="{url}"><span class="nav_extra_title" data-extratitle="{nav_extra_title}"><span>{nav_extra_title}</span></span>{title}</a>') the jQuery i tried is: $('span.nav_extra_title[data-extratitle=""]').each(function(){ alert("hjgf"); $(this).toggleClass("kjh"); }); The script is located in a file which is loaded in the head.inc - the alert works fine ;-) - but i don't know how to change the class "nav_extra_title" to another or maybe add a class to it. I tried so many variations but it does not work...
  11. I am trying to use an additional code for the inner items, just for pages which have a specific value in one field. E.g. if a page has a textfield "extra_title" which is not empty the inner items should have an extra code part <span class="nav_extra_title"><span> . Has anybody an idea how this could be solved?
  12. Any news about this? Maybe you could give me a hint where the problem is located and i could try to fix it. I have to give a costumer access to the site and don't want to to this before the problem is fixed ;-)
  13. Yes, the comment is saved - but it does not show the success message when i use this code: $(document).ready(function() { var $input = "<input type='hidden' name='security_field' value='1' />"; $("#CommentForm form").append($input).parent().show(); }); When i use this, it works: $(document).ready(function() { var $input = "<input type='hidden' name='security_field' value='1' />"; $("#CommentForm form").append($input); $("#CommentForm").show(); });
  14. Anything new about the multilanguage image description? As i try to avoid that the site editor has the possibility to insert images in a texarea field, it's just a minor problem. For the most cases i will use a repeater field as ryan described. Just would be great to know for a current development site if there will be such a release soon or if it will take some more time to have this supported.
  15. I have tried that code now and it works fine - the success message is shown. @ryan: Does the spam protection work fine using the code above? If i use the code you posted the success message is not shown: $(document).ready(function() { var $input = "<input type='hidden' name='security_field' value='1' />"; $("#CommentForm form").append($input).parent().show(); });
  16. Ahh, forgot to mention: In the FieldtypeComments.module there are several strings untranslated, too (all the field settings and the text of the notification email).
  17. Great, thanks - that will make it unnecessary that i have to replace the InputfieldCommentsAdmin.module everytime after an update - or use a duplicate of that module just for the translated part ;-) But certainly it was a good thing for me to learn a bit about the translatable strings - and thanks to Martijn and Soma, i managed it to include the #$num - part now with the sprintf function: "\n\t\t\t<span class='CommentsAdminItemBy'>".sprintf($this->_("Comment #%d Posted"),$num)." ". date('d.m.Y H:i', $comment->created) ." " .$this->_("by"). " ". htmlentities($comment->cite, ENT_QUOTES, 'UTF-8') . "</span>" . @ryan: If you will be working on the InputfieldCommentsAdmin.module making it translatable, i have a fews suggestions for the module: 1. Don't know if this makes sense, but would be nice to have a possibility to change the date format in the field settings 2. If you sort newes to oldest - the comment numbers stay counting from 1 to ... - they should be inverted, too. 3. Would be great if instead of "Spam is automatically deleted after the amount of time specified in the field configuration." one could display the amount of time or the date the Spam will be deleted
  18. $out = sprintf(__("Created %d pages."), $count); That code was just an example from the Code Internationalization (i18n) docu (http://processwire.com/api/multi-language-support/code-i18n/) and as far as i understood it right, sprintf or printf are used instead of the $this-> - i just cannot get the part to work where you use a variable within the translatable string.
  19. As the administration backend of the Comments module is not translated and i have a costumer which does not speak English i am trying to make it translatable. I already made some parts translatable (Dropdown with "Pending", "Approved", "Spam" and "Delete" and the status which is shown at the right side ("Approved" and "Pending") - now i am trying to translate this part: "\n\t\t\t<span class='CommentsAdminItemBy'>Comment #$num Posted " . date('m/d/y H:i', $comment->created) . " by " . htmlentities($comment->cite, ENT_QUOTES, 'UTF-8') . "</span>" . As this is my first attempt to make a module translatable i made it like this, which works fine for my personal use: "\n\t\t\t<span class='CommentsAdminItemBy'>".$this->_("Comment")." #$num " .$this->_("Posted") ." ". date('m/d/y H:i', $comment->created) ." " .$this->_("by"). " ". htmlentities($comment->cite, ENT_QUOTES, 'UTF-8') . "</span>" . But of course it's not very smart to have the words "Comment", "Posted" and "by" translatable as seperate strings and as i saw in the documentation there seems to be a possibility using something like: $out = sprintf(__("Created %d pages."), $count); I tried to make the string translatable in a similar way but i cannot get it to work - would be great if somebody could help me with the part above to show me the right direction.
  20. I was trying it with "width" and "align" attributes - and of course you're right: it does make sense to use just style-attributes... and they will work fine.
  21. I already posted this issue to GitHub, but i am not sure if i made everything right over there (i closed the issue accidentally and reopened it) - so i decided to post it here, too: When i log in as a non-superuser and add an image to a repeater, it is loaded up but the image is not shown in the administration if the page is unpublished. If I publish it, the image is shown correctly - everything is fine. This just happens for an image field which belongs to a repeater. I tried to find out why this happens and it seems to have something to do with the minus-sign in front of the files folder which is used for unpublished pages. When logged in as superuser the image link is the same like for a non-superuser - the files folder is shown in the path without that minus-sign: /site/assets/files/1264/slide1.jpg But although the folder is named "-1264" the image is shown for superusers. Edit: Forgot to mention that i am using the latest dev version of PW
  22. I have the same problem with some attributes, e.g. setting table width or align and text align. I tried to modify the valid_elements, i even tried to use the full set which is provided on the TinyMCE website, but it's always stripped. Any news about this problem?
  23. @ Soma: Sorry for the confusion and thank you for your suggestions! Of course, i don't expect anybody to post a detailed "alternative" - i was just unsure in the beginning if i am absolutely on the wrong way. After having posted my first post and had some answers i wanted to keep you informed about the things i found out myself - hoped this makes it easier to help me finding a solution. At last there really seem to be both possibilities for the news: both languages in a seperate tree or both on one page. I managed it to get the first approach working but found some drawbacks for the "page tree approach", regarding a newspage. So now i am trying the other approach... For the main website i am using "one page multiple languages" - no seperate page tree.
×
×
  • Create New...